Repository navigation
Document adopting authn in the package doc - #517
Merged
Merged
Conversation
Base automatically changed from
tsm-04-issuer-form
to
tsm-03-trustset-guards
November 20, 2026 09:20
Base automatically changed from
tsm-02-trustset
to
tsm-01-provider-only-config
November 20, 2026 09:22
Base automatically changed from
tsm-01-provider-only-config
to
tsm-00-jwks-close-race
November 20, 2026 09:22
Base automatically changed from
tsm-00-jwks-close-race
to
ts-04-wp3-scopes-algs
November 20, 2026 09:22
jhrozek
force-pushed
the
ts-03-wp2-checks
branch
from
November 21, 2026 16:22
4ba56cd to
c71f8f6
Compare
2 tasks done
jhrozek
force-pushed
the
ts-03-wp2-checks
branch
from
November 21, 2026 16:30
c71f8f6 to
e76c645
Compare
rdimitrov
previously approved these changes
Nov 21, 2026
rdimitrov
left a comment
Member
There was a problem hiding this comment.
Thanks, the doc now points at (*Error).HTTPStatus and spells out the bare WWW-Authenticate: Bearer challenge for MissingCredentials(). LGTM.
A service that verifies tokens with its own code needs to know where this package decides differently, and what it leaves to the caller. The package doc now lists the defaults that differ from a hand-written verifier, the checks the caller must still make (scopes, its own identity claim, qualifying claims by Principal.Trust, the JSON types in Claims, mapping errors to responses), and how a TrustSet routes, changes and goes stale. It shows the intended pattern for two sources of issuers: a set of human identity providers built once at startup, and a set fed from a directory service that is rebuilt on a timer with WithProviderOnly and WithReservedIssuers, with a fallback from one to the other on ReasonUnknownIssuer. For Microsoft Entra and Okta it says what this API can express: one trust per tenant, the Entra JWKS URLs, audience forms, scp versus roles, typ, the guard against ID tokens (an API audience that is no client's ID, plus a required scope), identifying users by tid and oid, and using an Okta custom authorization server. Documentation only. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The package doc told callers to map errors with Code.HTTPStatus, which answers missing credentials and unsupported schemes with 400, the case its own doc warns about. Point at (*Error).HTTPStatus and say to answer MissingCredentials with a bare "WWW-Authenticate: Bearer" challenge (RFC 6750 §3.1). Callers copy what the package doc says. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Author
|
@rdimitrov Merging #508 changed this PR's base, and the ruleset dismissed your approval. I rebased onto main (07c8b39). The PR now shows only |
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
authnpackage doc now lists:Principal.Trust, the JSON types inClaims, and mapping errors to responses;TrustSetroutes tokens, changes and goes stale.WithProviderOnlyandWithReservedIssuers, with a fallback from one set to the other onReasonUnknownIssuer.common/organizations/consumersissuers are not refused, but no token carries them);scpversusroles, andtyp;tidandoid;Stack: #506 → #507 → #508 → #509 → #510 → #511 → #514 → #515 → #516 (template issuers) → this PR
Test plan
go vet ./authn/(doc comment only, no code change)🤖 Generated with Claude Code