Documentation
¶
Overview ¶
Package auth authenticates incoming HTTP requests.
Index ¶
Constants ¶
View Source
const HeaderUserSub = "X-User-Sub"
HeaderUserSub carries the caller's subject; with OIDC enabled it must match the validated JWT sub claim.
Variables ¶
View Source
var ErrUnauthenticated = errors.New("unauthenticated")
ErrUnauthenticated is returned for any authentication failure.
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authenticator interface {
// Authenticate returns the verified subject or ErrUnauthenticated.
Authenticate(r *http.Request) (string, error)
}
Authenticator extracts and verifies the caller identity of a request.
type OIDC ¶
type OIDC struct {
// contains filtered or unexported fields
}
OIDC validates RFC 6750 bearer tokens against an OIDC provider (Keycloak or any other compliant issuer) and enforces JWT.sub == X-User-Sub.
Click to show internal directories.
Click to hide internal directories.