Help us shape the future of Go! Take the 2026 Go Developer Survey

vaultadapter

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package vaultadapter adapts the vault extension's services to the authsome bridge.Vault interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

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

Adapter implements bridge.Vault by delegating to the vault extension's secret, flag, and config services.

func New

func New(secrets *vaultsecret.Service, flags *vaultflag.Service, config *vaultconfig.Service, opts ...Option) *Adapter

New creates a new vault adapter. All service parameters are optional; nil services return bridge.ErrVaultNotAvailable for their methods.

func (*Adapter) GetConfig

func (a *Adapter) GetConfig(ctx context.Context, key string) (string, error)

GetConfig returns a configuration value by key.

func (*Adapter) GetSecret

func (a *Adapter) GetSecret(ctx context.Context, key string) ([]byte, error)

GetSecret returns a decrypted secret by key.

func (*Adapter) IsFeatureEnabled

func (a *Adapter) IsFeatureEnabled(ctx context.Context, flag string) bool

IsFeatureEnabled evaluates a boolean feature flag.

func (*Adapter) SetSecret

func (a *Adapter) SetSecret(ctx context.Context, key string, value []byte) error

SetSecret creates or updates an encrypted secret.

type Option

type Option func(*Adapter)

Option configures the adapter.

func WithAppID

func WithAppID(appID string) Option

WithAppID sets the app ID scope for vault operations.

Jump to

Keyboard shortcuts

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