Documentation
¶
Overview ¶
Package tokenexchange verifies token-exchange JWTs against the issuer's published keys.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsKeysUnavailable ¶
IsKeysUnavailable reports whether Verify failed because the signing keys have not been fetched yet, so the token itself may be valid.
Types ¶
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
Verifier checks token-exchange JWTs against one issuer's published keys.
func NewVerifier ¶
func NewVerifier(ctx context.Context, log *slog.Logger, meter metric.Meter, rt http.RoundTripper, gitLabAddress, issuerURL string, audiences []string) (*Verifier, error)
NewVerifier verifies JWTs whose iss claim is issuerURL, signed with a key from the set the GitLab at gitLabAddress serves. It fetches that set in the background and keeps refetching it until ctx is done; until the first fetch succeeds Ready is false and every token is rejected with IsKeysUnavailable. The fetch goes over rt, so rt decides which certificate authorities are trusted.