pub struct ActClaims {
pub jti: String,
pub sub: String,
pub iss: String,
pub aud: Vec<String>,
pub iat: i64,
pub nbf: i64,
pub exp: i64,
pub tenant_id: String,
pub scope: Vec<Scope>,
pub cnf: Option<Confirmation>,
pub delegation: Option<Delegation>,
pub ext: BTreeMap<String, Value>,
}Expand description
The claim set carried inside an ACT envelope.
Field names are the wire keys. Unknown top-level keys are ignored on decode
so that a newer issuer can add typed claims without breaking existing
verifiers; issuer-specific claims belong in ActClaims::ext instead.
Fields§
§jti: StringToken identifier, unique per issuance. Text, not bytes - a UUID here is carried in its canonical hyphenated form.
sub: StringSubject: the OAS DID of the agent this token was issued to.
iss: StringIssuer: the broker instance that minted this token.
aud: Vec<String>Audiences this token is valid for.
Decodes from either a single string or an array of strings, since a single-audience token is the common case and writing it as a bare string is the conventional CBOR/JWT shorthand.
iat: i64Issued-at time, in seconds since the Unix epoch.
nbf: i64Not-before time, in seconds since the Unix epoch.
exp: i64Expiry time, in seconds since the Unix epoch.
tenant_id: StringTenant this token is scoped to.
scope: Vec<Scope>Granted capability scopes, as a flat array.
cnf: Option<Confirmation>Proof-of-possession binding. See Confirmation.
delegation: Option<Delegation>Onward delegation constraints. See Delegation.
ext: BTreeMap<String, Value>Issuer-defined claims, carried inside the signature and passed through unaltered.
This is where rate limits, budgets, device and network bindings, and audit trace belong. A verifier that does not understand a key here must preserve it rather than drop it, so that a downstream component which does understand it still receives an intact, signed value.
Implementations§
Source§impl ActClaims
impl ActClaims
Sourcepub fn validate_structure(&self) -> ActResult<()>
pub fn validate_structure(&self) -> ActResult<()>
Checks the claim set is structurally sound, independent of signature or clock.
Called during verification before any policy check. Kept public so an issuer can reject a malformed claim set at mint time rather than discovering it at the verifier.
§Errors
Returns ActError::EmptyClaim for a required claim that is blank, and
ActError::EmptyValidityWindow if nbf is not before exp.
Whether the granted scopes authorize requested.
Wildcards in the grant expand; wildcards in the request do not. See
Scope::covers.
Sourcepub fn has_audience(&self, audience: &str) -> bool
pub fn has_audience(&self, audience: &str) -> bool
Whether this token lists audience among its audiences.