Documentation
¶
Overview ¶
Package identity maps the credential of a request to the claims of a grant.
Index ¶
Constants ¶
const ScopeAdmin grant.Scope = "admin"
ScopeAdmin is the scope of a rule or a token that lets its principal create a repository. It names no repository, and an Authenticator answers it only for a call that names none, with the claims of scope operator.
Variables ¶
This section is empty.
Functions ¶
func Claims ¶
Claims is the claims of a human identity that holds scope on repo. ScopeAdmin becomes operator.
func ScopeFor ¶
ScopeFor returns the highest scope that the rules give subject on repo, or "" for none. repo is empty for a call that names no repository. A subject that holds an @ is an email and matches without case. Any other subject matches exactly.
func ValidScope ¶
ValidScope reports whether a human identity may hold scope on repos: read or write on at least one repository, or admin on none. A human identity never holds merge, operator, import or node.
Types ¶
type Authenticator ¶
Authenticator reads the credential of r and returns the claims that it gives. repo is the repository text that the route names, empty for a route with none. A credential that is missing, forged, expired or not allowed for repo answers grant.ErrGrant and nothing else. The claims never hold a scope above what the credential gives.
func Chain ¶
func Chain(auths ...Authenticator) Authenticator
Chain returns an Authenticator that answers with the first claims that one of auths gives, and grant.ErrGrant when none gives any.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package identitytest holds the conformance suite of identity.Authenticator and a signer of Access JWTs.
|
Package identitytest holds the conformance suite of identity.Authenticator and a signer of Access JWTs. |
|
Package oidc authenticates a request by a signed OIDC JWT from any issuer, and maps a claim of the JWT to a scope on a repository with rules.
|
Package oidc authenticates a request by a signed OIDC JWT from any issuer, and maps a claim of the JWT to a scope on a repository with rules. |
|
Package token authenticates a request by a signed grant.
|
Package token authenticates a request by a signed grant. |
|
Package usertoken authenticates a request by a per-user token that an administrator issued.
|
Package usertoken authenticates a request by a per-user token that an administrator issued. |