store

package
v2.1.10 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

*

  • Azure App Config implementation

*

*

  • Azure KeyVault implementation

*

*

  • Azure TableStore implementation

*

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRetrieveFailed       = errors.New("failed to retrieve config item")
	ErrClientInitialization = errors.New("failed to initialize the client")
	ErrEmptyResponse        = errors.New("value retrieved but empty for token")
	ErrServiceCallFailed    = errors.New("failed to complete the service call")
)
View Source
var ErrIncorrectlyStructuredToken = errors.New("incorrectly structured token")

Functions

This section is empty.

Types

type AzAppConf

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

func NewAzAppConf

func NewAzAppConf(ctx context.Context, token *config.ParsedTokenConfig, logger log.ILogger) (*AzAppConf, error)

NewAzAppConf

func (*AzAppConf) SetToken

func (implmt *AzAppConf) SetToken(token *config.ParsedTokenConfig)

setTokenVal sets the token

func (*AzAppConf) Token

func (imp *AzAppConf) Token() (string, error)

tokenVal in AZ App Config label can be specified From this point then normal rules of configmanager apply, including keySeperator and lookup.

type AzAppConfConfig

type AzAppConfConfig struct {
	Label          string       `json:"label"`
	Etag           *azcore.ETag `json:"etag"`
	AcceptDateTime *time.Time   `json:"acceptedDateTime"`
}

AzAppConfConfig is the azure conf service specific config and it is parsed from the token metadata

type AzKvConfig

type AzKvConfig struct {
	Version string `json:"version"`
}

AzKvConfig takes any metadata from the token Version is the only

type AzTableStore

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

func NewAzTableStore

func NewAzTableStore(ctx context.Context, token *config.ParsedTokenConfig, logger log.ILogger) (*AzTableStore, error)

NewAzTableStore

func (*AzTableStore) SetToken

func (implmt *AzTableStore) SetToken(token *config.ParsedTokenConfig)

setToken already happens in the constructor

func (*AzTableStore) Token

func (imp *AzTableStore) Token() (string, error)

tokenVal in AZ table storage if an Entity contains the `value` property we attempt to extract it and return.

From this point then normal rules of configmanager apply, including keySeperator and lookup.

type AzTableStrgConfig

type AzTableStrgConfig struct {
	Format string `json:"format"`
}

type GcpSecrets

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

func NewGcpSecrets

func NewGcpSecrets(ctx context.Context, logger log.ILogger) (*GcpSecrets, error)

func (*GcpSecrets) SetToken

func (imp *GcpSecrets) SetToken(token *config.ParsedTokenConfig)

func (*GcpSecrets) Token

func (imp *GcpSecrets) Token() (string, error)

type GcpSecretsConfig

type GcpSecretsConfig struct {
	Version string `json:"version"`
}

type KvScrtStore

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

func NewKvScrtStore

func NewKvScrtStore(ctx context.Context, token *config.ParsedTokenConfig, logger log.ILogger) (*KvScrtStore, error)

NewKvScrtStore returns a KvScrtStore requires `AZURE_SUBSCRIPTION_ID` environment variable to be present to successfully work

func (*KvScrtStore) SetToken

func (implmt *KvScrtStore) SetToken(token *config.ParsedTokenConfig)

setToken already happens in AzureKVClient in the constructor

func (*KvScrtStore) Token

func (imp *KvScrtStore) Token() (string, error)

type ParamStore

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

func NewParamStore

func NewParamStore(ctx context.Context, logger log.ILogger) (*ParamStore, error)

func (*ParamStore) SetToken

func (imp *ParamStore) SetToken(token *config.ParsedTokenConfig)

func (*ParamStore) Token

func (imp *ParamStore) Token() (string, error)

type ParamStrConfig

type ParamStrConfig struct {
}

type SecretsMgr

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

func NewSecretsMgr

func NewSecretsMgr(ctx context.Context, logger log.ILogger) (*SecretsMgr, error)

func (*SecretsMgr) SetToken

func (imp *SecretsMgr) SetToken(token *config.ParsedTokenConfig)

func (*SecretsMgr) Token

func (imp *SecretsMgr) Token() (string, error)

type SecretsMgrConfig

type SecretsMgrConfig struct {
	Version string `json:"version"`
}

type Strategy

type Strategy interface {
	Token() (s string, e error)
	SetToken(s *config.ParsedTokenConfig)
}

Strategy iface that all store implementations must conform to, in order to be be used by the retrieval implementation

Defined on the package for easier re-use across the program

type VaultConfig

type VaultConfig struct {
	Version string `json:"version"`
	Role    string `json:"iam_role"`
}

VaultConfig holds the parseable metadata struct

type VaultStore

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

func NewVaultStore

func NewVaultStore(ctx context.Context, token *config.ParsedTokenConfig, logger log.ILogger) (*VaultStore, error)

func (*VaultStore) SetToken

func (imp *VaultStore) SetToken(token *config.ParsedTokenConfig)

setTokenVal imp.token is already set in the Vault constructor

This happens inside the New func call due to the way the client needs to be initialised with a mountpath and mountpath is part of the token so it is set then

func (*VaultStore) Token

func (imp *VaultStore) Token() (string, error)

getTokenValue implements the underlying techonology token retrieval and returns a stringified version of the secret

Jump to

Keyboard shortcuts

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