Documentation ¶
Overview ¶
Package oauth provides a middleware for authenticating requests.This package provides functionality for token validation and integration with JSON Web Key (JWK) to verify JSON Web Tokens (JWT).
Index ¶
- func Auth(logger log.Logger, options Options) func(inner http.Handler) http.Handler
- func LDAPOAuth(logger log.Logger, ldapOptions *middleware.LDAPOptions, options Options) func(inner http.Handler) http.Handler
- type JWT
- type JWTContextKey
- type OAuth
- type Options
- type PublicKey
- type PublicKeyCache
- type PublicKeys
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type JWT ¶
type JWT struct {
// contains filtered or unexported fields
}
JWT represents a JWT token, including its payload, header, and signature.
type JWTContextKey ¶
type JWTContextKey string
type OAuth ¶
type OAuth struct {
// contains filtered or unexported fields
}
OAuth struct manages OAuth options and caches public keys for JWT validation.
type PublicKey ¶
type PublicKey struct { ID string `json:"kid"` Alg string `json:"alg"` Type string `json:"kty"` Use string `json:"use"` Operations []string `json:"key_ops"` // rsa fields Modulus string `json:"n"` PublicExponent string `json:"e"` PrivateExponent string `json:"d"` // contains filtered or unexported fields }
PublicKey encapsulates public key information used for JWT signature validation, including RSA fields.
type PublicKeyCache ¶
type PublicKeyCache struct {
// contains filtered or unexported fields
}
PublicKeyCache caches public keys for JWT validation and manages concurrency.
type PublicKeys ¶
type PublicKeys struct {
Keys []PublicKey `json:"keys"`
}
PublicKeys holds a collection of public keys.
func (*PublicKeys) Get ¶
func (publicKeys *PublicKeys) Get(kID string) *PublicKey
Click to show internal directories.
Click to hide internal directories.