pub struct SecurityContext { /* private fields */ }Expand description
SecurityContext encapsulates the security-related information for a request or operation
Implementations§
Source§impl SecurityContext
impl SecurityContext
Sourcepub fn builder() -> SecurityContextBuilder
pub fn builder() -> SecurityContextBuilder
Create a new SecurityContext builder
Sourcepub fn anonymous() -> Self
pub fn anonymous() -> Self
Create an anonymous SecurityContext with no tenant, subject, or permissions
Sourcepub fn subject_id(&self) -> Uuid
pub fn subject_id(&self) -> Uuid
Get the subject ID (user, service, or system) associated with the security context
Sourcepub fn permissions(&self) -> Vec<Permission>
pub fn permissions(&self) -> Vec<Permission>
Get the permissions assigned to the security context
Sourcepub fn environment(&self) -> Vec<(String, String)>
pub fn environment(&self) -> Vec<(String, String)>
Get the environmental attributes associated with the security context (e.g., IP address, device type, location, time, etc.)
pub fn scope(&self, policy_engine: PolicyEngineRef) -> AccessScopeResolver
Trait Implementations§
Source§impl Clone for SecurityContext
impl Clone for SecurityContext
Source§fn clone(&self) -> SecurityContext
fn clone(&self) -> SecurityContext
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 SecurityContext
impl Debug for SecurityContext
Source§impl<'de> Deserialize<'de> for SecurityContext
impl<'de> Deserialize<'de> for SecurityContext
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SecurityContext
impl RefUnwindSafe for SecurityContext
impl Send for SecurityContext
impl Sync for SecurityContext
impl Unpin for SecurityContext
impl UnwindSafe for SecurityContext
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