Struct ResolverPolicy
pub struct ResolverPolicy {
pub profiles: HashMap<String, ResolvedGrants>,
pub oidc: HashMap<String, OidcMapping>,
pub roster: HashMap<String, Vec<String>>,
pub roster_conflict: bool,
}Expand description
One compiled authorization policy: everything the resolver needs at one generation. Immutable once installed; a config change installs a new policy (and bumps the generation) rather than mutating this one.
Fields§
§profiles: HashMap<String, ResolvedGrants>Compiled [permission_profiles.<alias>] grant sets.
oidc: HashMap<String, OidcMapping>[oidc.<alias>] identity mappings, by alias.
roster: HashMap<String, Vec<String>>Local roster: durable principal id → the profile aliases granted to
it. Keyed by the EFFECTIVE principal id (principal_id override or
entry name), which is what a local provider binds.
roster_conflict: boolSet when two [users] entries resolved to the SAME effective
principal id: the roster cannot deterministically say which grants
win, so it is emptied (fail closed) and this flag lets the reload
path refuse to install the invalid replacement.
Implementations§
Source§impl ResolverPolicy
impl ResolverPolicy
Sourcepub fn from_config(config: &Config) -> Result<Self>
pub fn from_config(config: &Config) -> Result<Self>
Compile the auth sections of a Config, validating them first.
This is where the “validated config” precondition is actually
enforced: load_or_init deliberately tolerates a semantically
invalid config so an operator can boot to repair it, so the resolver
cannot assume its input was checked. Running the auth-specific
validation here means duplicate uids or effective principal ids,
invalid issuers, and dangling profile references are rejected before
anything is compiled — nothing invalid can become a serving policy.
The resolver still fails closed if it meets a gap at resolve time.
Trait Implementations§
Source§impl Clone for ResolverPolicy
impl Clone for ResolverPolicy
Source§fn clone(&self) -> ResolverPolicy
fn clone(&self) -> ResolverPolicy
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResolverPolicy
impl Debug for ResolverPolicy
Source§impl Default for ResolverPolicy
impl Default for ResolverPolicy
Source§fn default() -> ResolverPolicy
fn default() -> ResolverPolicy
Auto Trait Implementations§
impl Freeze for ResolverPolicy
impl RefUnwindSafe for ResolverPolicy
impl Send for ResolverPolicy
impl Sync for ResolverPolicy
impl Unpin for ResolverPolicy
impl UnsafeUnpin for ResolverPolicy
impl UnwindSafe for ResolverPolicy
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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