Documentation
¶
Overview ¶
Package secrets provides pluggable secret resolution from external backends. The resolver registry is safe for concurrent use.
Index ¶
- func ParseScheme(ref string) string
- func Register(r Resolver)
- func Resolve(ctx context.Context, reference string) (string, error)
- func ResolveAll(ctx context.Context, secrets map[string]string) (map[string]string, error)
- type BackendError
- type InvalidReferenceError
- type NotFoundError
- type OnePasswordResolver
- type Resolver
- type SSMResolver
- type UnsupportedSchemeError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseScheme ¶
ParseScheme extracts the scheme from a URI (e.g., "op" from "op://vault/item").
func Register ¶
func Register(r Resolver)
Register adds a resolver to the registry. Safe for concurrent use.
Types ¶
type BackendError ¶
BackendError wraps errors from secret backends with actionable context.
func (*BackendError) Error ¶
func (e *BackendError) Error() string
type InvalidReferenceError ¶
InvalidReferenceError indicates a malformed secret reference.
func (*InvalidReferenceError) Error ¶
func (e *InvalidReferenceError) Error() string
type NotFoundError ¶
NotFoundError indicates the secret was not found in the backend.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
type OnePasswordResolver ¶
type OnePasswordResolver struct{}
OnePasswordResolver resolves secrets from 1Password using the op CLI.
func (*OnePasswordResolver) Scheme ¶
func (r *OnePasswordResolver) Scheme() string
Scheme returns "op".
type Resolver ¶
type Resolver interface {
// Scheme returns the URI scheme this resolver handles (e.g., "op", "ssm").
Scheme() string
// Resolve fetches the secret value for the given reference.
// The reference is the full URI (e.g., "op://Dev/OpenAI/api-key").
Resolve(ctx context.Context, reference string) (string, error)
}
Resolver resolves a secret reference to its plaintext value.
type SSMResolver ¶
type SSMResolver struct{}
SSMResolver resolves secrets from AWS Systems Manager Parameter Store.
type UnsupportedSchemeError ¶
type UnsupportedSchemeError struct {
Scheme string
}
UnsupportedSchemeError indicates an unrecognized URI scheme.
func (*UnsupportedSchemeError) Error ¶
func (e *UnsupportedSchemeError) Error() string