pub struct ConfiguredCeiling(ScopeSet);Expand description
The ceiling an operator wrote down, applied to every agent and every client alike.
plan/scope-policy.md’s “from server configuration first”: an
enumeration of scope atoms, not a pattern, read out of
didbot_config::sections::OAuthSection::scope_ceiling. Per-agent and
per-client profiles are the operator’s repository’s to hold, and this
ignores both arguments until that exists.
A seam, not a destination. plan/policy-store.md’s ceiling — read from
policy records in the operator’s repository, per agent and per client —
implements this same ScopePolicy trait and replaces this
implementation whole when it lands; nothing that calls a ceiling has to
change for it. What it needs first is an account on
didbot_policy::Subject::Grant, which is what a per-account rule would
have to match on.
It can only narrow. ConfiguredCeiling::new intersects what it was
given with GrantAnyScope’s own ceiling and keeps the overlap, so a
configured atom outside the compiled-in ceiling — anything in
plan/scope-policy.md’s hard-blocked set, or a kind: a later grammar
adds — grants nothing however it is spelled in the file. That is what
lets a scope live in a configuration file at all; see
didbot_config’s own crate doc.
Tuple Fields§
§0: ScopeSetImplementations§
Source§impl ConfiguredCeiling
impl ConfiguredCeiling
Sourcepub fn new<'a>(atoms: impl IntoIterator<Item = &'a str>) -> (Self, DroppedAtoms)
pub fn new<'a>(atoms: impl IntoIterator<Item = &'a str>) -> (Self, DroppedAtoms)
Builds a ceiling from the atoms an operator enumerated, dropping every one the compiled-in ceiling does not already admit.
An atom is kept only if the compiled-in ceiling admits it whole.
A partial admission is dropped rather than kept at its projection:
transition:generic overlaps repo:* rpc:*, and an operator who
wrote a hard-blocked atom should get nothing for it rather than the
slice of it that happens to fall inside. An atom that does not parse
is dropped for the same reason — this runs at startup, and a ceiling
that fails closed on the atoms it understood is the safe reading of a
file it only half understands. The dropped atoms are returned so the
caller can log them.
Bounded at crate::oauth::scope::MAX_SCOPE_ATOMS.
ScopeSet::new compares every pair of atoms it is handed, and that
constant is what bounds the comparison — which it does for
ScopeSet::parse, applied per string, but each configured atom is
parsed on its own here and the results accumulate. Without this a
configuration file naming a few thousand atoms is a few million
comparisons at boot.
Trait Implementations§
Source§impl Clone for ConfiguredCeiling
impl Clone for ConfiguredCeiling
Source§fn clone(&self) -> ConfiguredCeiling
fn clone(&self) -> ConfiguredCeiling
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConfiguredCeiling
impl Debug for ConfiguredCeiling
Source§impl ScopePolicy for ConfiguredCeiling
impl ScopePolicy for ConfiguredCeiling
Auto Trait Implementations§
impl Freeze for ConfiguredCeiling
impl RefUnwindSafe for ConfiguredCeiling
impl Send for ConfiguredCeiling
impl Sync for ConfiguredCeiling
impl Unpin for ConfiguredCeiling
impl UnsafeUnpin for ConfiguredCeiling
impl UnwindSafe for ConfiguredCeiling
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
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>
§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>
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