Struct LocalConfigApprovalIdentityResolver
pub struct LocalConfigApprovalIdentityResolver;Expand description
Config-backed resolver over [sop.approval].groups.*.members. Stateless: it
reads the config handed to it on each call, so there is no second copy of the
membership map to go stale. A member entry may be source-qualified
(<source>:<identity>, e.g. http:<subject>, agent:<alias>) to grant rights
on ONE transport only - so a subject on the gateway and the same string on the
agent tool do not collide - or a bare identity to grant it from any source.
Channel principals are stricter: they match only
channel:<channel-key>:<sender>, never channel:<sender> or a bare sender, so
same-looking platform ids from different channel aliases cannot collide. A
principal with no identity (e.g. the system tick) belongs to no group.
NOTE on the identity each surface actually PRODUCES today. The gateway HTTP and
WS paths both produce the paired-token hash (a stable per-device subject); they
share it, so for quorum they collapse to ONE canonical gateway voter (see
super::principal::ApprovalPrincipal::voter_key). The agent tool produces the
agent alias. The loopback CLI (zeroclaw sop approve) is currently ANONYMOUS -
the admin path builds ApprovalPrincipal::cli(None) - so a cli:<user> group
member is NOT satisfiable yet; it is reserved for a future CLI that forwards a
trusted local identity, so do not gate a policy on cli:<user> expecting the
current CLI to meet it. A future auth resolver (the documented junction seam) is
where a per-PERSON canonical identity - linking a user’s several device/channel
subjects to one account - belongs; until then membership is per-subject.
Trait Implementations§
Source§impl ApprovalIdentityResolver for LocalConfigApprovalIdentityResolver
impl ApprovalIdentityResolver for LocalConfigApprovalIdentityResolver
Source§fn groups_for(
&self,
cfg: &SopApprovalConfig,
principal: &ApprovalPrincipal,
) -> Vec<String>
fn groups_for( &self, cfg: &SopApprovalConfig, principal: &ApprovalPrincipal, ) -> Vec<String>
cfg (may be empty).Source§fn is_member(
&self,
cfg: &SopApprovalConfig,
principal: &ApprovalPrincipal,
group: &str,
) -> bool
fn is_member( &self, cfg: &SopApprovalConfig, principal: &ApprovalPrincipal, group: &str, ) -> bool
group under cfg.Auto Trait Implementations§
impl Freeze for LocalConfigApprovalIdentityResolver
impl RefUnwindSafe for LocalConfigApprovalIdentityResolver
impl Send for LocalConfigApprovalIdentityResolver
impl Sync for LocalConfigApprovalIdentityResolver
impl Unpin for LocalConfigApprovalIdentityResolver
impl UnsafeUnpin for LocalConfigApprovalIdentityResolver
impl UnwindSafe for LocalConfigApprovalIdentityResolver
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
§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