Documentation
¶
Index ¶
- type BearerHookID
- type BearerPlugin
- func (p *BearerPlugin) AuthMiddleware() func(http.Handler) http.Handler
- func (p *BearerPlugin) Close() error
- func (p *BearerPlugin) Config() any
- func (p *BearerPlugin) Hooks() []models.Hook
- func (p *BearerPlugin) Init(ctx *models.PluginContext) error
- func (p *BearerPlugin) Metadata() models.PluginMetadata
- func (p *BearerPlugin) OnConfigUpdate(config *models.Config) error
- func (p *BearerPlugin) OptionalAuthMiddleware() func(http.Handler) http.Handler
- type BearerPluginConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BearerHookID ¶
type BearerHookID string
const ( // HookIDBearerAuth identifies the bearer token authentication hook // Validates Authorization: Bearer <token> header and sets ctx.UserID HookIDBearerAuth BearerHookID = "bearer.auth" // HookIDBearerAuthOptional identifies the optional bearer token authentication hook // Validates Authorization: Bearer <token> header and sets ctx.UserID if valid, but does not return unauthorized if invalid HookIDBearerAuthOptional BearerHookID = "bearer.auth.optional" )
Constants for bearer plugin hook IDs and metadata
func (BearerHookID) String ¶
func (id BearerHookID) String() string
type BearerPlugin ¶
type BearerPlugin struct {
// contains filtered or unexported fields
}
BearerPlugin validates Authorization headers using the JWT plugin.
func New ¶
func New(config BearerPluginConfig) *BearerPlugin
New creates a new BearerPlugin instance with sane defaults.
func (*BearerPlugin) AuthMiddleware ¶
func (p *BearerPlugin) AuthMiddleware() func(http.Handler) http.Handler
func (*BearerPlugin) Close ¶
func (p *BearerPlugin) Close() error
func (*BearerPlugin) Config ¶
func (p *BearerPlugin) Config() any
func (*BearerPlugin) Hooks ¶
func (p *BearerPlugin) Hooks() []models.Hook
func (*BearerPlugin) Init ¶
func (p *BearerPlugin) Init(ctx *models.PluginContext) error
func (*BearerPlugin) Metadata ¶
func (p *BearerPlugin) Metadata() models.PluginMetadata
func (*BearerPlugin) OnConfigUpdate ¶
func (p *BearerPlugin) OnConfigUpdate(config *models.Config) error
func (*BearerPlugin) OptionalAuthMiddleware ¶
func (p *BearerPlugin) OptionalAuthMiddleware() func(http.Handler) http.Handler
type BearerPluginConfig ¶
type BearerPluginConfig struct {
Enabled bool `json:"enabled" toml:"enabled"`
HeaderName string `json:"header_name" toml:"header_name"`
}
BearerPluginConfig defines configuration options for the bearer plugin.
func (*BearerPluginConfig) ApplyDefaults ¶
func (config *BearerPluginConfig) ApplyDefaults()
Click to show internal directories.
Click to hide internal directories.