pub struct AuthContext {Show 22 fields
pub app_name: String,
pub base_url: String,
pub base_path: String,
pub options: RustAuthOptions,
pub auth_cookies: AuthCookies,
pub session_config: SessionConfig,
pub secret: String,
pub secret_config: SecretMaterial,
pub password: PasswordContext,
pub rate_limit: RateLimitContext,
pub trusted_origins: Vec<String>,
pub disabled_paths: Vec<String>,
pub plugins: Vec<AuthPlugin>,
pub adapter: Option<Arc<dyn DbAdapter>>,
pub secondary_storage: Option<Arc<dyn SecondaryStorage>>,
pub background_tasks: Option<Arc<dyn BackgroundTaskRunner>>,
pub db_schema: DbSchema,
pub plugin_error_codes: BTreeMap<String, PluginErrorCode>,
pub plugin_database_hooks: Vec<PluginDatabaseHook>,
pub plugin_migrations: Vec<PluginMigration>,
pub telemetry_publisher: ContextTelemetryPublisher,
pub logger: Logger,
}Fields§
§app_name: String§base_url: String§base_path: String§options: RustAuthOptions§session_config: SessionConfig§secret: String§secret_config: SecretMaterial§password: PasswordContext§rate_limit: RateLimitContext§trusted_origins: Vec<String>§disabled_paths: Vec<String>§plugins: Vec<AuthPlugin>§adapter: Option<Arc<dyn DbAdapter>>§secondary_storage: Option<Arc<dyn SecondaryStorage>>§background_tasks: Option<Arc<dyn BackgroundTaskRunner>>§db_schema: DbSchema§plugin_error_codes: BTreeMap<String, PluginErrorCode>§plugin_database_hooks: Vec<PluginDatabaseHook>§plugin_migrations: Vec<PluginMigration>§telemetry_publisher: ContextTelemetryPublisher§logger: LoggerImplementations§
Source§impl AuthContext
impl AuthContext
pub fn db_schema(&self) -> &DbSchema
Sourcepub fn schema(&self) -> AuthSchema<'_>
pub fn schema(&self) -> AuthSchema<'_>
Schema-aware query helpers using logical table and field names.
pub fn adapter(&self) -> Option<Arc<dyn DbAdapter>>
Sourcepub fn require_adapter(&self) -> Result<Arc<dyn DbAdapter>, RustAuthError>
pub fn require_adapter(&self) -> Result<Arc<dyn DbAdapter>, RustAuthError>
Returns the configured database adapter or a configuration error.
Sourcepub fn adapter_ref(&self) -> Result<&dyn DbAdapter, RustAuthError>
pub fn adapter_ref(&self) -> Result<&dyn DbAdapter, RustAuthError>
Borrows the configured database adapter for the lifetime of this context.
Sourcepub fn users(&self) -> Result<DbUserStore<'_>, RustAuthError>
pub fn users(&self) -> Result<DbUserStore<'_>, RustAuthError>
Schema-aware user store using this context’s adapter and table mapping.
Sourcepub fn sessions(&self) -> Result<SessionStore<'_>, RustAuthError>
pub fn sessions(&self) -> Result<SessionStore<'_>, RustAuthError>
Session store using this context’s adapter, schema, and session options.
Sourcepub fn verifications(&self) -> Result<VerificationStore<'_>, RustAuthError>
pub fn verifications(&self) -> Result<VerificationStore<'_>, RustAuthError>
Verification store (database and/or secondary storage per auth options).
Prefer this in handlers and plugins. It routes reads and writes through configured secondary storage when present.
Sourcepub fn session_store(&self) -> Result<DbSessionStore<'_>, RustAuthError>
pub fn session_store(&self) -> Result<DbSessionStore<'_>, RustAuthError>
Schema-aware session database store (direct adapter access only).
Sourcepub fn verification_store(
&self,
) -> Result<DbVerificationStore<'_>, RustAuthError>
pub fn verification_store( &self, ) -> Result<DbVerificationStore<'_>, RustAuthError>
Schema-aware verification database store (direct adapter access only).
Use Self::verifications unless you need database-only helpers such as
compare-and-update on the verification row.
Build a plugin auth cookie definition that inherits the core cookie
naming and attribute policy (cookie_prefix, secure-name prefix,
cross-subdomain domain, and default_cookie_attributes), exactly as
the core session cookies produced by get_cookies.
pub fn secondary_storage(&self) -> Option<Arc<dyn SecondaryStorage>>
pub fn run_background_task(&self, task: BackgroundTaskFuture) -> bool
pub async fn publish_telemetry(&self, event: ContextTelemetryEvent)
pub fn has_plugin(&self, id: &str) -> bool
pub fn plugin(&self, id: &str) -> Option<&AuthPlugin>
pub fn is_trusted_origin( &self, url: &str, settings: Option<OriginMatchSettings>, ) -> bool
pub fn trusted_origins_for_request( &self, request: Option<&Request<Vec<u8>>>, ) -> Result<Vec<String>, RustAuthError>
pub fn trusted_providers_for_request( &self, request: Option<&Request<Vec<u8>>>, ) -> Result<Vec<String>, RustAuthError>
pub fn is_trusted_origin_for_request( &self, url: &str, settings: Option<OriginMatchSettings>, request: Option<&Request<Vec<u8>>>, ) -> Result<bool, RustAuthError>
Trait Implementations§
Source§impl Clone for AuthContext
impl Clone for AuthContext
Source§fn clone(&self) -> AuthContext
fn clone(&self) -> AuthContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more