Documentation
¶
Overview ¶
Package plugin provides the plugin system for extending Vault functionality. Plugins implement the base Plugin interface and optionally implement additional capability interfaces for specific subsystems.
Index ¶
- type EncryptionProvider
- type FlagEvaluator
- type OnConfigChange
- type OnInit
- type OnSecretAccess
- type OnShutdown
- type Plugin
- type Registry
- func (r *Registry) ConfigChangeHooks() []OnConfigChange
- func (r *Registry) EncryptionProviders() []EncryptionProvider
- func (r *Registry) FlagEvaluatorByName(name string) FlagEvaluator
- func (r *Registry) InitHooks() []OnInit
- func (r *Registry) Plugins() []Plugin
- func (r *Registry) Register(p Plugin)
- func (r *Registry) RotationStrategyByName(name string) RotationStrategy
- func (r *Registry) SecretAccessHooks() []OnSecretAccess
- func (r *Registry) ShutdownHooks() []OnShutdown
- func (r *Registry) SourceProviders() []SourceProvider
- type RegistryOption
- type RotationStrategy
- type SourceProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EncryptionProvider ¶
type EncryptionProvider interface {
EncryptionKeyProvider() crypto.EncryptionKeyProvider
}
EncryptionProvider provides an encryption key provider.
type FlagEvaluator ¶
type FlagEvaluator interface {
EvaluatorName() string
Evaluate(ctx context.Context, rule *flag.Rule, tenantID, userID string) (bool, error)
}
FlagEvaluator provides a custom flag rule evaluator.
type OnConfigChange ¶
type OnConfigChange interface {
OnConfigChange(ctx context.Context, key string, oldValue, newValue any) error
}
OnConfigChange is called when a config entry changes.
type OnSecretAccess ¶
OnSecretAccess is called when a secret is accessed.
type OnShutdown ¶
OnShutdown is implemented by plugins that need cleanup.
type Plugin ¶
type Plugin interface {
Name() string
}
Plugin is the base interface all plugins must implement.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages plugin registration and discovery. It uses type-switch discovery to categorize plugins by capability at registration time.
func NewRegistry ¶
func NewRegistry(opts ...RegistryOption) *Registry
NewRegistry creates a plugin registry.
func (*Registry) ConfigChangeHooks ¶
func (r *Registry) ConfigChangeHooks() []OnConfigChange
ConfigChangeHooks returns all plugins that implement OnConfigChange.
func (*Registry) EncryptionProviders ¶
func (r *Registry) EncryptionProviders() []EncryptionProvider
EncryptionProviders returns all encryption key providers.
func (*Registry) FlagEvaluatorByName ¶
func (r *Registry) FlagEvaluatorByName(name string) FlagEvaluator
FlagEvaluatorByName returns the flag evaluator with the given name, or nil.
func (*Registry) Register ¶
Register adds a plugin to the registry. It discovers all implemented capability interfaces via type assertion and registers the plugin in the appropriate internal collections.
func (*Registry) RotationStrategyByName ¶
func (r *Registry) RotationStrategyByName(name string) RotationStrategy
RotationStrategyByName returns the rotation strategy with the given name, or nil.
func (*Registry) SecretAccessHooks ¶
func (r *Registry) SecretAccessHooks() []OnSecretAccess
SecretAccessHooks returns all plugins that implement OnSecretAccess.
func (*Registry) ShutdownHooks ¶
func (r *Registry) ShutdownHooks() []OnShutdown
ShutdownHooks returns all plugins that implement OnShutdown.
func (*Registry) SourceProviders ¶
func (r *Registry) SourceProviders() []SourceProvider
SourceProviders returns all source-providing plugins.
type RegistryOption ¶
type RegistryOption func(*Registry)
RegistryOption configures the Registry.
func WithLogger ¶
func WithLogger(l log.Logger) RegistryOption
WithLogger sets the logger for the registry.
type RotationStrategy ¶
type RotationStrategy interface {
RotationName() string
Rotate(ctx context.Context, key string, current []byte) ([]byte, error)
}
RotationStrategy provides a custom secret rotation strategy.
type SourceProvider ¶
SourceProvider provides a configuration source with a priority.