Skip to main content

Module identity

Module identity 

Source

Structs§

AcceptedRecord
An accepted envelope with the service’s acceptance time (Section 8.3).
AgentId
AgentSigner
ClientNonceManager
DiscoveryDocument
Discovery document skeleton served at /.well-known/{protocol-name} (Section 8.4). Protocols add members, kept in extra.
Envelope
ErrorBody
ErrorResponse
Error response body shared by every Agent Protocols service (Section 8.1).
Event
ListResponse
List response shape (Section 8.2). next_cursor is present exactly when more items follow.
LiveWriteOptions
MemoryNonceStore
NonceRecord
RequestAuthContext
RequestBinding
RequestJwtClaims
RequestJwtHeader

Enums§

SubmissionResult
Outcome of verify_submission: an exact resubmission of an accepted envelope, or a new live write with the nonce now recorded.

Constants§

AGENT_ID_PREFIX
CONTROLLER_CHALLENGE_PREFIX
Prefix of an Agent Delegation controller registration challenge (Section 4.3).
DEFAULT_LIVE_WRITE_WINDOW_MS
DEFAULT_NONCE_TTL_MS
Nonce cache validity (Agent Identity Section 6.2): at least twice the live-write window, because an envelope signed up to one window ahead of the receiver’s clock stays inside the window for two windows after acceptance.
DEFAULT_REQUEST_JWT_TTL_SECS
IDENTITY_EVENT_FIELDS
The six Agent Identity event fields; protocols add their own on top.
MAX_NONCE_HEADER
MAX_NONCE_JUMP
Largest jump a single Max-Seen-Nonce header may cause beyond max(next_nonce, now) (Agent Identity Section 6.2). The nonce sequence is shared by every service an agent uses, so one hostile service must not be able to exhaust it.
MAX_SAFE_NONCE
SHARED_ERROR_CODES
Error codes shared by every Agent Protocols service (Section 8.1).

Traits§

NonceStore

Functions§

canonical_event_bytes
event_hash
event_hash_bytes
is_controller_challenge
The prefix followed by 43 opaque base64url characters, 88 in all.
parse_envelope_json
parse_strict_json for a signed envelope, checking its outer shape.
parse_strict_json
Parses signed JSON strictly (Agent Identity Section 4.1): rejects duplicate member names, unpaired surrogates, and integers outside the safe range. serde_json::Value silently keeps the last of two duplicate names, so parse raw request bodies with this before hashing.
service_origin
Derives the request JWT aud from a request URL: the service origin — scheme, host, and non-default port, with no path (Agent Identity Section 7).
sign_event
sign_event_hash
Signs a precomputed 32-byte event hash. Signing a digest supplied by another component without seeing the event it commits to (blind signing) is NOT RECOMMENDED: actor and all event content are inside the digest, so a blind signer can be tricked into signing arbitrary events attributed to its key. Prefer sign_event, which canonicalizes and hashes the event.
unix_ms
unix_secs
validate_event_fields
Enforces the closed event object (Section 5.1): the event may carry only the six Agent Identity fields plus extra_fields the protocol defines.
validate_nonce
validate_origin
Checks that value is a serialized HTTPS origin (Agent Identity Section 4.4): WHATWG URL parsing and origin serialization must reproduce it exactly.
verify_controller_challenge
Verifies a controller registration proof (Agent Delegation Section 4.3): signature over the challenge’s exact UTF-8 bytes under the strict rules of Section 3.1. Matching the challenge to what the provider issued, and its expiry, remain the provider’s checks.
verify_ed25519_strict
Ed25519 verification under the deterministic rules of Agent Identity Section 3.1: canonical, non-small-order A and R, reduced S, and the cofactorless equation (verify_strict).
verify_ed25519_strict_bytes
verify_ed25519_strict over a raw 32-byte public key, which may fail to decode as a point at all.
verify_envelope
verify_event_hash
verify_event_hash_signature
verify_live_envelope
verify_request_jwt
verify_signature
verify_submission
Agent Identity Section 6.1 for one submission: verifies the envelope, answers an exact resubmission of an accepted envelope before the time window and nonce checks (Section 6.3), and otherwise enforces both.
verify_timestamp