sentinel.v1.Principal is the shared identity shape produced by authentication policies. It decouples the authentication mechanism from downstream authorization decisions.
Fields
The authenticated identity string. For KeyAuth, this is the external ID (if present) or the key ID.
The authentication method that produced this principal. Values:
PRINCIPAL_TYPE_API_KEY, PRINCIPAL_TYPE_BASIC, PRINCIPAL_TYPE_JWT.Key-value metadata from the auth policy. Contents vary by policy type.
What a principal looks like
- KeyAuth principal
- JWT principal
- BasicAuth principal
KeyAuth claims
When produced by a KeyAuth policy, the principal includes these claims:| Claim | Description |
|---|---|
key_id | Unkey key identifier |
key_space_id | Keyspace the key belongs to |
api_id | API identifier |
workspace_id | Workspace identifier |
name | Key name (if set) |
identity_id | Identity ID (if set) |
external_id | External ID (if set) |
meta | Key metadata JSON (if set) |
expires | Expiration time in RFC 3339 format (if set) |
Header propagation
Sentinel serializes the principal to JSON and sets it on theX-Unkey-Principal header before forwarding the request to the instance. The instance can read this header to make authorization decisions without re-verifying the API key.
The proxy handler strips any incoming X-Unkey-Principal header before policy evaluation to prevent clients from spoofing an authenticated identity.
