Skip to content

Commit

Permalink
fix: add in decryption and encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
willfarrell committed Jan 3, 2025
1 parent b629474 commit 51ef02c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/parameters-secrets-extension/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const types = {
response: (res) => jsonSafeParse(res.Parameter?.Value)
},
secretsmanager: {
path: '/secretsmanager/get?secretId=',
path: '/secretsmanager/get?withDecryption=true&secretId=',
response: (res) => jsonSafeParse(res.SecretString)
}
}
Expand All @@ -41,9 +41,12 @@ const parametersSecretsLambdaExtensionMiddleware = (opts = {}) => {
for (const internalKey of Object.keys(options.fetchData)) {
if (cachedValues[internalKey]) continue

values[internalKey] = fetch(url + options.fetchData[internalKey], {
headers
})
values[internalKey] = fetch(
url + encodeURI(options.fetchData[internalKey]),
{
headers
}
)
.then((res) => res.json())
.then((res) => types[options.type].response(res))
.catch((e) => {
Expand Down

0 comments on commit 51ef02c

Please sign in to comment.