pub struct DyoloChain {
pub principal_pk: VerifyingKey,
pub principal_scope: IntentHash,
pub drift_tolerance_secs: u64,
pub namespace: Option<String>,
/* private fields */
}Fields§
§principal_pk: VerifyingKey§principal_scope: IntentHash§drift_tolerance_secs: u64§namespace: Option<String>Implementations§
Source§impl DyoloChain
impl DyoloChain
pub fn new(principal_pk: VerifyingKey, principal_scope: IntentHash) -> Self
Sourcepub fn with_namespace(self, namespace: impl Into<String>) -> Self
pub fn with_namespace(self, namespace: impl Into<String>) -> Self
Attach a namespace to this chain.
The effective scope root becomes a namespace-derived hash of the original
principal_scope, cryptographically binding the chain to one tenant namespace.
A cert issued for namespace “tenant-a” cannot authorize under namespace “tenant-b”.
§Multi-tenancy
Use this when building a chain on behalf of a specific tenant. The human principal must compute the namespaced scope before issuing the first cert:
ⓘ
let chain = DyoloChain::new(pk, original_scope)
.with_namespace("acme-corp");
let namespaced_scope = chain.principal_scope;
let cert = CertBuilder::new(agent_pk, namespaced_scope, now, expiry).sign(&human);
chain.push(cert);pub fn with_drift_tolerance(self, secs: u64) -> Self
pub fn push(&mut self, cert: DelegationCert) -> &mut Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn certs(&self) -> &[DelegationCert]
pub fn fingerprint(&self) -> [u8; 32]
Available on crate feature
async only.Available on crate feature
async only.Available on crate feature
async only.Trait Implementations§
Source§impl Clone for DyoloChain
impl Clone for DyoloChain
Source§impl<'de> Deserialize<'de> for DyoloChain
impl<'de> Deserialize<'de> for DyoloChain
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DyoloChain
impl RefUnwindSafe for DyoloChain
impl Send for DyoloChain
impl Sync for DyoloChain
impl Unpin for DyoloChain
impl UnsafeUnpin for DyoloChain
impl UnwindSafe for DyoloChain
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
Mutably borrows from an owned value. Read more