@kirkelliott/zap 0.1.10 → 0.1.11

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 CHANGED
@@ -219,13 +219,14 @@ program
219
219
  await lambda.send(new client_lambda_1.RemovePermissionCommand({ FunctionName: fn, StatementId: 'public-access' }));
220
220
  }
221
221
  catch { }
222
- for (const sid of ['public-access', 'FunctionURLAllowPublicAccess']) {
222
+ for (const sid of ['public-access', 'public-invoke', 'FunctionURLAllowPublicAccess']) {
223
223
  try {
224
224
  await lambda.send(new client_lambda_1.RemovePermissionCommand({ FunctionName: fn, StatementId: sid }));
225
225
  }
226
226
  catch { }
227
227
  }
228
- await lambda.send(new client_lambda_1.AddPermissionCommand({ FunctionName: fn, StatementId: 'public-access', Action: 'lambda:InvokeFunctionUrl', Principal: '*' }));
228
+ await lambda.send(new client_lambda_1.AddPermissionCommand({ FunctionName: fn, StatementId: 'public-access', Action: 'lambda:InvokeFunctionUrl', Principal: '*', FunctionUrlAuthType: 'NONE' }));
229
+ await lambda.send(new client_lambda_1.AddPermissionCommand({ FunctionName: fn, StatementId: 'public-invoke', Action: 'lambda:InvokeFunction', Principal: '*' }));
229
230
  console.log('✓ permissions repaired');
230
231
  if (cfg.url)
231
232
  console.log(`\n → ${cfg.url.trim()}\n`);
package/dist/init.js CHANGED
@@ -25,7 +25,7 @@ const policy = (bucket) => JSON.stringify({
25
25
  ],
26
26
  });
27
27
  async function allowPublicUrl(lambda, functionArn) {
28
- for (const sid of ['public-access', 'FunctionURLAllowPublicAccess']) {
28
+ for (const sid of ['public-access', 'public-invoke', 'FunctionURLAllowPublicAccess']) {
29
29
  try {
30
30
  await lambda.send(new client_lambda_1.RemovePermissionCommand({ FunctionName: functionArn, StatementId: sid }));
31
31
  }
@@ -36,6 +36,13 @@ async function allowPublicUrl(lambda, functionArn) {
36
36
  StatementId: 'public-access',
37
37
  Action: 'lambda:InvokeFunctionUrl',
38
38
  Principal: '*',
39
+ FunctionUrlAuthType: 'NONE',
40
+ }));
41
+ await lambda.send(new client_lambda_1.AddPermissionCommand({
42
+ FunctionName: functionArn,
43
+ StatementId: 'public-invoke',
44
+ Action: 'lambda:InvokeFunction',
45
+ Principal: '*',
39
46
  }));
40
47
  }
41
48
  function step(label) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kirkelliott/zap",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "Drop a .zap file in S3. It becomes an API endpoint.",
5
5
  "main": "dist/handler.js",
6
6
  "bin": {