Documentation
¶
Index ¶
- func InjectExternalSecrets(v any, fetched *FetchedExternalSecrets) (any, error)
- func ParamsToEnv(from map[string]any, to map[string]string, prefix string, upper bool, ...) (err error)
- type CollectedExternalSecrets
- type ExternalSecretBatchFetcher
- type ExternalSecretFetcher
- type ExternalSecretRef
- type FetchedExternalSecrets
- type SecretFetchers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InjectExternalSecrets ¶
func InjectExternalSecrets(v any, fetched *FetchedExternalSecrets) (any, error)
InjectExternalSecrets replaces external secret references (from_secret with object value) with the actual fetched secret values.
Types ¶
type CollectedExternalSecrets ¶
type CollectedExternalSecrets struct {
// Refs are all unique external secret references found
Refs []ExternalSecretRef
// RefsByKey maps a unique key to the reference for deduplication
RefsByKey map[string]ExternalSecretRef
}
CollectedExternalSecrets holds the result of scanning YAML for external secrets.
func CollectExternalSecrets ¶
func CollectExternalSecrets(v any) *CollectedExternalSecrets
CollectExternalSecrets scans a value (typically YAML settings/environment) for external secret references (from_secret with object value) and collects them for batch fetching. Note: from_secret with a string value is an internal secret, handled separately.
func (*CollectedExternalSecrets) HasExternalSecrets ¶
func (c *CollectedExternalSecrets) HasExternalSecrets() bool
HasExternalSecrets checks if the collected secrets contain any references.
type ExternalSecretBatchFetcher ¶
type ExternalSecretBatchFetcher func(ctx context.Context, refs []ExternalSecretRef) (map[ExternalSecretRef]string, error)
ExternalSecretBatchFetcher fetches a batch of external secrets in a single call. The returned map MUST contain an entry for every input ref on success; implementations should group by integration to share authentication and minimize round-trips.
type ExternalSecretFetcher ¶
type ExternalSecretFetcher func(ctx context.Context, ref ExternalSecretRef) (string, error)
ExternalSecretFetcher is a function that fetches a single secret from an external store. Kept for callers (e.g., tests) that fetch one secret at a time. Production callers should prefer ExternalSecretBatchFetcher, which only authenticates against each integration once.
type ExternalSecretRef ¶
type ExternalSecretRef struct {
IntegrationID int64 // Numeric ID (used if IntegrationName is empty)
IntegrationName string // Name lookup (takes precedence if set)
Path string
Key string
Version int
}
ExternalSecretRef represents a reference to an external secret store.
type FetchedExternalSecrets ¶
type FetchedExternalSecrets struct {
// Secrets maps the unique key to the fetched secret value
Secrets map[string]string
}
FetchedExternalSecrets holds secrets that have been fetched from external stores.
func FetchExternalSecrets ¶
func FetchExternalSecrets(ctx context.Context, collected *CollectedExternalSecrets, fetcher ExternalSecretBatchFetcher) (*FetchedExternalSecrets, error)
FetchExternalSecrets fetches all collected external secrets using the provided batch fetcher. Returns a map that can be used to resolve references during YAML processing. A single batch call lets the fetcher authenticate against each integration only once, which avoids per-secret HTTP overhead when a workflow references many external secrets.
type SecretFetchers ¶
type SecretFetchers struct {
// GetInternalSecret fetches secrets from Crow's internal secret store
GetInternalSecret func(name string) (string, error)
// GetExternalSecret fetches secrets from external stores (Vault, etc.)
GetExternalSecret ExternalSecretFetcher
// Context for external secret operations
Ctx context.Context
}
SecretFetchers holds callbacks for fetching secrets from various sources.