provider

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package provider defines the interface and registry for secret providers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List() []string

List returns all registered provider kinds

func Register

func Register(kind string, factory func() Provider)

Register registers a provider factory function

Types

type KeyValue

type KeyValue struct {
	Key   string
	Value string
}

KeyValue represents a secret key-value pair

type Provider

type Provider interface {
	// Name returns the name of the provider
	Name() string

	// Fetch fetches secrets from the provider based on the configuration
	// config contains provider-specific configuration fields (e.g., path, region, endpoint, etc.)
	Fetch(secretContext SecretContext, mapID string, config map[string]interface{}, keys map[string]string) ([]KeyValue, error)
}

Provider is the interface that all secret providers must implement

func New

func New(kind string) (Provider, error)

New creates a new provider instance by kind

type ProviderSecretsMap added in v0.0.6

type ProviderSecretsMap map[string]Secrets

ProviderSecretsMap represents secrets organized by provider ID

type SecretContext added in v0.0.6

type SecretContext struct {
	Ctx             context.Context
	SecretsResolver SecretsResolver
}

SecretContext provides context and resolver access to providers

type Secrets added in v0.0.6

type Secrets map[string]string

Secrets represents a collection of secret key-value pairs

type SecretsResolver added in v0.0.6

type SecretsResolver interface {
	// Get returns secrets for a specific provider ID
	Get(id string) map[string]string
	// Map returns all provider secrets as a map
	Map() map[string]map[string]string
}

SecretsResolver provides access to secrets from other providers This interface allows providers to access secrets without creating an import cycle

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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