Versions in this module Expand all Collapse all v0 v0.3.61 Jan 17, 2024 Changes in this version + var ErrContextError = errors.New("value missing from context") + var ErrKeyFormat = errors.New("key format error") + var ErrTokenVerification = errors.New("failed to verify token") + func Issue(i *jose.JWTIssuer, r *http.Request, subject string, uclaims *UnikornClaims, ...) (string, error) + func NewContextWithClaims(ctx context.Context, claims *Claims) context.Context + type APIScope string + const ScopeProject + type Authenticator struct + func New(options *Options, issuer *jose.JWTIssuer, keystone *keystone.Authenticator) *Authenticator + func (a *Authenticator) Authorization(w http.ResponseWriter, r *http.Request) + func (a *Authenticator) OIDCCallback(w http.ResponseWriter, r *http.Request) + func (a *Authenticator) Token(w http.ResponseWriter, r *http.Request) (*generated.Token, error) + type Claims struct + Scope *ScopeList + UnikornClaims *UnikornClaims + func ClaimsFromContext(ctx context.Context) (*Claims, error) + func Verify(i *jose.JWTIssuer, r *http.Request, tokenString string) (*Claims, error) + type Code struct + ClientCodeChallenge string + ClientID string + ClientNonce string + ClientRedirectURI string + ClientScope Scope + Email string + Expiry time.Time + KeystoneToken string + KeystoneUserID string + type Error string + const ErrorAccessDenied + const ErrorInvalidRequest + const ErrorInvalidScope + const ErrorServerError + const ErrorUnauthorizedClient + const ErrorUnsupportedResponseType + type IDToken struct + ATHash string + Audience []string + Email string + Expiry int64 + IssuedAt int64 + Issuer string + Nonce string + Picture string + Subject string + type Options struct + func (o *Options) AddFlags(f *pflag.FlagSet) + type Scope []string + func NewScope(s string) Scope + func (s Scope) Has(scope string) bool + type ScopeList struct + Scopes []APIScope + func (l *ScopeList) Includes(scope APIScope) bool + func (l *ScopeList) MarshalJSON() ([]byte, error) + func (l *ScopeList) UnmarshalJSON(value []byte) error + type State struct + ClientCodeChallenge string + ClientID string + ClientNonce string + ClientRedirectURI string + ClientScope Scope + ClientState string + CodeVerfier string + Nonce string + type UnikornClaims struct + Project string + Token string + User string