Documentation
¶
Overview ¶
Package oidc verifies CI OIDC ID tokens and reads a run's identity from them.
Only RS256 is accepted, the one algorithm both issuers' discovery documents list. docs/serve.md cites the source and retrieval date of every claim name, issuer URL and key set path below.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrMalformed = errors.New("oidc: malformed token") ErrAlgorithm = errors.New("oidc: algorithm not accepted") ErrIssuer = errors.New("oidc: unknown issuer") ErrSignature = errors.New("oidc: bad signature") ErrAudience = errors.New("oidc: wrong audience") ErrExpired = errors.New("oidc: token expired") ErrNotYetValid = errors.New("oidc: token not yet valid") ErrClaims = errors.New("oidc: run identity claims missing or invalid") )
The refusals. A caller reports one answer to the sender and logs which.
Functions ¶
This section is empty.
Types ¶
type Identity ¶
type Identity struct {
Host string
Owner string
Repository string
RunID string
RunAttempt string
CommitSHA string
CommitIsHead bool
Actor string
Event string
PullRequest string
// Environment is the GitHub deployment environment the job referenced,
// empty when it referenced none. Its protection rules are the
// repository's, so only a job they admitted carries it.
Environment string
}
Identity is a run as the token states it. Repository is lower case, host and path, the form of the costroid/repo tag. PullRequest is empty unless the token itself names one.
CommitSHA is the commit the token verifies. It is the head of the ref only when CommitIsHead says so: on GitHub's pull_request event it is a merge commit, and on a GitLab merged results pipeline a temporary one.
type Issuer ¶
type Issuer struct {
Kind Kind
URL string
JWKSURL string
// Host is the SCM host its repositories live on.
Host string
}
Issuer is one trusted token issuer.
func (Issuer) KeySetHost ¶
KeySetHost is the host the issuer's signing keys are read from, the one an egress allowlist must hold. GitHub's is not Host.
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
Verifier checks tokens against a set of issuers and one audience.