Documentation ¶
Index ¶
- Constants
- func IsSecurityEnabled() bool
- type InsecureProvider
- type SecureProvider
- func (p *SecureProvider) DefaultTokenExpiredCallback(expiredToken string) (replacementToken string, retry bool)
- func (p *SecureProvider) GetSecrets(path string, keys ...string) (map[string]string, error)
- func (p *SecureProvider) SecretsLastUpdated() time.Time
- func (p *SecureProvider) SecretsUpdated()
- func (p *SecureProvider) SetClient(client secrets.SecretClient)
- func (p *SecureProvider) StoreSecrets(path string, secrets map[string]string) error
Constants ¶
const ( EnvSecretStore = "EDGEX_SECURITY_SECRET_STORE" UsernameKey = "username" PasswordKey = "password" )
Variables ¶
This section is empty.
Functions ¶
func IsSecurityEnabled ¶
func IsSecurityEnabled() bool
IsSecurityEnabled determines if security has been enabled.
Types ¶
type InsecureProvider ¶
type InsecureProvider struct {
// contains filtered or unexported fields
}
InsecureProvider implements the SecretProvider interface for insecure secrets
func NewInsecureProvider ¶
func NewInsecureProvider(config interfaces.Configuration, lc logger.LoggingClient) *InsecureProvider
NewInsecureProvider creates, initializes Provider for insecure secrets.
func (*InsecureProvider) GetSecrets ¶
GetSecrets retrieves secrets from a Insecure Secrets 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 (*InsecureProvider) SecretsLastUpdated ¶
func (p *InsecureProvider) SecretsLastUpdated() time.Time
SecretsLastUpdated returns the last time insecure secrets were updated
func (*InsecureProvider) SecretsUpdated ¶
func (p *InsecureProvider) SecretsUpdated()
SecretsUpdated resets LastUpdate time for the Insecure Secrets.
func (*InsecureProvider) StoreSecrets ¶
func (p *InsecureProvider) StoreSecrets(_ string, _ map[string]string) error
StoreSecrets stores the secrets, but is not supported for Insecure Secrets
type SecureProvider ¶
type SecureProvider struct {
// contains filtered or unexported fields
}
SecureProvider implements the SecretProvider interface
func NewSecureProvider ¶
func NewSecureProvider(config interfaces.Configuration, lc logger.LoggingClient, loader authtokenloader.AuthTokenLoader) *SecureProvider
NewSecureProvider creates & initializes Provider instance for secure secrets.
func (*SecureProvider) DefaultTokenExpiredCallback ¶
func (p *SecureProvider) DefaultTokenExpiredCallback(expiredToken string) (replacementToken string, retry bool)
defaultTokenExpiredCallback is the default implementation of tokenExpiredCallback function It utilizes the tokenFile to re-read the token and enable retry if any update from the expired token
func (*SecureProvider) 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 (*SecureProvider) SecretsLastUpdated ¶
func (p *SecureProvider) SecretsLastUpdated() time.Time
SecretsLastUpdated returns the last time secure secrets were updated
func (*SecureProvider) SecretsUpdated ¶
func (p *SecureProvider) SecretsUpdated()
SecretsUpdated is not need for secure secrets as this is handled when secrets are stored.
func (*SecureProvider) SetClient ¶
func (p *SecureProvider) SetClient(client secrets.SecretClient)
SetClient sets the secret client that is used to access the secure secrets
func (*SecureProvider) StoreSecrets ¶
func (p *SecureProvider) 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