|
|
@@ -32,7 +32,6 @@ import (
|
|
|
const (
|
|
|
errKeeperSecuritySecretsNotFound = "unable to find secrets. %w"
|
|
|
errKeeperSecuritySecretNotFound = "unable to find secret %s. Error: %w"
|
|
|
- errKeeperSecuritySecretNotUnique = "more than 1 secret %s found"
|
|
|
errKeeperSecurityNoSecretsFound = "no secrets found"
|
|
|
errKeeperSecurityInvalidSecretInvalidFormat = "invalid secret. Invalid format: %w"
|
|
|
errKeeperSecurityInvalidSecretDuplicatedKey = "invalid Secret. Following keys are duplicated %s"
|
|
|
@@ -315,9 +314,6 @@ func (c *Client) findSecretByID(id string) (*ksm.Record, error) {
|
|
|
if len(records) == 0 {
|
|
|
return nil, errors.New(errKeeperSecurityNoSecretsFound)
|
|
|
}
|
|
|
- if len(records) > 1 {
|
|
|
- return nil, fmt.Errorf(errKeeperSecuritySecretNotUnique, id)
|
|
|
- }
|
|
|
|
|
|
return records[0], nil
|
|
|
}
|
|
|
@@ -343,12 +339,9 @@ func (c *Client) findSecretByName(name string) (*ksm.Record, error) {
|
|
|
// DeleteSecret will consider record already deleted (no error)
|
|
|
if len(records) == 0 {
|
|
|
return nil, nil
|
|
|
- } else if len(records) == 1 {
|
|
|
- return records[0], nil
|
|
|
}
|
|
|
|
|
|
- // len(records) > 1
|
|
|
- return nil, fmt.Errorf(errKeeperSecuritySecretNotUnique, name)
|
|
|
+ return records[0], nil
|
|
|
}
|
|
|
|
|
|
func (s *Secret) validate() error {
|