Documentation
¶
Overview ¶
Package credentials resolves per-connector credentials into the environment- variable maps consumed by detonators and CLI tools. Shared between scenario execution and the test-connection endpoint so per-cloud resolution lives in exactly one place. Package credentials resolves connector secret groups into the environment variables a run needs.
Index ¶
- type Resolver
- func (r *Resolver) Build(ctx context.Context, connector *db.Connector) (map[string]string, error)
- func (r *Resolver) BuildTargets(ctx context.Context, target map[string]string) (map[string]string, error)
- func (r *Resolver) GetElasticAPIKey(ctx context.Context, secretGroupID *uuid.UUID) (string, error)
- func (r *Resolver) LoadAllSecrets(ctx context.Context) map[string]string
- func (r *Resolver) ResolveElasticEnv(ctx context.Context) map[string]string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver builds the environment-variable map for a connector by combining its config JSON, linked secrets, and cloud-provider-specific credential flows (STS, WIF, kubeconfig generation, etc.).
func NewResolver ¶
func NewResolver(connectorStore db.ConnectorStore, secretStore db.SecretStore, encryptor *crypto.Encryptor) *Resolver
NewResolver constructs a Resolver.
func (*Resolver) Build ¶
Build loads config and secrets from a connector and returns them as a credential map ready for environment injection.
func (*Resolver) BuildTargets ¶
func (r *Resolver) BuildTargets(ctx context.Context, target map[string]string) (map[string]string, error)
BuildTargets resolves cloud credentials from a top-level target map. Each entry maps a cloud type (aws, gcp, azure) to a connector name. Returns a merged map of all credential env vars.
func (*Resolver) GetElasticAPIKey ¶
GetElasticAPIKey decrypts the SR_ELASTIC_API_KEY from a connector's linked secret group. Used by both ResolveElasticEnv and the result-export path.
func (*Resolver) LoadAllSecrets ¶
LoadAllSecrets decrypts all secret groups and returns a flat key→value map.
func (*Resolver) ResolveElasticEnv ¶
ResolveElasticEnv resolves the first enabled elastic connector and returns SR_KIBANA_URL/SR_ELASTIC_URL/SR_ELASTIC_CLOUD_ID/SR_ELASTIC_API_KEY as a runEnv map. Returns nil if no enabled elastic connector exists.
Decryption errors on the linked secret group cause the function to return what config it has resolved — the API key just won't be present in the returned map (callers will get a clear "missing API key" error from the downstream Elastic client).