Repository navigation
feat(server): add AddValidatorCheck for the identity provider readiness check - #149
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
server.AddValidatorCheck(r, validators, opts...)registersoidc.ProbeValidatorsas a readiness check namedjwt-validators. It is degraded rather than failing, cached for 30s and capped at 2s, under the 5s that Fly andlifecycle.DefaultCheckTimeoutboth 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.ValidatorCheckName,DefaultValidatorCheckTimeout,DefaultValidatorCheckCacheTTL), and options replace them.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.dioad/lifecyclev0.2.0 directly, forWithDegraded,WithCacheTTLandWithCheckTimeout. Throughnetit 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 -raceforhttp/server,oidcandclaimrolemappinggolangci-lint run ./http/server/(0 issues)ExampleAddValidatorCheckis runnable.🤖 Generated with Claude Code
https://claude.ai/code/session_01SS4MAvnUSKyK9WP4pSz5Gg