pub struct CapabilityRequest {
pub requester_did: String,
pub requester_pk_hex: String,
pub requested_capabilities: Vec<String>,
pub intent_name: String,
pub ttl_secs: u64,
pub nonce: String,
pub timestamp_unix: u64,
pub signature: String,
}negotiate only.Expand description
An agent’s request for a delegated capability sub-cert.
Agent A sends a CapabilityRequest to Agent B (or B’s gateway) when it
needs authorization to perform a specific action that B can delegate.
§Signature
signature is an Ed25519 signature over
Blake3(DOMAIN || requester_did || nonce || timestamp || ttl || intent || caps...),
proving that the requester controls the private key for requester_pk_hex.
Fields§
§requester_did: Stringdid:a1: identifier of the requesting agent.
requester_pk_hex: StringHex-encoded Ed25519 public key of the requesting agent.
requested_capabilities: Vec<String>Capabilities the requesting agent needs.
intent_name: StringName of the specific intent to be authorized.
ttl_secs: u64Requested delegation lifetime in seconds.
nonce: String16-byte anti-replay nonce (hex).
timestamp_unix: u64Unix timestamp when this request was created.
signature: StringEd25519 signature over the canonical request bytes (hex).
Implementations§
Source§impl CapabilityRequest
impl CapabilityRequest
Sourcepub fn build(
requester: &dyn Signer,
requested_capabilities: Vec<String>,
intent_name: impl Into<String>,
ttl_secs: u64,
timestamp_unix: u64,
) -> Self
pub fn build( requester: &dyn Signer, requested_capabilities: Vec<String>, intent_name: impl Into<String>, ttl_secs: u64, timestamp_unix: u64, ) -> Self
Build and sign a capability request.
Sourcepub fn verify_signature(&self) -> Result<VerifyingKey, A1Error>
pub fn verify_signature(&self) -> Result<VerifyingKey, A1Error>
Verify the requester’s signature and return the verifying key.
Trait Implementations§
Source§impl Clone for CapabilityRequest
impl Clone for CapabilityRequest
Source§fn clone(&self) -> CapabilityRequest
fn clone(&self) -> CapabilityRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more