Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithAuthPrincipal ¶
func WithAuthPrincipal(ctx context.Context, principal *AuthClaims) context.Context
WithAuthPrincipal adds the provided principal into the provided context
Types ¶
type AuthClaims ¶
AuthClaims contains claims that are included in OIDC standard claims. https://openid.net/specs/openid-connect-core-1_0.html#IDToken
func AuthPrincipalFromContext ¶
func AuthPrincipalFromContext(ctx context.Context) (*AuthClaims, bool)
AuthPrincipalFromContext gets the principal from the context
type Authenticator ¶
type Authenticator interface {
// Authenticate returns a nil error and the AuthClaims info (if available) if the subject is authenticated or a
// non-nil error with an appropriate error cause otherwise.
Authenticate(requestContext context.Context, requestParameters any) (*AuthClaims, error)
// Close Cleans up the authenticator.
Close()
}
type NoopAuthenticator ¶
type NoopAuthenticator struct{}
func (NoopAuthenticator) Authenticate ¶
func (n NoopAuthenticator) Authenticate(requestContext context.Context, requestParameters any) (*AuthClaims, error)
func (NoopAuthenticator) Close ¶
func (n NoopAuthenticator) Close()
type OidcAuthenticator ¶
type OidcAuthenticator interface {
GetConfiguration() (*OidcConfig, error)
GetKeys() (*keyfunc.JWKS, error)
}
type OidcConfig ¶
OidcConfig contains authorization server metadata. See https://datatracker.ietf.org/doc/html/rfc8414#section-2
Click to show internal directories.
Click to hide internal directories.