pub struct OpenAuth { /* private fields */ }Expand description
Initialized OpenAuth instance.
Implementations§
Source§impl OpenAuth
impl OpenAuth
Sourcepub fn builder() -> OpenAuthBuilder
pub fn builder() -> OpenAuthBuilder
Start an OpenAuthBuilder using default OpenAuthOptions.
Sourcepub fn handler(
&self,
request: Request<Vec<u8>>,
) -> Result<Response<Vec<u8>>, OpenAuthError>
pub fn handler( &self, request: Request<Vec<u8>>, ) -> Result<Response<Vec<u8>>, OpenAuthError>
Handle a request through the synchronous endpoint router.
This is useful for endpoint sets that do not require async database or
network work. Most adapter-backed applications should use
OpenAuth::handler_async.
Sourcepub async fn handler_async(
&self,
request: Request<Vec<u8>>,
) -> Result<Response<Vec<u8>>, OpenAuthError>
pub async fn handler_async( &self, request: Request<Vec<u8>>, ) -> Result<Response<Vec<u8>>, OpenAuthError>
Handle a request through the async endpoint router.
Sourcepub fn options(&self) -> &OpenAuthOptions
pub fn options(&self) -> &OpenAuthOptions
Return the effective options used to build this instance.
Sourcepub fn context(&self) -> &AuthContext
pub fn context(&self) -> &AuthContext
Return the initialized authentication context.
Sourcepub fn router(&self) -> &AuthRouter
pub fn router(&self) -> &AuthRouter
Return the underlying router.
Sourcepub fn endpoint_registry(&self) -> Vec<EndpointInfo>
pub fn endpoint_registry(&self) -> Vec<EndpointInfo>
Return metadata for all registered endpoints.
Sourcepub fn openapi_schema(&self) -> Value
pub fn openapi_schema(&self) -> Value
Generate the OpenAPI schema for the registered endpoint surface.
Sourcepub async fn create_schema(
&self,
file: Option<&str>,
) -> Result<Option<SchemaCreation>, OpenAuthError>
pub async fn create_schema( &self, file: Option<&str>, ) -> Result<Option<SchemaCreation>, OpenAuthError>
Create the database schema for this instance.
Returns an error when the instance was created without an adapter.
When file is provided, adapter implementations may write migration
SQL to that path and return adapter-specific creation metadata.
Sourcepub async fn run_migrations(&self) -> Result<(), OpenAuthError>
pub async fn run_migrations(&self) -> Result<(), OpenAuthError>
Run adapter migrations for the configured core and plugin schema.
Returns an error when the instance was created without an adapter.