Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type StaticTokenValidator ¶
type StaticTokenValidator struct {
// contains filtered or unexported fields
}
StaticTokenValidator authenticates requests using a single shared secret token. Every valid request is assigned a fixed subject ("static") with admin privileges.
This is intentionally simple — suitable for single-operator evaluation and trusted internal networks. Use OIDC (Validator) for multi-user environments.
func NewStaticToken ¶
func NewStaticToken(token string) *StaticTokenValidator
NewStaticToken creates a StaticTokenValidator. token must be non-empty.
func (*StaticTokenValidator) Authenticate ¶
func (v *StaticTokenValidator) Authenticate(_ context.Context, authHeader string) (*Principal, error)
Authenticate accepts "Bearer <token>" where token matches the configured static secret. Emits a startup-style warning on every successful auth to remind operators to migrate to OIDC.
Click to show internal directories.
Click to hide internal directories.