parameters

package
v0.1.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnavailable = errors.New("secret store unavailable")
	ErrConflict    = errors.New("secret version conflict")
)

Functions

This section is empty.

Types

type MaintenanceStore

type MaintenanceStore interface {
	ListPendingSecretMutations(context.Context, int) ([]domain.SecretMutation, error)
	CompleteSecretMutation(context.Context, domain.SecretMutation, int64) (domain.Parameter, error)
	AbandonSecretMutation(context.Context, domain.SecretMutation) error
	ListParameterPurgeCandidates(context.Context, int) ([]domain.ParameterPurgeCandidate, error)
	MarkParameterPurged(context.Context, int64) error
}

MaintenanceStore is the persistence contract consumed by secret maintenance.

type OpenBaoConfig

type OpenBaoConfig struct {
	Address                 string
	KubernetesAuthMount     string
	KubernetesRole          string
	ServiceAccountTokenFile string
	Mount                   string
	HTTPClient              *http.Client
}

type OpenBaoKV2

type OpenBaoKV2 struct {
	// contains filtered or unexported fields
}

func NewOpenBaoKV2

func NewOpenBaoKV2(config OpenBaoConfig) (*OpenBaoKV2, error)

func (*OpenBaoKV2) CurrentVersion

func (c *OpenBaoKV2) CurrentVersion(ctx context.Context, reference string) (int64, error)

func (*OpenBaoKV2) Delete

func (c *OpenBaoKV2) Delete(ctx context.Context, reference string) error

func (*OpenBaoKV2) Get

func (c *OpenBaoKV2) Get(ctx context.Context, reference string, version int64) (string, error)

func (*OpenBaoKV2) Put

func (c *OpenBaoKV2) Put(ctx context.Context, reference, value string, expectedVersion int64) (int64, error)

type SecretValueStore

type SecretValueStore interface {
	Put(context.Context, string, string, int64) (int64, error)
	Get(context.Context, string, int64) (string, error)
	CurrentVersion(context.Context, string) (int64, error)
	Delete(context.Context, string) error
}

SecretValueStore is declared by the parameter domain that consumes it. Its references and versions are internal implementation details, never API IDs.

type UnavailableStore

type UnavailableStore struct{}

func (UnavailableStore) CurrentVersion

func (UnavailableStore) CurrentVersion(context.Context, string) (int64, error)

func (UnavailableStore) Delete

func (UnavailableStore) Get

func (UnavailableStore) Put

type Worker

type Worker struct {
	Store           MaintenanceStore
	Secrets         SecretValueStore
	MutationTimeout time.Duration
	Logger          *slog.Logger
}

Worker reconciles incomplete secret mutations and retention purges.

func (Worker) Run

func (w Worker) Run(ctx context.Context)

Run performs maintenance until the context is canceled.

func (Worker) RunOnce

func (w Worker) RunOnce(ctx context.Context) (bool, error)

RunOnce performs at most one recovery or purge action.

Jump to

Keyboard shortcuts

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