Expand description
OAuth 2.1 Authorization Server for hyprstream.
Provides OAuth 2.1 (draft-ietf-oauth-v2-1-13) authorization serving both MCP (:6790) and OAI (:6789) as protected resources.
§Standards
- OAuth 2.1 (draft-ietf-oauth-v2-1-13)
- RFC 8414 (Authorization Server Metadata)
- RFC 7591 (Dynamic Client Registration)
- RFC 8707 (Resource Indicators)
- RFC 8628 (Device Authorization Grant)
- RFC 9728 (Protected Resource Metadata)
- Client ID Metadata Documents (draft-ietf-oauth-client-id-metadata-document-00)
§Architecture
OAuth Server (:6791)
/.well-known/oauth-authorization-server → metadata
/oauth/register → dynamic registration
/oauth/authorize → consent + auth code
/oauth/token → PKCE + PolicyClient delegation
/oauth/jwks → JSON Web Key Set (RFC 7517)
/oauth/device → device authorization (RFC 8628)
/oauth/device/verify → user verification pageModules§
- auth
- Bearer token authentication middleware for the OAuth service.
- authorize
- OAuth 2.1 Authorization Endpoint.
- browser_
session - Browser-facing ATProto session exchange and viewer context.
- challenge
- Shared Ed25519 challenge-response verification for OAuth endpoints.
- cimd_
cache - Client ID Metadata Document cache.
- client_
auth - OAuth 2.1 client authentication at the token endpoint.
- deployment_
well_ known - Deployment static well-known endpoints (#1137 / #1136 serving half).
- device
- RFC 8628 Device Authorization Grant.
- device_
enrollment - Anonymous device identity enrollment — POST /api/device/challenge and /api/device/enroll.
- did_
document - did:web document endpoints (Phase 0c).
- dpop
- RFC 9449 DPoP (Demonstrating Proof-of-Possession) proof verification.
- federation_
entity - OpenID Federation 1.0 entity configuration endpoint.
- identity_
registration - Identity registration, federation-intake, and public resolution HTTP face.
- introspection
- RFC 7662 Token Introspection endpoint.
- jwks
- GET /oauth/jwks — JSON Web Key Set (RFC 7517).
- jwt_
bearer - RFC 7523 JWT Bearer assertion grant handler.
- login_
page - Provider selection login page for the OAuth authorize flow.
- metadata
- OAuth 2.1 / OpenID Connect discovery metadata.
- mount_
ticket - 9P mount-ticket minting for K3a.
- oauth2_
userinfo - Generic OAuth 2.0 userinfo endpoint fetch and claim normalization.
- oidc_
callback - External OAuth/OIDC provider callback handler.
- oidc_
discovery - OIDC provider discovery and metadata caching.
- par
- Pushed Authorization Requests (RFC 9126).
- registration
- OAuth 2.1 Client Registration (RFC 7591) and Client ID Metadata Documents.
- replay_
key - Fixed-size keys for OAuth replay barriers.
- replay_
metrics - OpenTelemetry signals for fail-closed OAuth replay barriers.
- revocation
- OAuth 2.0 Token Revocation (RFC 7009).
- rpc_
handler - OAuth RPC handler for user CRUD operations.
- scim
- SCIM 2.0 HTTP handlers for user provisioning.
- scim_
types - SCIM 2.0 types for JSON serialization.
- session
- Server-side session management for the OAuth browser login flow.
- spiffe
- SPIFFE/JWT-SVID compatibility surface for the Kubernetes security spine.
- state
- OAuth 2.1 server state management.
- token
- OAuth 2.1 Token Endpoint.
- token_
exchange - RFC 8693 OAuth Token Exchange grant handler.
- token_
store - Persistent refresh token store abstraction.
- user_
mapping - User identity mapping from external OIDC providers to local hyprstream subjects.
- user_
service - Shared user CRUD logic for SCIM HTTP and ZMQ RPC transports.
- userinfo
- OpenID Connect UserInfo endpoint (OIDC Core Section 5.3).
- wit_
bootstrap - Browser WIT bootstrap endpoint — DISABLED for v16 (frozen A).
- xrpc
com.atproto.*XRPC server surface — MVP public-read slice (#1112).
Structs§
- OAuth
Service - Protected
Resource Metadata - RFC 9728 Protected Resource Metadata.
Constants§
- SERVICE_
NAME - Service name for registry and logging
Functions§
- create_
app - Create the OAuth Axum router.
- protected_
resource_ metadata - Create a Protected Resource Metadata response (RFC 9728).