provider

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package provider defines the interfaces and types for secret providers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(r Registration)

Register adds a provider to the registry.

Types

type Destination

type Destination interface {
	Write(ctx context.Context, secrets []Secret) error
}

func CreateDestination

func CreateDestination(ctx context.Context, t Type, opts map[string]any) (Destination, error)

CreateDestination creates a Destination for the given provider type.

type DestinationFactory

type DestinationFactory func(ctx context.Context, opts map[string]any) (Destination, error)

DestinationFactory creates a Destination provider from opaque options.

type Provider

type Provider interface {
	Source
	Destination
}

type Registration

type Registration struct {
	Name          Type
	SourceFactory SourceFactory
	DestFactory   DestinationFactory
}

Registration holds factory functions for a provider type.

func Get

func Get(t Type) (Registration, error)

Get returns the registration for the given provider type.

type Secret

type Secret struct {
	Name            string
	Value           string
	Type            string // "env" or "secret" or "file"
	OtherAttributes map[string]string
}

type Source

type Source interface {
	Read(ctx context.Context) ([]Secret, error)
}

func CreateSource

func CreateSource(ctx context.Context, t Type, opts map[string]any) (Source, error)

CreateSource creates a Source for the given provider type.

type SourceFactory

type SourceFactory func(ctx context.Context, opts map[string]any) (Source, error)

SourceFactory creates a Source provider from opaque options.

type Type

type Type string

Type identifies a secret provider.

const (
	GitHub     Type = "github"
	GitLab     Type = "gitlab"
	Vault      Type = "vault"
	Etcd       Type = "etcd"
	Kubernetes Type = "kubernetes"
	File       Type = "file"
)

func RegisteredTypes

func RegisteredTypes() []Type

RegisteredTypes returns all registered provider types.

Directories

Path Synopsis
Package etcd implements a provider for etcd key-value store.
Package etcd implements a provider for etcd key-value store.
Package file implements a provider that reads and writes secrets from/to a local file.
Package file implements a provider that reads and writes secrets from/to a local file.
Package github implements a provider for GitHub repository secrets and variables.
Package github implements a provider for GitHub repository secrets and variables.
Package gitlab implements a provider for GitLab project variables.
Package gitlab implements a provider for GitLab project variables.
Package kubernetes implements a provider that reads/writes secrets from/to Kubernetes Secrets and ConfigMaps.
Package kubernetes implements a provider that reads/writes secrets from/to Kubernetes Secrets and ConfigMaps.
Package vault implements the provider interface for HashiCorp Vault.
Package vault implements the provider interface for HashiCorp Vault.

Jump to

Keyboard shortcuts

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