Documentation
¶
Overview ¶
Package secretservice provides interfaces and types for managing secret service definitions. A secret service describes how a particular type of secret is applied to workspace requests, including which hosts it matches, what HTTP header to set, and how to format the value.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrSecretServiceNotFound is returned when a secret service is not found in the registry. ErrSecretServiceNotFound = errors.New("secret service not found") )
Functions ¶
This section is empty.
Types ¶
type Registry ¶
type Registry interface {
// Register registers a secret service implementation.
// Returns an error if a secret service with the same name is already registered.
Register(service SecretService) error
// Get retrieves a secret service implementation by name.
// Returns ErrSecretServiceNotFound if the secret service is not registered.
Get(name string) (SecretService, error)
// List returns all registered secret service names.
List() []string
}
Registry manages secret service implementations.
type SecretService ¶
type SecretService interface {
// Name returns the identifier of the secret service.
Name() string
// Description returns a human-readable description of the secret service.
// Returns an empty string if not set.
Description() string
// HostsPatterns returns the list of regular expression patterns for matching hosts.
// Returns nil if not set.
HostsPatterns() []string
// Path returns the optional path for the secret service.
// Returns an empty string if not set.
Path() string
// EnvVars returns the optional list of environment variable names.
// Returns nil if not set.
EnvVars() []string
// HeaderName returns the name of the HTTP header.
HeaderName() string
// HeaderTemplate returns the optional template for the header value.
// The template uses ${value} for value insertion.
// Returns an empty string if not set.
HeaderTemplate() string
}
SecretService defines the contract for a secret service implementation. Each secret service describes how secrets of a particular type are applied.
func NewSecretService ¶
func NewSecretService(name string, hostsPatterns []string, path string, envVars []string, headerName, headerTemplate, description string) SecretService
NewSecretService creates a new SecretService implementation with the given parameters.
Click to show internal directories.
Click to hide internal directories.