Prechádzať zdrojové kódy

fix: keepersecurity support for shortcuts (#5245)

Signed-off-by: Pedro Parra Ortega <pedro.parraortega@enreach.com>
pepodev 7 mesiacov pred
rodič
commit
7a3f299a62

+ 0 - 3
pkg/provider/keepersecurity/client.go

@@ -315,9 +315,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
 }

+ 2 - 1
pkg/provider/keepersecurity/client_test.go

@@ -324,7 +324,8 @@ func TestClientGetSecret(t *testing.T) {
 					Key: record0,
 				},
 			},
-			wantErr: true,
+			want:    []byte(outputRecord0),
+			wantErr: false,
 		},
 		{
 			name: "Get non existing secret",

+ 0 - 1
pkg/provider/keepersecurity/provider.go

@@ -35,7 +35,6 @@ const (
 	errKeeperSecurityNilSpec                       = "nil spec"
 	errKeeperSecurityNilSpecProvider               = "nil spec.provider"
 	errKeeperSecurityNilSpecProviderKeeperSecurity = "nil spec.provider.keepersecurity"
-	errKeeperSecurityStoreMissingAuth              = "missing: spec.provider.keepersecurity.auth"
 	errKeeperSecurityStoreMissingFolderID          = "missing: spec.provider.keepersecurity.folderID"
 )