types

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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")
)
View Source
var (
	ErrSecretNotFound      = fmt.Errorf("secret not found")
	ErrSecretKeyNotFound   = fmt.Errorf("secret key not found")
	ErrCouldNotFetchSecret = fmt.Errorf("could not fetch secret")
)

Functions

This section is empty.

Types

type SecretCoord

type SecretCoord struct {
	Type      string
	Location  string
	Modifiers [][2]string
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL