pub struct AuthenticationValidator { /* private fields */ }Expand description
Compile-time authentication validator
Implementations§
Source§impl AuthenticationValidator
impl AuthenticationValidator
Sourcepub async fn register_credential(
&self,
credential: &str,
tenant_context: TenantContext,
)
pub async fn register_credential( &self, credential: &str, tenant_context: TenantContext, )
Register a credential (for testing/setup)
Sourcepub async fn authenticate(
&self,
credential: LinearCredential,
) -> Result<AuthenticationWitness, AuthenticationError>
pub async fn authenticate( &self, credential: LinearCredential, ) -> Result<AuthenticationWitness, AuthenticationError>
Authenticate a credential with compile-time proof
This method consumes the credential and either returns an authentication witness (proving successful validation) or an error with proof of consumption.
Trait Implementations§
Source§impl Clone for AuthenticationValidator
impl Clone for AuthenticationValidator
Source§fn clone(&self) -> AuthenticationValidator
fn clone(&self) -> AuthenticationValidator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AuthenticationValidator
impl Debug for AuthenticationValidator
Auto Trait Implementations§
impl Freeze for AuthenticationValidator
impl !RefUnwindSafe for AuthenticationValidator
impl Send for AuthenticationValidator
impl Sync for AuthenticationValidator
impl Unpin for AuthenticationValidator
impl !UnwindSafe for AuthenticationValidator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> TenantValidator for T
impl<T> TenantValidator for T
Source§fn validate_tenant_context(
&self,
expected_tenant_id: &str,
context: &RequestContext,
) -> Result<(), String>
fn validate_tenant_context( &self, expected_tenant_id: &str, context: &RequestContext, ) -> Result<(), String>
Validate that the context has the expected tenant.
Source§fn validate_single_tenant_context(
&self,
context: &RequestContext,
) -> Result<(), String>
fn validate_single_tenant_context( &self, context: &RequestContext, ) -> Result<(), String>
Validate that the context is for single-tenant operation.
Source§fn require_tenant_context(&self, context: &RequestContext) -> Result<(), String>
fn require_tenant_context(&self, context: &RequestContext) -> Result<(), String>
Extract tenant context or return error for multi-tenant operations.