Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Name specifies the header or query parameter name for the API key
// Example: "X-API-Key" or "api_key"
Name string `yaml:"name"`
// Keys is a list of API keys and their permissions
Keys []Key `yaml:"keys"`
// KeysFile is a path to file containing API keys (optional)
KeysFile string `yaml:"keys_file"`
// Location specifies where to look for the API key: "header" or "query"
Location string `yaml:"location"`
}
Config represents API key authentication plugin configuration
type Connector ¶
type Connector struct {
connectors.Connector
// contains filtered or unexported fields
}
type Key ¶
type Key struct {
// Key is the API key value
Key string `yaml:"key"`
// AllowedMethods specifies which HTTP methods this key can use
// If empty, all methods are allowed
AllowedMethods []string `yaml:"allowed_methods"`
}
Key represents a single API key configuration with its permissions
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func (Plugin) Wrap ¶
func (p Plugin) Wrap(connector connectors.Connector) (connectors.Connector, error)
Click to show internal directories.
Click to hide internal directories.