@kirkelliott/zap 0.1.9 → 0.1.10
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.
- package/dist/cli.js +7 -1
- package/dist/init.js +5 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -219,7 +219,13 @@ program
|
|
|
219
219
|
await lambda.send(new client_lambda_1.RemovePermissionCommand({ FunctionName: fn, StatementId: 'public-access' }));
|
|
220
220
|
}
|
|
221
221
|
catch { }
|
|
222
|
-
|
|
222
|
+
for (const sid of ['public-access', 'FunctionURLAllowPublicAccess']) {
|
|
223
|
+
try {
|
|
224
|
+
await lambda.send(new client_lambda_1.RemovePermissionCommand({ FunctionName: fn, StatementId: sid }));
|
|
225
|
+
}
|
|
226
|
+
catch { }
|
|
227
|
+
}
|
|
228
|
+
await lambda.send(new client_lambda_1.AddPermissionCommand({ FunctionName: fn, StatementId: 'public-access', Action: 'lambda:InvokeFunctionUrl', Principal: '*' }));
|
|
223
229
|
console.log('✓ permissions repaired');
|
|
224
230
|
if (cfg.url)
|
|
225
231
|
console.log(`\n → ${cfg.url.trim()}\n`);
|
package/dist/init.js
CHANGED
|
@@ -25,16 +25,17 @@ const policy = (bucket) => JSON.stringify({
|
|
|
25
25
|
],
|
|
26
26
|
});
|
|
27
27
|
async function allowPublicUrl(lambda, functionArn) {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
for (const sid of ['public-access', 'FunctionURLAllowPublicAccess']) {
|
|
29
|
+
try {
|
|
30
|
+
await lambda.send(new client_lambda_1.RemovePermissionCommand({ FunctionName: functionArn, StatementId: sid }));
|
|
31
|
+
}
|
|
32
|
+
catch { }
|
|
30
33
|
}
|
|
31
|
-
catch { }
|
|
32
34
|
await lambda.send(new client_lambda_1.AddPermissionCommand({
|
|
33
35
|
FunctionName: functionArn,
|
|
34
36
|
StatementId: 'public-access',
|
|
35
37
|
Action: 'lambda:InvokeFunctionUrl',
|
|
36
38
|
Principal: '*',
|
|
37
|
-
FunctionUrlAuthType: 'NONE',
|
|
38
39
|
}));
|
|
39
40
|
}
|
|
40
41
|
function step(label) {
|