remotesecrets

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitwardenConfig

type BitwardenConfig struct {
	ApiURL      string `name:"api-url" help:"API URL" env:"API_URL" default:"https://vault.bitwarden.com/api"`
	IdentityURL string `name:"identity-url" help:"Identity URL" env:"IDENTITY_URL" default:"https://vault.bitwarden.com/identity"`
	AccessToken string `name:"access-token" help:"Access token" env:"ACCESS_TOKEN" and:"bitwarden" xor:"remote-provider"`
	OrgID       string `name:"organization-id" help:"Organization ID" env:"ORGANIZATION_ID" and:"bitwarden"`
	ProjectID   string `name:"project-id" help:"Project ID" env:"PROJECT_ID" and:"bitwarden"`
}

type Client

type Client interface {
	// FetchAll retrieves all secrets from the remote provider.
	FetchAll() (map[string]*string, error)
	// Get retrieves one secret by key or ID.
	Get(id string) (string, error)
	Close()
}

func New

func New(ctx context.Context, cfg Config) (Client, error)

New creates a remote secrets client based on the configured provider. It returns nil, nil when no provider is configured.

func NewBitwardenClient

func NewBitwardenClient(cfg BitwardenConfig) (Client, error)

NewBitwardenClient authenticates and returns a Bitwarden secrets client.

func NewInfisicalClient

func NewInfisicalClient(ctx context.Context, cfg InfisicalConfig) (Client, error)

NewInfisicalClient authenticates and returns a client for the configured secret paths.

type Config

type Config struct {
	Bitwarden BitwardenConfig `embed:"" prefix:"bitwarden-" envprefix:"BITWARDEN_" group:"Bitwarden Options:"`
	Infisical InfisicalConfig `embed:"" prefix:"infisical-" envprefix:"INFISICAL_" group:"Infisical Options:"`
}

func (Config) Configured

func (c Config) Configured() bool

Configured reports whether any remote secrets provider configuration is present.

func (Config) Provider

func (c Config) Provider() (string, error)

Provider returns and validates the configured remote secrets provider.

type InfisicalConfig

type InfisicalConfig struct {
	SiteUrl      string `name:"site-url" help:"Site URL" env:"SITE_URL" default:"https://app.infisical.com"`
	ClientID     string `name:"client-id" help:"Client ID (Universal Auth)" env:"CLIENT_ID" and:"infisical" xor:"remote-provider"`
	ClientSecret string `name:"client-secret" help:"Client Secret (Universal Auth)" env:"CLIENT_SECRET" and:"infisical"`
	Environment  string `name:"environment" help:"Environment slug" env:"ENVIRONMENT" and:"infisical"`
	ProjectID    string `name:"project-id" help:"Project ID" env:"PROJECT_ID" and:"infisical"`
	SecretPath   string `name:"secret-path" help:"Secret path (comma-separated for multiple paths)" env:"SECRET_PATH" default:"/"`
}

Jump to

Keyboard shortcuts

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