Browse Source

fix: keepersecurity support for shortcuts (#4825)

Signed-off-by: Pedro Parra Ortega <pedro.parraortega@enreach.com>
Co-authored-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Pedro Parra Ortega 10 months ago
parent
commit
d6ecbf4db8
1 changed files with 1 additions and 8 deletions
  1. 1 8
      pkg/provider/keepersecurity/client.go

+ 1 - 8
pkg/provider/keepersecurity/client.go

@@ -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 {