Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c7f6258
Add support for multiple keys per secret
passuied Mar 19, 2025
b5e8867
Advertise feature if metadata property is set to tru
passuied Mar 19, 2025
aa86c43
Add BulkGetSecret tests
passuied Mar 19, 2025
852e675
Merge branch 'main' into feature/aws-secret-supports-multiple-keys
passuied Mar 21, 2025
fac1772
format
passuied Mar 24, 2025
04d68d8
Rename metadata to match feature name
passuied Apr 1, 2025
0110e96
Merge branch 'main' into feature/aws-secret-supports-multiple-keys
cicoyle Apr 1, 2025
adcb27f
fixed missed ref in rename
passuied Apr 2, 2025
c1dfc8d
Merge branch 'main' into feature/aws-secret-supports-multiple-keys
cicoyle Apr 14, 2025
a0d9c2f
fixed cases where the stored values are nested json.
passuied Apr 22, 2025
07a0095
linting error
passuied Apr 22, 2025
c694d58
Add'l test case per PR feedback
passuied Apr 23, 2025
e0d864c
Merge branch 'main' into feature/aws-secret-supports-multiple-keys
cicoyle Jun 24, 2025
3eb02fb
addressing linting errors
passuied Jun 24, 2025
40e099f
PR feedback
passuied Jun 24, 2025
b5f26b1
PR feedback #2
passuied Jun 24, 2025
3b600b7
Merge branch 'main' into feature/aws-secret-supports-multiple-keys
passuied Jun 25, 2025
410a23a
Merge branch 'main' into feature/aws-secret-supports-multiple-keys
cicoyle Jun 26, 2025
c14b496
Merge branch 'main' into feature/aws-secret-supports-multiple-keys
cicoyle Jun 27, 2025
31dcb78
Merge branch 'main' into feature/aws-secret-supports-multiple-keys
passuied Jul 10, 2025
d203976
Merge branch 'main' into feature/aws-secret-supports-multiple-keys
passuied Jul 16, 2025
0cecf35
Merge branch 'main' into feature/aws-secret-supports-multiple-keys
passuied Jul 25, 2025
ccb79d9
Merge branch 'main' into feature/aws-secret-supports-multiple-keys
yaron2 Aug 21, 2025
93775dd
Merge branch 'main' into feature/aws-secret-supports-multiple-keys
passuied Aug 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add'l test case per PR feedback
Signed-off-by: Patrick Assuied <[email protected]>
  • Loading branch information
passuied committed Apr 23, 2025
commit c694d58394e986feca0ab7859744255df52bb084
38 changes: 38 additions & 0 deletions secretstores/aws/secretmanager/secretmanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,44 @@ func TestGetSecret(t *testing.T) {
assert.Len(t, output.Data, 1)
assert.Equal(t, "not json", output.Data["/aws/secret/testing"])
})

t.Run("with multiple keys per secret and secret is json collection", func(t *testing.T) {
mockSSM := &awsAuth.MockSecretManager{
GetSecretValueFn: func(ctx context.Context, input *secretsmanager.GetSecretValueInput, option ...request.Option) (*secretsmanager.GetSecretValueOutput, error) {
assert.Nil(t, input.VersionId)
assert.Nil(t, input.VersionStage)
secret := `[{"key1":"value1"},{"key2":"value2"}]`

return &secretsmanager.GetSecretValueOutput{
Name: input.SecretId,
SecretString: &secret,
}, nil
},
}

secret := awsAuth.SecretManagerClients{
Manager: mockSSM,
}

mockedClients := awsAuth.Clients{
Secret: &secret,
}
mockAuthProvider := &awsAuth.StaticAuth{}
mockAuthProvider.WithMockClients(&mockedClients)
s := smSecretStore{
authProvider: mockAuthProvider,
multipleKeyValuesPerSecret: true,
}

req := secretstores.GetSecretRequest{
Name: "/aws/secret/testing",
Metadata: map[string]string{},
}
output, e := s.GetSecret(t.Context(), req)
require.NoError(t, e)
assert.Len(t, output.Data, 1)
assert.JSONEq(t, `[{"key1":"value1"},{"key2":"value2"}]`, output.Data["/aws/secret/testing"])
})
})

t.Run("unsuccessfully retrieve secret", func(t *testing.T) {
Expand Down