Skip to content

feat(server): add AddValidatorCheck for the identity provider readiness check - #149

Merged
patdowney merged 1 commit into
mainfrom
feat/validator-readiness
Nov 15, 2026
Merged

patdowney merged 1 commit into
mainfrom
feat/validator-readiness

Conversation

@patdowney

Copy link
Copy Markdown
Contributor

Summary

  • server.AddValidatorCheck(r, validators, opts...) registers oidc.ProbeValidators as a readiness check named jwt-validators. It is degraded rather than failing, cached for 30s and capped at 2s, under the 5s that Fly and lifecycle.DefaultCheckTimeout both use. An identity provider outage affects every instance alike, so failing readiness would pull the whole service out of rotation without moving traffic anywhere that could validate tokens. It adds nothing when no validator fetches keys.
  • The defaults are exported (ValidatorCheckName, DefaultValidatorCheckTimeout, DefaultValidatorCheckCacheTTL), and options replace them.
  • connect-control (AddJWTValidatorCheck) and the reference server (dioad/server-example) each carry a copy of this wrapper, which makes it a second consumer. Once this is released both copies go.
  • The module now requires dioad/lifecycle v0.2.0 directly, for WithDegraded, WithCacheTTL and WithCheckTimeout. Through net it resolved v0.1.0 before, so a consumer on v0.1.0 gets v0.2.0 when it bumps auth.

Test plan

  • go vet ./..., go test -race for http/server, oidc and claimrolemapping
  • golangci-lint run ./http/server/ (0 issues)
  • Tests cover: nothing added without key-fetching validators, a degraded dependency, one probe per issuer with the result cached, a hung issuer bounded by the timeout, and options replacing the defaults. ExampleAddValidatorCheck is runnable.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SS4MAvnUSKyK9WP4pSz5Gg

…ss check

AddValidatorCheck registers oidc.ProbeValidators as a readiness check that is
degraded rather than failing, cached for 30s and capped at 2s, under the 5s
that Fly and lifecycle.DefaultCheckTimeout both use. connect-control and the
reference server each carried a copy of this wrapper. Options replace the
defaults.

The module now requires dioad/lifecycle v0.2.0 directly, for WithDegraded,
WithCacheTTL and WithCheckTimeout.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SS4MAvnUSKyK9WP4pSz5Gg
@patdowney
patdowney merged commit e0563ff into main Nov 15, 2026
6 checks passed
@patdowney
patdowney deleted the feat/validator-readiness branch November 15, 2026 15:47
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