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
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 ¶
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 ¶
func NewSecretProvider(loggingClient logger.LoggingClient, configuration *common.ConfigurationStruct) *SecretProviderImpl
NewSecretProvider returns a new secret provider
func (*SecretProviderImpl) GetDatabaseCredentials ¶
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 ¶
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 ¶
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 ¶
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 ¶
func (s *SecretProviderImpl) SecretsLastUpdated() time.Time
func (*SecretProviderImpl) StoreSecrets ¶
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