Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HealthChecker ¶
func HealthChecker(cfg Config, client *http.Client) ports.HealthChecker
HealthChecker returns a Clerk JWKS health checker or nil when disabled.
Types ¶
type Config ¶
type Config struct {
Enabled bool
JWKSURL string
Issuer string
Audience string
AllowedClockSkew time.Duration
JWKSRefreshTimeout time.Duration
JWKSRefreshInterval time.Duration
SkipHeaderEnabled bool
SkipHeaderName string
}
Config controls Clerk JWT validation.
func LoadConfig ¶
LoadConfig reads Clerk config from environment.
type Middleware ¶
type Middleware struct {
// contains filtered or unexported fields
}
Middleware validates Clerk-issued JWTs and stores the subject.
func NewMiddleware ¶
NewMiddleware creates a middleware instance.
func (*Middleware) Handler ¶
func (m *Middleware) Handler(next http.Handler) http.Handler
Handler returns the http middleware.
func (*Middleware) OptionalHandler ¶
func (m *Middleware) OptionalHandler(next http.Handler) http.Handler
OptionalHandler attaches a subject when a valid token is present, but allows requests without authentication to continue.
Click to show internal directories.
Click to hide internal directories.