#[non_exhaustive]pub struct RbacConfig {
pub enabled: bool,
pub roles: Vec<RoleConfig>,
pub redaction_salt: Option<SecretString>,
}Expand description
Top-level RBAC configuration (deserializable from TOML).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.enabled: boolMaster switch – when false, the RBAC middleware is not installed.
roles: Vec<RoleConfig>Role definitions available to identities.
redaction_salt: Option<SecretString>Optional stable HMAC key (any length) used to redact argument
values in deny logs. When set, redacted hashes are stable across
process restarts (useful for log correlation across deploys).
When None, a random 32-byte key is generated per process at
first use; redacted hashes change every restart.
The key is wrapped in SecretString so it never leaks via
Debug/Display/serde and is zeroized on drop.
Implementations§
Source§impl RbacConfig
impl RbacConfig
Sourcepub fn with_roles(roles: Vec<RoleConfig>) -> Self
pub fn with_roles(roles: Vec<RoleConfig>) -> Self
Create an enabled RBAC config with the given roles.
Trait Implementations§
Source§impl Clone for RbacConfig
impl Clone for RbacConfig
Source§fn clone(&self) -> RbacConfig
fn clone(&self) -> RbacConfig
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 RbacConfig
impl Debug for RbacConfig
Source§impl Default for RbacConfig
impl Default for RbacConfig
Source§fn default() -> RbacConfig
fn default() -> RbacConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for RbacConfig
impl<'de> Deserialize<'de> for RbacConfig
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 RbacConfig
impl RefUnwindSafe for RbacConfig
impl Send for RbacConfig
impl Sync for RbacConfig
impl Unpin for RbacConfig
impl UnsafeUnpin for RbacConfig
impl UnwindSafe for RbacConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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