Documentation
¶
Overview ¶
Provides internal functionality for fetching and processing secrets from the Buildkite API during job execution.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient interface {
GetSecret(ctx context.Context, req *api.GetSecretRequest) (*api.Secret, *api.Response, error)
}
APIClient interface defines only the method needed by the secrets manager to fetch secrets from the Buildkite API.
type FetchSecretsOpt ¶ added in v3.118.1
type FetchSecretsOpt func(*fetchSecretsConfig)
FetchSecretsOpt is a functional option for FetchSecrets.
func WithRetrySleepFunc ¶ added in v3.118.1
func WithRetrySleepFunc(f func(time.Duration)) FetchSecretsOpt
WithRetrySleepFunc overrides the sleep function used between retries. This is primarily useful for unit tests.
type Secret ¶
Secret represents a fetched secret with its key and value.
func FetchSecrets ¶
func FetchSecrets(ctx context.Context, l logger.Logger, client APIClient, jobID string, keys []string, concurrency int, opts ...FetchSecretsOpt) ([]Secret, []error)
FetchSecrets retrieves all secret values from the API concurrently. Each individual secret fetch is retried up to 3 times with exponential backoff on retryable errors (TLS handshake failures, timeouts, 5xx, 429). If any secret fails after retries, returns error with details of all failed secrets.
type SecretError ¶
func (*SecretError) Error ¶
func (e *SecretError) Error() string
func (*SecretError) Unwrap ¶
func (e *SecretError) Unwrap() error