@wavo-cloud/aws-secrets-manager-helper 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -268,7 +268,6 @@ async function createClient({
|
|
|
268
268
|
region,
|
|
269
269
|
keyValuePairs,
|
|
270
270
|
clientIdsSecretIdOverride = null,
|
|
271
|
-
isSelfServe = false,
|
|
272
271
|
isActiveOrganization = false,
|
|
273
272
|
}) {
|
|
274
273
|
if (!clientId || !clientName || !organization || !region)
|
|
@@ -287,7 +286,9 @@ async function createClient({
|
|
|
287
286
|
throw new Error('A client with this ID already exists.')
|
|
288
287
|
// create client secret
|
|
289
288
|
const createSecretResults = await createSecret(
|
|
290
|
-
`${organization}
|
|
289
|
+
`${organization}${
|
|
290
|
+
process.env.NODE_ENV !== 'production' ? `_${process.env.NODE_ENV}` : ''
|
|
291
|
+
}/ad_platforms/api`,
|
|
291
292
|
`${clientName} Ad Platform API Keys`,
|
|
292
293
|
JSON.stringify({
|
|
293
294
|
client_name: clientName,
|
|
@@ -298,7 +299,7 @@ async function createClient({
|
|
|
298
299
|
[
|
|
299
300
|
{
|
|
300
301
|
Key: 'self_serve',
|
|
301
|
-
Value:
|
|
302
|
+
Value: 'true',
|
|
302
303
|
},
|
|
303
304
|
{
|
|
304
305
|
Key: 'is_active_organization',
|
|
@@ -310,7 +311,9 @@ async function createClient({
|
|
|
310
311
|
const editClientListResults = await editSecret(
|
|
311
312
|
clientIdsSecretIdOverride || clientIdsSecretId,
|
|
312
313
|
JSON.stringify({
|
|
313
|
-
[clientId]: `${organization}
|
|
314
|
+
[clientId]: `${organization}${
|
|
315
|
+
process.env.NODE_ENV !== 'production' ? `_${process.env.NODE_ENV}` : ''
|
|
316
|
+
}/ad_platforms/api`,
|
|
314
317
|
...currentClientList,
|
|
315
318
|
})
|
|
316
319
|
)
|
package/package.json
CHANGED
package/test/aws.test.js
CHANGED
|
@@ -60,10 +60,10 @@ describe('Test Secrets Manager Helper', async () => {
|
|
|
60
60
|
isActiveOrganization: true,
|
|
61
61
|
})
|
|
62
62
|
expect(createClientResult.createSecretResults.Name).to.equal(
|
|
63
|
-
`${organization}/ad_platforms/api`
|
|
63
|
+
`${organization}_test/ad_platforms/api`
|
|
64
64
|
)
|
|
65
65
|
|
|
66
|
-
const newClientTags = await getSecretTags(`${organization}/ad_platforms/api`)
|
|
66
|
+
const newClientTags = await getSecretTags(`${organization}_test/ad_platforms/api`)
|
|
67
67
|
const isActiveOrganizationTag = newClientTags.find(
|
|
68
68
|
tag => tag.Key === 'is_active_organization'
|
|
69
69
|
)
|
|
@@ -71,7 +71,7 @@ describe('Test Secrets Manager Helper', async () => {
|
|
|
71
71
|
|
|
72
72
|
const clientList = await getClientSecretIds(clientIdsSecretId)
|
|
73
73
|
expect(clientList[clientId]).to.equal(
|
|
74
|
-
`${organization}/ad_platforms/api`
|
|
74
|
+
`${organization}_test/ad_platforms/api`
|
|
75
75
|
)
|
|
76
76
|
await sleep(2000)
|
|
77
77
|
}).timeout(4000)
|
|
@@ -83,7 +83,7 @@ describe('Test Secrets Manager Helper', async () => {
|
|
|
83
83
|
clientIdsSecretIdOverride: clientIdsSecretId,
|
|
84
84
|
})
|
|
85
85
|
|
|
86
|
-
const clientTags = await getSecretTags(`${organization}/ad_platforms/api`)
|
|
86
|
+
const clientTags = await getSecretTags(`${organization}_test/ad_platforms/api`)
|
|
87
87
|
const isActiveOrganizationTag = clientTags.find(
|
|
88
88
|
tag => tag.Key === 'is_active_organization'
|
|
89
89
|
)
|
|
@@ -103,7 +103,7 @@ describe('Test Secrets Manager Helper', async () => {
|
|
|
103
103
|
})
|
|
104
104
|
|
|
105
105
|
const testSecret = await getSecretValue(
|
|
106
|
-
`${organization}/ad_platforms/api`
|
|
106
|
+
`${organization}_test/ad_platforms/api`
|
|
107
107
|
)
|
|
108
108
|
expect(testSecret.client_name).to.equal('test_client_name_2')
|
|
109
109
|
expect(testSecret.organization).to.equal(organization)
|
|
@@ -127,7 +127,7 @@ describe('Test Secrets Manager Helper', async () => {
|
|
|
127
127
|
})
|
|
128
128
|
|
|
129
129
|
const testSecret = await getSecretValue(
|
|
130
|
-
`${organization}/ad_platforms/api`
|
|
130
|
+
`${organization}_test/ad_platforms/api`
|
|
131
131
|
)
|
|
132
132
|
|
|
133
133
|
expect(testSecret.client_name).to.equal('test_client_name_2')
|
|
@@ -152,9 +152,9 @@ describe('Test Secrets Manager Helper', async () => {
|
|
|
152
152
|
|
|
153
153
|
try {
|
|
154
154
|
await getSecretValue(
|
|
155
|
-
`${organization}/ad_platforms/api`
|
|
155
|
+
`${organization}_test/ad_platforms/api`
|
|
156
156
|
)
|
|
157
|
-
expect.fail(`'${organization}/ad_platforms/api' should not be a valid secret value`)
|
|
157
|
+
expect.fail(`'${organization}_test/ad_platforms/api' should not be a valid secret value`)
|
|
158
158
|
} catch (error) {
|
|
159
159
|
expect(clientList[clientId]).to.equal(undefined)
|
|
160
160
|
}
|