Skip to content

feat: shared API helpers (ProbeValidators, ExtractorConfig.Check, APIMiddlewares) - #148

Merged
patdowney merged 3 commits into
mainfrom
feat/shared-api-helpers
Nov 15, 2026
Merged

patdowney merged 3 commits into
mainfrom
feat/shared-api-helpers

Conversation

@patdowney

Copy link
Copy Markdown
Contributor

Summary

  • oidc.ProbeValidators and KeyFetchingIssuers: check that every identity provider behind the validators answers discovery and serves a key, for a readiness check.
  • claimrolemapping.ExtractorConfig.Check and LogUnauthenticated: report a missing or conflicting authentication setup, allow-unauthenticated without accept-unauthenticated-risk, the inert acknowledgement, and debug mappings without enable-debug. AcceptUnauthenticatedRisk moves into ExtractorConfig; a service embedding it squashed keeps its YAML key and field access.
  • server.APIMiddlewares: bearer token validation then principal extraction. Rate limiting and header checks stay with the caller.

Part of connect-control's shared-helpers plan (step 4, doc/proposals/shared-server-helpers.md). It uses dioad/config's configcheck.Collector, which is already released.

Test plan

  • go vet ./..., go test -race for oidc, claimrolemapping, http/...

🤖 Generated with Claude Code

https://claude.ai/code/session_01SS4MAvnUSKyK9WP4pSz5Gg

patdowney and others added 3 commits November 15, 2026 12:32
…d validators

ProbeValidators fetches each distinct issuer's discovery document and JWKS
and requires at least one key, returning every failure joined. It is for a
readiness check, and passes when no validator fetches keys.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SS4MAvnUSKyK9WP4pSz5Gg
…uthenticates

Check reports a missing or conflicting authentication setup, an
allow-unauthenticated without accept-unauthenticated-risk, the inert
acknowledgement, and debug claim-role mappings without enable-debug.
AcceptUnauthenticatedRisk moves into ExtractorConfig beside
AllowUnauthenticated, and LogUnauthenticated words the startup risk once.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SS4MAvnUSKyK9WP4pSz5Gg
APIMiddlewares returns bearer token validation followed by principal
extraction, leaving out validation when there are no validators. Callers add
anything that must run before authentication or needs the principal around it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SS4MAvnUSKyK9WP4pSz5Gg
@patdowney
patdowney merged commit 770d69b into main Nov 15, 2026
6 checks passed
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