# `Parrhesia.API.RequestContext`

Shared request context used across API and policy surfaces.

This struct carries caller identity and transport metadata through authorization and storage
boundaries.

The most important field for external callers is `authenticated_pubkeys`. For example:

- `Parrhesia.API.Events` uses it for read and write policy checks
- `Parrhesia.API.Stream` uses it for subscription authorization
- `Parrhesia.API.ACL` uses it when evaluating protected sync traffic

# `t`

```elixir
@type t() :: %Parrhesia.API.RequestContext{
  actor: term(),
  authenticated_pubkeys: MapSet.t(String.t()),
  caller: atom(),
  metadata: map(),
  peer_id: String.t() | nil,
  remote_ip: String.t() | nil,
  subscription_id: String.t() | nil,
  transport_identity: map() | nil
}
```

# `put_metadata`

```elixir
@spec put_metadata(t(), map()) :: t()
```

Merges arbitrary metadata into the context.

Existing keys are overwritten by the incoming map.

---

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