pub struct CredentialDefinition {
pub name: String,
pub ttl: String,
pub grants: Vec<String>,
pub loc: Loc,
pub leading_trivia: Vec<Trivia>,
pub trailing_trivia: Vec<Trivia>,
}Expand description
v2.46.0 — credential <Name> { ttl: grants: }: a named
ephemeral-credential contract. mint <Name> as <binding> (v2.46.0) mints
a TTL-bounded bearer carrying exactly grants — and the runtime law
(authority_only_attenuates) admits the mint only when
grants ⊆ capabilities(minter). An unknown field in a credential { }
block is a HARD PARSE ERROR (the v2.38.0 posture — this is security
surface; a typo’d field must not silently produce a permissive
contract).
Fields§
§name: String§ttl: StringThe bearer’s lifetime — a duration literal ("15m", "900s"),
REQUIRED. Validated by axon-T894: parseable, > 0, and ≤ the closed
24h ceiling (an “ephemeral” credential that lives for days is a
service account wearing a costume — v2.46.0 covers that shape).
grants: Vec<String>The capability slugs the minted bearer carries — REQUIRED,
non-empty (axon-T893), each a dotted slug per
is_valid_capability_slug (the requires: grammar). Attenuation
(⊆ minter) is the runtime/mint-time half of the law.
loc: Loc§leading_trivia: Vec<Trivia>v1.5.2 — leading comment trivia.
trailing_trivia: Vec<Trivia>v1.5.2 — trailing comment trivia.