Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrSecretCoordFailedParsing = fmt.Errorf("failed to parse coordinates") ErrSecretCoordHaveNoType = fmt.Errorf("coordinates have no type (URI scheme)") ErrSecretCoordHaveNoLocation = fmt.Errorf( "coordinates point to no location (URI authority+path)", ) ErrSecretCoordFailedParsingModifiers = fmt.Errorf("failed to parse modifiers") )
Functions ¶
This section is empty.
Types ¶
type SecretCoord ¶
SecretCoord are the coordinates to a secret. Coordinates have a Type (to determine the source of the secret), a Location (to determine how to get to it) and optional Modifiers.
This type implements encoding.TextUnmarshaler, so it can be decoded by any idiomatic Go codebase from plain text and even as part of json.Unmarshal calls.
func NewSecretCoord ¶
func NewSecretCoord(secretCoordURI string) (*SecretCoord, error)
NewSecretCoord creates a new SecretCoord from a URI-based coordinates string.
Splunker will then dig-up the secret using the correct SecretSource, identified using the SecretCoord.Type (scheme). The specific SecretSource will then use the SecretCoord.Location (authority + path) and the SecretCoord.Modifiers (query) to finish the dig-up.
Each SecretSource defines the URI format it supports.
func (*SecretCoord) UnmarshalText ¶
func (sc *SecretCoord) UnmarshalText(text []byte) error
type SecretModifier ¶
type SecretModifier interface {
// Type returns the unique identifier for the type of SecretModifier.
Type() string
// Modify applies a modification to the given secret value.
Modify(ctx context.Context, secretValue string, mod string) (string, error)
}
SecretModifier receives a secret and applies a modification to it.
type SecretSource ¶
type SecretSource interface {
// Type returns the unique identifier for the type of SecretSource.
Type() string
// DigUp returns the secret pointed at by the given SecretCoord.
DigUp(context.Context, SecretCoord) (string, error)
}
SecretSource is a source of secrets.