pub enum AuthContext {
User {
user_id: Uuid,
tenant_id: Uuid,
roles: Vec<String>,
},
Owner {
user_id: Uuid,
tenant_id: Uuid,
resource_id: Uuid,
resource_type: String,
},
Service {
service_name: String,
tenant_id: Option<Uuid>,
},
Admin {
admin_id: Uuid,
},
Anonymous,
}Expand description
Authorization context extracted from a request
Variants§
User
Authenticated user
Owner
Owner of a specific resource
Service
Service-to-service communication
Admin
System administrator
Anonymous
No authentication (public access)
Implementations§
Source§impl AuthContext
impl AuthContext
Sourcepub fn is_service(&self) -> bool
pub fn is_service(&self) -> bool
Check if context represents a service
Trait Implementations§
Source§impl Clone for AuthContext
impl Clone for AuthContext
Source§fn clone(&self) -> AuthContext
fn clone(&self) -> AuthContext
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 moreAuto Trait Implementations§
impl Freeze for AuthContext
impl RefUnwindSafe for AuthContext
impl Send for AuthContext
impl Sync for AuthContext
impl Unpin for AuthContext
impl UnwindSafe for AuthContext
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