pub struct AuthInitContext<S: AuthSchema> {
pub config: Arc<AuthConfig>,
pub database: Arc<dyn AuthStore<S>>,
pub email_provider: Option<Arc<dyn EmailProvider>>,
pub metadata: HashMap<String, Value>,
pub extensions: ContextExtensions,
}Expand description
Initialization context passed to plugin setup.
Fields§
§config: Arc<AuthConfig>§database: Arc<dyn AuthStore<S>>§email_provider: Option<Arc<dyn EmailProvider>>§metadata: HashMap<String, Value>§extensions: ContextExtensionsImplementations§
Source§impl<S: AuthSchema> AuthInitContext<S>
impl<S: AuthSchema> AuthInitContext<S>
pub fn new(config: Arc<AuthConfig>, database: Arc<dyn AuthStore<S>>) -> Self
pub fn set_metadata(&mut self, key: impl Into<String>, value: Value)
Sourcepub fn register_password_hash_hook(&mut self, hook: Arc<dyn PasswordHashHook>)
pub fn register_password_hash_hook(&mut self, hook: Arc<dyn PasswordHashHook>)
Decorate the instance’s actual password hashing boundary. Later registrations run first, matching initialized hash wrappers.
pub fn get_metadata(&self, key: &str) -> Option<&Value>
Sourcepub fn register_user_create_transform<F>(&mut self, transform: F)
pub fn register_user_create_transform<F>(&mut self, transform: F)
Register a transform for user creation, including transactional creation.
Sourcepub fn register_user_creation_adapter_default<F>(&mut self, default: F)
pub fn register_user_creation_adapter_default<F>(&mut self, default: F)
Register model defaults applied after creation hooks to an identity candidate admitted by the configured user validation policy.
Sourcepub fn register_user_update_transform<F>(&mut self, transform: F)
pub fn register_user_update_transform<F>(&mut self, transform: F)
Register a transform applied to every user update through this auth instance.
Sourcepub fn register_session_created_hook(
&mut self,
callback: Arc<dyn SessionCreatedHook<S>>,
)
pub fn register_session_created_hook( &mut self, callback: Arc<dyn SessionCreatedHook<S>>, )
Register an adapter lifecycle callback for each committed session creation. Transactional creations defer callbacks until commit and discard them on rollback. A callback error propagates after persistence, as for other adapter after callbacks. Trusted server operations have no request context.
Sourcepub fn register_adapter_after_hook(
&mut self,
callback: Arc<dyn AdapterAfterHook<S>>,
)
pub fn register_adapter_after_hook( &mut self, callback: Arc<dyn AdapterAfterHook<S>>, )
Observe genuine retained adapter output after a write, with transaction callbacks deferred until commit. Existing typed physical hooks are separate.
Sourcepub fn register_session_deletion_hook(
&mut self,
hook: Arc<dyn SessionDeletionHook<S>>,
)
pub fn register_session_deletion_hook( &mut self, hook: Arc<dyn SessionDeletionHook<S>>, )
Register instance-local dependant work around successful session deletion.
Sourcepub fn database_with_registered_transforms(&self) -> Arc<dyn AuthStore<S>> ⓘ
pub fn database_with_registered_transforms(&self) -> Arc<dyn AuthStore<S>> ⓘ
Finalize the instance’s store without mutating a shared underlying adapter.