Skip to content

feat: wire inbound auth into serve (WP10) - #117

Merged
pavelanni merged 3 commits into
mainfrom
feature/inbound-auth
Nov 7, 2026
Merged

pavelanni merged 3 commits into
mainfrom
feature/inbound-auth

Conversation

@pavelanni

Copy link
Copy Markdown
Collaborator

Summary

  • Adds the inbound_auth block to agent-config.yaml with validation: enabling it without issuer, audience, or jwks_url fails startup with the key name.
  • Wraps the whole serve mux with inboundauth.Middleware; only /.well-known/agent-card.json and /health are exempt. The entire /v1 tree is protected, including GET /v1/models.
  • Resolves service.host: loopback when inbound auth is enabled and no host is set, 0.0.0.0 otherwise; an explicit host always wins. The health server uses the same resolved host.
  • Isolates sessions by sub|azp|x-session-id (raw ID truncated to 64 chars first) and logs verified sub/azp/scope/aud per A2A request. The raw token is never logged.
  • Logs inbound auth disabled when the block is absent.
  • Documents the config, loopback default, JWKS network-policy requirement, and session isolation in deploy/README.md.

Test plan

  • make lint — 0 issues
  • go test -race ./internal/cmd/ ./internal/bridge/ — pass
  • Route matrix: no token → 401 missing_token on /a2a, /, /v1/chat/completions, /v1/models; agent card and /health exempt; valid token → 200
  • Identity log contains sub=alice and not the token
  • Disabled mode answers without a token and logs inbound auth disabled
  • Two callers sharing x-session-id get separate histories

🤖 Generated with Claude Code

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
…ions

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Move the identity log to a mux-level handler so /v1 requests are covered, and close resources when middleware construction fails.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
@pavelanni
pavelanni marked this pull request as ready for review November 7, 2026 00:27
@pavelanni
pavelanni merged commit cf940f5 into main Nov 7, 2026
5 checks passed
@pavelanni
pavelanni deleted the feature/inbound-auth branch November 7, 2026 00:27
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.

1 participant