# `Lockspire.AccessToken`

Encapsulates the state of an access token throughout the validation plug pipeline.

# `t`

```elixir
@type t() :: %Lockspire.AccessToken{
  authorization_scheme: String.t() | nil,
  binding_requirements:
    %{optional(:dpop_jkt) =&gt; String.t(), optional(:mtls_x5t_s256) =&gt; String.t()}
    | nil,
  binding_type: String.t() | nil,
  binding_verified: boolean(),
  claims: map() | nil,
  client_id: String.t() | nil,
  error: term(),
  token: String.t() | nil
}
```

# `audiences`

```elixir
@spec audiences(t() | term()) :: [String.t()]
```

Returns validated, first-seen-deduplicated access-token audiences.

A single nonblank audience or a nonempty list of nonblank audiences is
accepted. Missing and malformed claims return an empty list.

# `confirmation`

```elixir
@spec confirmation(t() | term()) ::
  %{optional(:dpop_jkt) =&gt; String.t(), optional(:mtls_x5t_s256) =&gt; String.t()}
  | nil
```

Returns allowlisted confirmation values for the token's sender binding.

The returned map contains only nonblank `cnf.jkt` and `cnf["x5t#S256"]`
values. Unknown or malformed confirmation members are not exposed.

# `expires_at`

```elixir
@spec expires_at(t() | term()) :: DateTime.t() | nil
```

Returns the access-token expiration as a UTC `DateTime`.

Only integer JWT NumericDate values are accepted. Strings, floats, missing
values, and values outside `DateTime`'s supported range return `nil`.

# `scopes`

```elixir
@spec scopes(t() | term()) :: [String.t()]
```

Returns normalized, first-seen-deduplicated access-token scopes.

A scope claim is a whitespace-delimited binary. Missing or malformed claims
return an empty list.

# `subject`

```elixir
@spec subject(t() | term()) :: String.t() | nil
```

Returns the normalized subject claim for an access token.

Blank, missing, and malformed subjects return `nil`. The original value remains
available through `token.claims` for compatibility and extension use cases.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
