pub struct AuthGuardConfig {
pub skip_paths: HashSet<String>,
pub optional: bool,
pub required_roles: Vec<String>,
pub required_permissions: Vec<String>,
pub require_all_roles: bool,
pub require_all_permissions: bool,
pub required_resource_actions: Vec<ResourceAction>,
pub auth_context: HashMap<String, Value>,
}Expand description
Authentication guard configuration
Fields§
§skip_paths: HashSet<String>Paths that skip authentication
optional: boolWhether authentication is optional
required_roles: Vec<String>Required roles (any of these roles grants access)
required_permissions: Vec<String>Required permissions (any of these permissions grants access)
require_all_roles: boolWhether to require all roles (true) or any role (false)
require_all_permissions: boolWhether to require all permissions (true) or any permission (false)
required_resource_actions: Vec<ResourceAction>Required resource-action permissions for RBAC
auth_context: HashMap<String, Value>Authorization context for conditional permissions
Trait Implementations§
Source§impl Clone for AuthGuardConfig
impl Clone for AuthGuardConfig
Source§fn clone(&self) -> AuthGuardConfig
fn clone(&self) -> AuthGuardConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 AuthGuardConfig
impl Debug for AuthGuardConfig
Auto Trait Implementations§
impl Freeze for AuthGuardConfig
impl RefUnwindSafe for AuthGuardConfig
impl Send for AuthGuardConfig
impl Sync for AuthGuardConfig
impl Unpin for AuthGuardConfig
impl UnsafeUnpin for AuthGuardConfig
impl UnwindSafe for AuthGuardConfig
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more