Skip to content

feat!: add authorization for the signaling API - #25

Merged
paullatzelsperger merged 1 commit into
mainfrom
feat/authorization
Nov 10, 2026
Merged

paullatzelsperger merged 1 commit into
mainfrom
feat/authorization

Conversation

@paullatzelsperger

Copy link
Copy Markdown
Contributor

Phase 7 of the signaling v1.0 migration: authorization in both directions. Authorization is mandatory; WithAuthorizationDisabled() is the explicit opt-out.

  • Authorization extension point (Type, AuthorizationHeader, ExtractCallerID), registered with WithAuthorization; mirrors the Java SDK.
  • Inbound: every route requires a valid Authorization header (401), the caller id is recorded on new flows, and a caller acting on another control plane's flow or registration gets 403 with a logged warning.
  • Outbound: callbacks and data plane registration carry the header for the target control plane's authorization entry; unregistered types are rejected up front.
  • pkg/authorization/oauth2: oauth2_client_credentials via golang.org/x/oauth2 (cached tokens) and JWT/JWKS verification via golang-jwt/jwt/v5 and MicahParks/keyfunc/v3, pinned to versions that keep go 1.24.
  • Control plane endpoints must be https unless loopback or WithInsecureEndpoints().
  • All samples run with a demo authorization; README gets an "Authorization" section.

Breaking: ControlPlaneClient, ControlPlaneResolver and WithControlPlane now take a ControlPlane; WithControlPlaneIdentifier is replaced by WithAuthenticator.

🤖 Generated with Claude Code

Authorization is mandatory; WithAuthorizationDisabled turns it off.

- Authorization extension point (WithAuthorization): outbound
  Authorization headers from the target control plane's entry, inbound
  caller identification via ExtractControlPlaneID
- oauth2_client_credentials profile in pkg/authorization/oauth2
  (client credentials grant with token caching, JWT verification
  against a JWKS endpoint)
- NewHandler authenticates every route (401) before reading the body;
  WithAuthenticator replaces the scheme
- 403, with a logged warning, when a control plane accesses another
  control plane's data flow or registration
- registrations reject authorization types without a registered
  Authorization; control plane endpoints require https except loopback
  (WithInsecureEndpoints)

BREAKING CHANGE: ControlPlaneClient, ControlPlaneResolver,
WithControlPlane, RegisterDataPlane and DeregisterDataPlane take a
ControlPlane instead of a URL; WithControlPlaneIdentifier is replaced
by WithAuthenticator; NewHandler answers 401 unless an Authorization is
registered or authorization is disabled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@paullatzelsperger
paullatzelsperger merged commit 28bd6dd into main Nov 10, 2026
6 checks passed
@paullatzelsperger
paullatzelsperger deleted the feat/authorization branch November 10, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants