Documentation ¶
Index ¶
- Constants
- type SecretProvider
- type SecretProviderImpl
- func (s *SecretProviderImpl) GetDatabaseCredentials(database db.DatabaseInfo) (common.Credentials, error)
- func (s *SecretProviderImpl) GetSecrets(path string, keys ...string) (map[string]string, error)
- func (s *SecretProviderImpl) Initialize(ctx context.Context) bool
- func (s *SecretProviderImpl) InsecureSecretsUpdated()
- func (s *SecretProviderImpl) SecretsLastUpdated() time.Time
- func (s *SecretProviderImpl) StoreSecrets(path string, secrets map[string]string) error
- type SecretProviderMock
- func (s *SecretProviderMock) GetDatabaseCredentials(database db.DatabaseInfo) (common.Credentials, error)
- func (s *SecretProviderMock) GetSecrets(path string, _ ...string) (map[string]string, error)
- func (s *SecretProviderMock) Initialize(_ context.Context) bool
- func (s *SecretProviderMock) InsecureSecretsUpdated()
- func (s *SecretProviderMock) SecretsLastUpdated() time.Time
- func (s *SecretProviderMock) StoreSecrets(path string, secrets map[string]string) error
Constants ¶
const EnvSecretStore = "EDGEX_SECURITY_SECRET_STORE"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SecretProvider ¶
type SecretProvider interface { Initialize(_ context.Context) bool StoreSecrets(path string, secrets map[string]string) error GetSecrets(path string, _ ...string) (map[string]string, error) GetDatabaseCredentials(database db.DatabaseInfo) (common.Credentials, error) InsecureSecretsUpdated() SecretsLastUpdated() time.Time }
type SecretProviderImpl ¶ added in v1.3.0
type SecretProviderImpl struct { ExclusiveSecretClient pkg.SecretClient //used to track when secrets have last been retrieved LastUpdated time.Time // contains filtered or unexported fields }
SecretProvider cache storage for the secrets
func NewSecretProvider ¶ added in v1.1.0
func NewSecretProvider(loggingClient logger.LoggingClient, configuration *common.ConfigurationStruct) *SecretProviderImpl
NewSecretProvider returns a new secret provider
func (*SecretProviderImpl) GetDatabaseCredentials ¶ added in v1.3.0
func (s *SecretProviderImpl) GetDatabaseCredentials(database db.DatabaseInfo) (common.Credentials, error)
GetDatabaseCredentials retrieves the login credentials for the database If security is disabled then we use the insecure credentials supplied by the configuration.
func (*SecretProviderImpl) GetSecrets ¶ added in v1.3.0
GetSecrets retrieves secrets from a secret store. path specifies the type or location of the secrets to retrieve. keys specifies the secrets which to retrieve. If no keys are provided then all the keys associated with the specified path will be returned.
func (*SecretProviderImpl) Initialize ¶ added in v1.3.0
func (s *SecretProviderImpl) Initialize(ctx context.Context) bool
Initialize creates SecretClients to be used for obtaining secrets from a secrets store manager.
func (*SecretProviderImpl) InsecureSecretsUpdated ¶ added in v1.3.0
func (s *SecretProviderImpl) InsecureSecretsUpdated()
InsecureSecretsUpdated resets LastUpdate is not running in secure mode.If running in secure mode, changes to InsecureSecrets have no impact and are not used.
func (*SecretProviderImpl) SecretsLastUpdated ¶ added in v1.3.0
func (s *SecretProviderImpl) SecretsLastUpdated() time.Time
func (*SecretProviderImpl) StoreSecrets ¶ added in v1.3.0
func (s *SecretProviderImpl) StoreSecrets(path string, secrets map[string]string) error
StoreSecrets stores the secrets to a secret store. it sets the values requested at provided keys path specifies the type or location of the secrets to store secrets map specifies the "key": "value" pairs of secrets to store
type SecretProviderMock ¶ added in v1.3.0
type SecretProviderMock struct {
// contains filtered or unexported fields
}
func NewSecretProviderMock ¶ added in v1.3.0
func NewSecretProviderMock(config *common.ConfigurationStruct) *SecretProviderMock
NewSecretProviderMock returns a new mock secret provider
func (*SecretProviderMock) GetDatabaseCredentials ¶ added in v1.3.0
func (s *SecretProviderMock) GetDatabaseCredentials(database db.DatabaseInfo) (common.Credentials, error)
GetDatabaseCredentials retrieves the login credentials for the database from mock secret store
func (*SecretProviderMock) GetSecrets ¶ added in v1.3.0
GetSecrets retrieves secrets from a mock secret store.
func (*SecretProviderMock) Initialize ¶ added in v1.3.0
func (s *SecretProviderMock) Initialize(_ context.Context) bool
Initialize does nothing.
func (*SecretProviderMock) InsecureSecretsUpdated ¶ added in v1.3.0
func (s *SecretProviderMock) InsecureSecretsUpdated()
InsecureSecretsUpdated resets LastUpdate is not running in secure mode.If running in secure mode, changes to InsecureSecrets have no impact and are not used.
func (*SecretProviderMock) SecretsLastUpdated ¶ added in v1.3.0
func (s *SecretProviderMock) SecretsLastUpdated() time.Time
SecretsLastUpdated returns the time stamp when the provider secrets cache was latest updated
func (*SecretProviderMock) StoreSecrets ¶ added in v1.3.0
func (s *SecretProviderMock) StoreSecrets(path string, secrets map[string]string) error
StoreSecrets saves secrets to the mock secret store.