pub struct Hop {
pub principal: String,
pub for_: Vec<String>,
pub limit: Option<HopLimit>,
pub call: String,
pub token: Option<String>,
}Expand description
spec/12’s hop, as a child reads it: who acts, for whom, within what.
for grants nothing; limit is a ceiling, never a grant.
Fields§
§principal: StringWho acts: the service that forwarded the call.
for_: Vec<String>On whose behalf, nearest first; [] when the service calls for
itself or its caller is anonymous.
limit: Option<HopLimit>The service gate’s verdict, in this child’s terms; None when no
gate decided.
call: StringThe hop’s id for this call, to join the two logs.
token: Option<String>DYNAUTH-12: the peer token the service minted for this one call
(plexus::peer_token): addressed to this child, bound to its key,
naming call and the method. A child that verifies
(ServeChild::tokens) checks the hop by it, and (KEEL-19) believes
it only from whoever the token’s cnf names: the service’s own
connection for a token it forwards, or the presenter, with its proof
(the hop’s proof, beside the token), for one exchanged
(dyn.exchange). Never logged.
Implementations§
Source§impl Hop
impl Hop
Sourcepub fn caller(&self) -> Option<&str>
pub fn caller(&self) -> Option<&str>
The caller the hop acts for — the far end of for — or None
when it acts for itself or for an anonymous caller.
Sourcepub fn held_on(&self) -> Vec<ScopeRef>
pub fn held_on(&self) -> Vec<ScopeRef>
The ceiling: the scopes the near side admitted the caller on. Empty when no gate decided — and then nothing is within it (fail closed).
Sourcepub fn allows(&self, chain: &[ScopeRef]) -> bool
pub fn allows(&self, chain: &[ScopeRef]) -> bool
Whether a target whose scope chain is chain is within the ceiling:
held on *, or on a scope of the chain. false when no gate decided,
and when the hop names no readable caller (for empty, or not a
principal) — the ceiling was the near side’s verdict for a caller,
and there is none here: this agrees with caller()?.reach(), which
is nowhere then.
Sourcepub fn allows_scope(&self, scope: &str) -> bool
pub fn allows_scope(&self, scope: &str) -> bool
Hop::allows for one named scope.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Hop
impl<'de> Deserialize<'de> for Hop
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>,
impl Eq for Hop
impl StructuralPartialEq for Hop
Auto Trait Implementations§
impl Forget for Hop
impl Freeze for Hop
impl RefUnwindSafe for Hop
impl Send for Hop
impl Sync for Hop
impl Unpin for Hop
impl UnsafeUnpin for Hop
impl UnwindSafe for Hop
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<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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.