fix: replace all dot chars during normalization (#580)

* fix: replace all dot chars during normalization

* changelog
This commit is contained in:
John-Michael Faircloth 2025-05-14 09:32:58 -05:00 committed by GitHub
parent 4d5899dd0e
commit b022ecdb0c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 26 additions and 2 deletions

View file

@ -39,6 +39,14 @@ describe('integration', () => {
body: `{"data":{"secret.foo":"SUPERSECRET"}}`
});
await got(`${vaultUrl}/v1/secret/data/test-with-multi-dot-chars`, {
method: 'POST',
headers: {
'X-Vault-Token': vaultToken,
},
body: `{"data":{"secret.foo.bar":"SUPERSECRET"}}`
});
await got(`${vaultUrl}/v1/secret/data/nested/test`, {
method: 'POST',
headers: {
@ -293,6 +301,16 @@ describe('integration', () => {
expect(core.exportVariable).toBeCalledWith('SECRET__FOO', 'SUPERSECRET');
});
it('get secrets with multiple dot chars', async () => {
mockInput(`secret/data/test-with-multi-dot-chars * ;`);
await exportSecrets();
expect(core.exportVariable).toBeCalledTimes(1);
expect(core.exportVariable).toBeCalledWith('SECRET__FOO__BAR', 'SUPERSECRET');
});
it('get wildcard secrets', async () => {
mockInput(`secret/data/test * ;`);