Skip to main content

AccessTokenResponse

Struct AccessTokenResponse 

Source
pub struct AccessTokenResponse {
    pub token: String,
    pub subject: String,
    pub expires_at: Option<Timestamp>,
    pub session_id: String,
    pub amr: Vec<String>,
    pub credential_id: String,
    pub grant_envelope: Vec<u8>,
    pub owner_authorization: Option<OwnerAuthorizationBundle>,
    pub device_id: String,
}

Fields§

§token: String

The Biscuit (base64url-encoded). Goes in the heddle_session cookie for browser flows and in the CLI credentials store for device-bound flows. Empty when weft does not mint; clients mint from the other fields, including device_id.

§subject: String§expires_at: Option<Timestamp>

Unix-seconds expiry. The Biscuit also carries this internally, but exposing it explicitly lets clients know when to renew without parsing the token.

§session_id: String

The Biscuit’s session() fact (also its revocation id). Stable public id surfaced in the Active Sessions UI; argument to RevokeSession.

§amr: Vec<String>§credential_id: String

issued_credentials.id for tokens minted from a long-lived credential row (device, service-account, agent). Empty for browser sessions.

§grant_envelope: Vec<u8>

Server-signed GrantEnvelope v2 paired with a client-minted Biscuit. It is not owner authority; ordinary spool operations are authorized by the resulting transport Biscuit. The field contains the following byte-exact wire value:

canonical_payload_v2 || signature[64]

signature is raw Ed25519 and covers every byte of canonical_payload_v2. All integers are big-endian; strings are UTF-8:

bytes “heddle-grant-envelope-v2\0” (signed domain prefix) u8 format_version (MUST equal 0x02; this byte is signed) bytes “biscuit_authority_public_key\0” 32 bytes biscuit_authority_public_key bytes “device_proof_public_key\0” 32 bytes device_proof_public_key u16 + N subject (N <= 256) u16 rights_count (<= 64) repeated in encoded order: u16 + N kind (N <= 1024) u16 + N path (N <= 1024) u16 + N action (N <= 1024) i64 issued_at (Unix seconds) i64 expires_at (Unix seconds)

The exact domain, discriminator, and both role labels are inside the server-signed payload. A parser MUST require the domain, 0x02, both labels in this order, two distinct fixed-length keys, and complete input with no trailing bytes. An issuer MUST reject equal role keys. After cutover a parser MUST reject the one-key v1 envelope; field presence MUST NOT select a version or provide a compatibility fallback.

The Biscuit minted under biscuit_authority_public_key remains the exact byte prefix of every attenuation. Each ordinary post-authority delegating block appends one verified pop_delegation transition rooted at device_proof_public_key; an implementation must never rebuild or replace the original client-minted prefix when attenuating. Tier-1 request signing is leaf-only: after any accepted pop_delegation, only the effective leaf proof key may sign; signatures by ancestor proof keys or by the Biscuit authority key MUST be rejected.

§owner_authorization: Option<OwnerAuthorizationBundle>

Owner-authored purge-only bundle returned without re-signing or reinterpretation. It grants no redact, visibility, or metadata authority.

§device_id: String

Persisted device_roots.id after RegisterPublicKey. Clients set MintParams.device_id from this field without reading Postgres. This is a mint input, not capability: it identifies the device root used when the client mints after weft leaves token empty.

Trait Implementations§

Source§

impl Clone for AccessTokenResponse

Source§

fn clone(&self) -> AccessTokenResponse

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AccessTokenResponse

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AccessTokenResponse

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Message for AccessTokenResponse

Source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
Source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
Source§

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
Source§

fn encode_length_delimited( &self, buf: &mut impl BufMut, ) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
Source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
Source§

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes an instance of the message from a buffer. Read more
Source§

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes a length-delimited instance of the message from the buffer.
Source§

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
Source§

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
Source§

impl PartialEq for AccessTokenResponse

Source§

fn eq(&self, other: &AccessTokenResponse) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AccessTokenResponse

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.