secrets

package
v3.118.1 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 8 Imported by: 0

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

type Secret struct {
	Key   string
	Value string
}

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

type SecretError struct {
	Key string
	Err error
}

func (*SecretError) Error

func (e *SecretError) Error() string

func (*SecretError) Unwrap

func (e *SecretError) Unwrap() error

Jump to

Keyboard shortcuts

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