pub struct Custody {
pub mode: CustodyMode,
pub signer: String,
pub on_behalf_of: String,
pub reason: Option<String>,
}Expand description
Who signed, when that is not the actor itself.
This is a separate axis from attestation_class, and keeping them
separate is the point. attestation_class grades how evidence was
captured (self / runtime / countersigned). Custody grades who held the
key. They vary independently: a service-mediated room can have excellent
runtime-captured evidence and still be custodially signed, and an agent
signing for itself can have nothing but its own word.
Collapsing them is the same error EffectConfidence and EffectFinality
exist to avoid – one label carrying two unrelated questions, where a
reader cannot tell which one a value is answering.
The distinction is not cosmetic. Under self-custody, forging a participant’s action requires that participant’s key. Under delegated custody, a compromised service can mint any history it likes for every actor it signs for. Same receipt shape, different threat model, so the receipt says which.
Fields§
§mode: CustodyModeCustody mode. Only delegated is ever serialized – self-custody is
represented by the whole section being absent, so existing receipts
stay byte-identical and “no custody block” cannot be misread as
“custody unknown”.
signer: StringThe identity whose key actually produced the signature, e.g.
svc://gateway-rooms. This is who a verifier is really trusting.
on_behalf_of: StringThe actor the signature is claimed to be for, e.g. agent://fizz.
A verifier can confirm signer signed; it cannot confirm this actor
agreed, and must not present it as though it could.
reason: Option<String>Optional human-readable reason the actor did not sign for itself (e.g. “browser-mediated room; participants hold no local key”).
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Custody
impl<'de> Deserialize<'de> for Custody
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 Custody
impl StructuralPartialEq for Custody
Auto Trait Implementations§
impl Freeze for Custody
impl RefUnwindSafe for Custody
impl Send for Custody
impl Sync for Custody
impl Unpin for Custody
impl UnsafeUnpin for Custody
impl UnwindSafe for Custody
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
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.