@kensio/yulin 1.14.1 → 1.14.2
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/service/cloudfront/origin/custom/sim-cf-function-url-origin-fragments.d.ts +15 -9
- package/dist/service/cloudfront/origin/custom/sim-cf-function-url-origin-fragments.d.ts.map +1 -1
- package/dist/service/cloudfront/origin/custom/sim-cf-function-url-origin-fragments.js +24 -13
- package/dist/service/cloudfront/origin/custom/sim-cf-function-url-origin-fragments.js.map +1 -1
- package/dist/service/cloudfront/origin/custom/sim-cf-function-url-origin-template.factory.d.ts.map +1 -1
- package/dist/service/cloudfront/origin/custom/sim-cf-function-url-origin-template.factory.js +1 -0
- package/dist/service/cloudfront/origin/custom/sim-cf-function-url-origin-template.factory.js.map +1 -1
- package/dist/service/lambda/serve/auth/sim-lambda-url-authorizer.d.ts +14 -11
- package/dist/service/lambda/serve/auth/sim-lambda-url-authorizer.d.ts.map +1 -1
- package/dist/service/lambda/serve/auth/sim-lambda-url-authorizer.js +29 -12
- package/dist/service/lambda/serve/auth/sim-lambda-url-authorizer.js.map +1 -1
- package/dist/service/lambda/serve/auth/sim-lambda-url-invoke-actions.d.ts +34 -0
- package/dist/service/lambda/serve/auth/sim-lambda-url-invoke-actions.d.ts.map +1 -0
- package/dist/service/lambda/serve/auth/sim-lambda-url-invoke-actions.js +63 -0
- package/dist/service/lambda/serve/auth/sim-lambda-url-invoke-actions.js.map +1 -0
- package/dist/service/lambda/serve/response/sim-lambda-url-error-response.d.ts +9 -1
- package/dist/service/lambda/serve/response/sim-lambda-url-error-response.d.ts.map +1 -1
- package/dist/service/lambda/serve/response/sim-lambda-url-error-response.js +11 -2
- package/dist/service/lambda/serve/response/sim-lambda-url-error-response.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { SimCfnTemplateValue, SimCfnTemplateValueRecord } from "../../../cloudformation/template/value/sim-cfn-template-value.js";
|
|
2
2
|
/**
|
|
3
|
-
* What a test asks for when it wants
|
|
4
|
-
* `origins.FunctionUrlOrigin.withOriginAccessControl()
|
|
3
|
+
* What a test asks for when it wants a working version of the template
|
|
4
|
+
* `origins.FunctionUrlOrigin.withOriginAccessControl()` synthesizes.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* Six Resources stand between a test and a Function URL served through a
|
|
7
7
|
* Distribution, and each test about that shape is about one of them being
|
|
8
8
|
* wrong, so each field here is one thing a template can get wrong on its own.
|
|
9
9
|
*/
|
|
@@ -16,20 +16,26 @@ export interface SimCfFunctionUrlOriginTemplateInput {
|
|
|
16
16
|
*/
|
|
17
17
|
readonly originAccessControl: boolean;
|
|
18
18
|
/**
|
|
19
|
-
* Whether the template grants CloudFront the Function URL
|
|
20
|
-
* does alongside the Distribution.
|
|
19
|
+
* Whether the template grants CloudFront the Function URL at all.
|
|
21
20
|
*/
|
|
22
21
|
readonly permitted: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* The actions the grant covers.
|
|
24
|
+
*
|
|
25
|
+
* Reaching a Function URL through an origin access control takes both of
|
|
26
|
+
* them, so a template granting one is one that deploys and then answers 403.
|
|
27
|
+
*/
|
|
28
|
+
readonly permittedActions: readonly string[];
|
|
23
29
|
/** The Distribution the permission is granted for. */
|
|
24
30
|
readonly permissionSourceArn: SimCfnTemplateValue;
|
|
25
31
|
}
|
|
26
32
|
/**
|
|
27
33
|
* The parts of the template a template can leave out.
|
|
28
34
|
*
|
|
29
|
-
* Each is a Resource, or a property of one, that
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
35
|
+
* Each is a Resource, or a property of one, that a template can forget. The
|
|
36
|
+
* origin access control contributes two, which are both there or both absent,
|
|
37
|
+
* since an Origin naming one nothing created would be refused rather than
|
|
38
|
+
* reached. The permission contributes one Resource per action it grants.
|
|
33
39
|
*/
|
|
34
40
|
export interface SimCfFunctionUrlOriginParts {
|
|
35
41
|
readonly originAccessControl: SimCfnTemplateValueRecord;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cf-function-url-origin-fragments.d.ts","sourceRoot":"","sources":["../../../../../src/service/cloudfront/origin/custom/sim-cf-function-url-origin-fragments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,kEAAkE,CAAC;AAE1E;;;;;;;GAOG;AACH,MAAM,WAAW,mCAAmC;IAClD,gFAAgF;IAChF,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,mBAAmB,EAAE,OAAO,CAAC;IACtC
|
|
1
|
+
{"version":3,"file":"sim-cf-function-url-origin-fragments.d.ts","sourceRoot":"","sources":["../../../../../src/service/cloudfront/origin/custom/sim-cf-function-url-origin-fragments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,kEAAkE,CAAC;AAE1E;;;;;;;GAOG;AACH,MAAM,WAAW,mCAAmC;IAClD,gFAAgF;IAChF,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,mBAAmB,EAAE,OAAO,CAAC;IACtC;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B;;;;;OAKG;IACH,QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7C,sDAAsD;IACtD,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;CACnD;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,mBAAmB,EAAE,yBAAyB,CAAC;IACxD,QAAQ,CAAC,qBAAqB,EAAE,yBAAyB,CAAC;IAC1D,QAAQ,CAAC,gBAAgB,EAAE,yBAAyB,CAAC;CACtD;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,mCAAmC,GACzC,2BAA2B,CAsB7B"}
|
|
@@ -19,21 +19,32 @@ export function simCfFunctionUrlOriginParts(input) {
|
|
|
19
19
|
originAccessControlId: included(input.originAccessControl, {
|
|
20
20
|
OriginAccessControlId: { Ref: "SiteOac" },
|
|
21
21
|
}),
|
|
22
|
-
// The
|
|
23
|
-
//
|
|
24
|
-
invokePermission: included(input.permitted,
|
|
25
|
-
InvokeFromCloudFront: {
|
|
26
|
-
Type: "AWS::Lambda::Permission",
|
|
27
|
-
Properties: {
|
|
28
|
-
FunctionName: { "Fn::GetAtt": ["GreeterFunction", "Arn"] },
|
|
29
|
-
Action: "lambda:InvokeFunctionUrl",
|
|
30
|
-
Principal: "cloudfront.amazonaws.com",
|
|
31
|
-
SourceArn: input.permissionSourceArn,
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
}),
|
|
22
|
+
// The permissions letting CloudFront invoke the Function URL for this
|
|
23
|
+
// Distribution alone. AWS takes one per action, and both of them.
|
|
24
|
+
invokePermission: included(input.permitted, invokePermissions(input)),
|
|
35
25
|
};
|
|
36
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* One `AWS::Lambda::Permission` per granted action.
|
|
29
|
+
*
|
|
30
|
+
* The statement id is derived from the action, so a template granting both
|
|
31
|
+
* carries two Resources rather than one overwriting the other, which is how
|
|
32
|
+
* the two `aws lambda add-permission` calls in the AWS documentation land.
|
|
33
|
+
*/
|
|
34
|
+
function invokePermissions(input) {
|
|
35
|
+
return Object.fromEntries(input.permittedActions.map((action) => [
|
|
36
|
+
`${action.replace("lambda:", "")}FromCloudFront`,
|
|
37
|
+
{
|
|
38
|
+
Type: "AWS::Lambda::Permission",
|
|
39
|
+
Properties: {
|
|
40
|
+
FunctionName: { "Fn::GetAtt": ["GreeterFunction", "Arn"] },
|
|
41
|
+
Action: action,
|
|
42
|
+
Principal: "cloudfront.amazonaws.com",
|
|
43
|
+
SourceArn: input.permissionSourceArn,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
]));
|
|
47
|
+
}
|
|
37
48
|
/**
|
|
38
49
|
* One fragment of the template, or nothing where the template omits it.
|
|
39
50
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cf-function-url-origin-fragments.js","sourceRoot":"","sources":["../../../../../src/service/cloudfront/origin/custom/sim-cf-function-url-origin-fragments.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sim-cf-function-url-origin-fragments.js","sourceRoot":"","sources":["../../../../../src/service/cloudfront/origin/custom/sim-cf-function-url-origin-fragments.ts"],"names":[],"mappings":"AAkDA;;GAEG;AACH,MAAM,UAAU,2BAA2B,CACzC,KAA0C;IAE1C,OAAO;QACL,mBAAmB,EAAE,QAAQ,CAAC,KAAK,CAAC,mBAAmB,EAAE;YACvD,OAAO,EAAE;gBACP,IAAI,EAAE,sCAAsC;gBAC5C,UAAU,EAAE;oBACV,yBAAyB,EAAE;wBACzB,IAAI,EAAE,UAAU;wBAChB,6BAA6B,EAAE,QAAQ;wBACvC,eAAe,EAAE,KAAK,CAAC,eAAe;wBACtC,eAAe,EAAE,OAAO;qBACzB;iBACF;aACF;SACF,CAAC;QACF,qBAAqB,EAAE,QAAQ,CAAC,KAAK,CAAC,mBAAmB,EAAE;YACzD,qBAAqB,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE;SAC1C,CAAC;QACF,sEAAsE;QACtE,kEAAkE;QAClE,gBAAgB,EAAE,QAAQ,CAAC,KAAK,CAAC,SAAS,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC;KACtE,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,SAAS,iBAAiB,CACxB,KAA0C;IAE1C,OAAO,MAAM,CAAC,WAAW,CACvB,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;QACrC,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,gBAAgB;QAChD;YACE,IAAI,EAAE,yBAAyB;YAC/B,UAAU,EAAE;gBACV,YAAY,EAAE,EAAE,YAAY,EAAE,CAAC,iBAAiB,EAAE,KAAK,CAAC,EAAE;gBAC1D,MAAM,EAAE,MAAM;gBACd,SAAS,EAAE,0BAA0B;gBACrC,SAAS,EAAE,KAAK,CAAC,mBAAmB;aACrC;SACF;KACF,CAAC,CACH,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,QAAQ,CACf,OAAgB,EAChB,QAAmC;IAEnC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/service/cloudfront/origin/custom/sim-cf-function-url-origin-template.factory.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cf-function-url-origin-template.factory.d.ts","sourceRoot":"","sources":["../../../../../src/service/cloudfront/origin/custom/sim-cf-function-url-origin-template.factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sDAAsD,CAAC;AAClG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kEAAkE,CAAC;AAC5G,OAAO,EACL,KAAK,mCAAmC,EAEzC,MAAM,2CAA2C,CAAC;AAanD;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,mBAUlC,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,qCAAqC,
|
|
1
|
+
{"version":3,"file":"sim-cf-function-url-origin-template.factory.d.ts","sourceRoot":"","sources":["../../../../../src/service/cloudfront/origin/custom/sim-cf-function-url-origin-template.factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sDAAsD,CAAC;AAClG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kEAAkE,CAAC;AAC5G,OAAO,EACL,KAAK,mCAAmC,EAEzC,MAAM,2CAA2C,CAAC;AAanD;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,mBAUlC,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,qCAAqC,sFAmFjD,CAAC"}
|
package/dist/service/cloudfront/origin/custom/sim-cf-function-url-origin-template.factory.js
CHANGED
|
@@ -43,6 +43,7 @@ export const simCfFunctionUrlOriginTemplateFactory = new MappedFactory(() => ({
|
|
|
43
43
|
signingBehavior: "always",
|
|
44
44
|
originAccessControl: true,
|
|
45
45
|
permitted: true,
|
|
46
|
+
permittedActions: ["lambda:InvokeFunctionUrl", "lambda:InvokeFunction"],
|
|
46
47
|
permissionSourceArn: simCfDistributionArn,
|
|
47
48
|
}), (input) => ({
|
|
48
49
|
Resources: {
|
package/dist/service/cloudfront/origin/custom/sim-cf-function-url-origin-template.factory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cf-function-url-origin-template.factory.js","sourceRoot":"","sources":["../../../../../src/service/cloudfront/origin/custom/sim-cf-function-url-origin-template.factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAIrD,OAAO,EAEL,2BAA2B,GAC5B,MAAM,2CAA2C,CAAC;AAEnD,MAAM,wBAAwB,GAAG;IAC/B,OAAO,EAAE,YAAY;IACrB,SAAS,EAAE;QACT;YACE,MAAM,EAAE,OAAO;YACf,SAAS,EAAE,EAAE,OAAO,EAAE,sBAAsB,EAAE;YAC9C,MAAM,EAAE,gBAAgB;SACzB;KACF;CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAwB;IACvD,UAAU,EAAE;QACV,EAAE;QACF;YACE,sBAAsB;YACtB,EAAE,GAAG,EAAE,gBAAgB,EAAE;YACzB,gBAAgB;YAChB,EAAE,GAAG,EAAE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ACX,GAAG;4CACH,EAAE,YAAY,EAAE,CAAC,YAAY,EAAE,aAAa,CAAC,EAAE;yCAChD;qCACF;iCACF;6BACF;4BACD,kBAAkB,EAAE,EAAE,oBAAoB,EAAE,YAAY,EAAE;4BAC1D,GAAG,2BAA2B,CAAC,KAAK,CAAC,CAAC,qBAAqB;yBAC5D;qBACF;oBACD,oBAAoB,EAAE;wBACpB,cAAc,EAAE,mBAAmB;wBACnC,oBAAoB,EAAE,mBAAmB;qBAC1C;iBACF;aACF;SACF;QACD,GAAG,2BAA2B,CAAC,KAAK,CAAC,CAAC,gBAAgB;KACvD;IACD,OAAO,EAAE;QACP,sBAAsB,EAAE;YACtB,KAAK,EAAE,EAAE,YAAY,EAAE,CAAC,kBAAkB,EAAE,YAAY,CAAC,EAAE;SAC5D;QACD,eAAe,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE;KACjD;CACF,CAAC,CACH,CAAC"}
|
|
1
|
+
{"version":3,"file":"sim-cf-function-url-origin-template.factory.js","sourceRoot":"","sources":["../../../../../src/service/cloudfront/origin/custom/sim-cf-function-url-origin-template.factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAIrD,OAAO,EAEL,2BAA2B,GAC5B,MAAM,2CAA2C,CAAC;AAEnD,MAAM,wBAAwB,GAAG;IAC/B,OAAO,EAAE,YAAY;IACrB,SAAS,EAAE;QACT;YACE,MAAM,EAAE,OAAO;YACf,SAAS,EAAE,EAAE,OAAO,EAAE,sBAAsB,EAAE;YAC9C,MAAM,EAAE,gBAAgB;SACzB;KACF;CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAwB;IACvD,UAAU,EAAE;QACV,EAAE;QACF;YACE,sBAAsB;YACtB,EAAE,GAAG,EAAE,gBAAgB,EAAE;YACzB,gBAAgB;YAChB,EAAE,GAAG,EAAE,kBAAkB,EAAE;SAC5B;KACF;CACF,CAAC;AAEF;;;;;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AE;4CACX,GAAG;4CACH,EAAE,YAAY,EAAE,CAAC,YAAY,EAAE,aAAa,CAAC,EAAE;yCAChD;qCACF;iCACF;6BACF;4BACD,kBAAkB,EAAE,EAAE,oBAAoB,EAAE,YAAY,EAAE;4BAC1D,GAAG,2BAA2B,CAAC,KAAK,CAAC,CAAC,qBAAqB;yBAC5D;qBACF;oBACD,oBAAoB,EAAE;wBACpB,cAAc,EAAE,mBAAmB;wBACnC,oBAAoB,EAAE,mBAAmB;qBAC1C;iBACF;aACF;SACF;QACD,GAAG,2BAA2B,CAAC,KAAK,CAAC,CAAC,gBAAgB;KACvD;IACD,OAAO,EAAE;QACP,sBAAsB,EAAE;YACtB,KAAK,EAAE,EAAE,YAAY,EAAE,CAAC,kBAAkB,EAAE,YAAY,CAAC,EAAE;SAC5D;QACD,eAAe,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE;KACjD;CACF,CAAC,CACH,CAAC"}
|
|
@@ -3,15 +3,6 @@ import type { SimIamAuthorizationDecision, SimIamInterServiceAuthZ } from "../..
|
|
|
3
3
|
import type { SimAwsRequestSource } from "../../../iam/request/sim-aws-request-source.js";
|
|
4
4
|
import type { SimLambdaFunction } from "../../function/sim-lambda-function.js";
|
|
5
5
|
import type { SimLambdaFunctionUrl } from "../../function/url/sim-lambda-function-url.js";
|
|
6
|
-
/**
|
|
7
|
-
* The IAM action a Function URL invocation is authorized against.
|
|
8
|
-
*
|
|
9
|
-
* This is deliberately not `lambda:InvokeFunction`, which is what the Invoke
|
|
10
|
-
* API maps to. Real AWS separates the two so a policy can grant the HTTP
|
|
11
|
-
* endpoint without granting the SDK operation, and a test asserting on that
|
|
12
|
-
* distinction should see it hold here.
|
|
13
|
-
*/
|
|
14
|
-
export declare const simLambdaInvokeFunctionUrlAction = "lambda:InvokeFunctionUrl";
|
|
15
6
|
interface SimLambdaUrlAuthorizerProperties {
|
|
16
7
|
readonly iam: SimIamInterServiceAuthZ;
|
|
17
8
|
}
|
|
@@ -40,7 +31,19 @@ export declare class SimLambdaUrlAuthorizer {
|
|
|
40
31
|
private readonly iam;
|
|
41
32
|
constructor(properties: SimLambdaUrlAuthorizerProperties);
|
|
42
33
|
/**
|
|
43
|
-
* Evaluate
|
|
34
|
+
* Evaluate the actions reaching this Function URL takes.
|
|
35
|
+
*
|
|
36
|
+
* `lambda:InvokeFunctionUrl` is the one a caller signing its own request
|
|
37
|
+
* needs. CloudFront reaching the URL through an origin access control needs
|
|
38
|
+
* `lambda:InvokeFunction` on top of it, so a resource policy granting only
|
|
39
|
+
* the URL action is refused here as real Lambda refuses it.
|
|
40
|
+
*
|
|
41
|
+
* Every action is judged against the same request, so a permission
|
|
42
|
+
* conditioned on the Distribution applies to both.
|
|
43
|
+
*/
|
|
44
|
+
authorize(input: SimLambdaUrlAuthorizationInput): SimIamAuthorizationDecision;
|
|
45
|
+
/**
|
|
46
|
+
* Evaluate one action for a caller against a Function URL.
|
|
44
47
|
*
|
|
45
48
|
* The URL's auth type is supplied as `lambda:FunctionUrlAuthType`, which is
|
|
46
49
|
* what a grant conditions on in practice: a permission granted for `AWS_IAM`
|
|
@@ -52,7 +55,7 @@ export declare class SimLambdaUrlAuthorizer {
|
|
|
52
55
|
* no source supplies neither, so a permission conditioned on one does not
|
|
53
56
|
* match rather than matching anything.
|
|
54
57
|
*/
|
|
55
|
-
|
|
58
|
+
private decide;
|
|
56
59
|
}
|
|
57
60
|
export {};
|
|
58
61
|
//# sourceMappingURL=sim-lambda-url-authorizer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-lambda-url-authorizer.d.ts","sourceRoot":"","sources":["../../../../../src/service/lambda/serve/auth/sim-lambda-url-authorizer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,EACV,2BAA2B,EAC3B,uBAAuB,EACxB,MAAM,wDAAwD,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-lambda-url-authorizer.d.ts","sourceRoot":"","sources":["../../../../../src/service/lambda/serve/auth/sim-lambda-url-authorizer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,EACV,2BAA2B,EAC3B,uBAAuB,EACxB,MAAM,wDAAwD,CAAC;AAYhE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAC1F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAE1F,UAAU,gCAAgC;IACxC,QAAQ,CAAC,GAAG,EAAE,uBAAuB,CAAC;CACvC;AAED,UAAU,8BAA8B;IACtC,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC;IACxC,QAAQ,CAAC,WAAW,EAAE,oBAAoB,CAAC;IAC3C,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC;CACnD;AAED;;;;;;;;;;GAUG;AACH,qBAAa,sBAAsB;IACjC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAA0B;IAE9C,YAAY,UAAU,EAAE,gCAAgC,EAEvD;IAED;;;;;;;;;;OAUG;IACH,SAAS,CACP,KAAK,EAAE,8BAA8B,GACpC,2BAA2B,CAkB7B;IAED;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,MAAM;CAsBf"}
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import { simLambdaResourcePolicies } from "../../command/authorize/sim-lambda-resource-policies.js";
|
|
2
2
|
import { simLambdaFunctionUrlAuthTypeConditionKey, simLambdaSourceAccountConditionKey, simLambdaSourceArnConditionKey, } from "../../function/policy/sim-lambda-permission.js";
|
|
3
|
-
|
|
4
|
-
* The IAM action a Function URL invocation is authorized against.
|
|
5
|
-
*
|
|
6
|
-
* This is deliberately not `lambda:InvokeFunction`, which is what the Invoke
|
|
7
|
-
* API maps to. Real AWS separates the two so a policy can grant the HTTP
|
|
8
|
-
* endpoint without granting the SDK operation, and a test asserting on that
|
|
9
|
-
* distinction should see it hold here.
|
|
10
|
-
*/
|
|
11
|
-
export const simLambdaInvokeFunctionUrlAction = "lambda:InvokeFunctionUrl";
|
|
3
|
+
import { simLambdaInvokeFunctionAction, simLambdaInvokeFunctionUrlAction, simLambdaUrlRequiresInvokeFunction, } from "./sim-lambda-url-invoke-actions.js";
|
|
12
4
|
/**
|
|
13
5
|
* Decides whether a caller may invoke a Function URL.
|
|
14
6
|
*
|
|
@@ -26,7 +18,32 @@ export class SimLambdaUrlAuthorizer {
|
|
|
26
18
|
this.iam = properties.iam;
|
|
27
19
|
}
|
|
28
20
|
/**
|
|
29
|
-
* Evaluate
|
|
21
|
+
* Evaluate the actions reaching this Function URL takes.
|
|
22
|
+
*
|
|
23
|
+
* `lambda:InvokeFunctionUrl` is the one a caller signing its own request
|
|
24
|
+
* needs. CloudFront reaching the URL through an origin access control needs
|
|
25
|
+
* `lambda:InvokeFunction` on top of it, so a resource policy granting only
|
|
26
|
+
* the URL action is refused here as real Lambda refuses it.
|
|
27
|
+
*
|
|
28
|
+
* Every action is judged against the same request, so a permission
|
|
29
|
+
* conditioned on the Distribution applies to both.
|
|
30
|
+
*/
|
|
31
|
+
authorize(input) {
|
|
32
|
+
const urlDecision = this.decide(simLambdaInvokeFunctionUrlAction, input);
|
|
33
|
+
if (urlDecision.isDenied) {
|
|
34
|
+
return urlDecision;
|
|
35
|
+
}
|
|
36
|
+
if (!simLambdaUrlRequiresInvokeFunction(input.caller)) {
|
|
37
|
+
return urlDecision;
|
|
38
|
+
}
|
|
39
|
+
const invokeDecision = this.decide(simLambdaInvokeFunctionAction, input);
|
|
40
|
+
if (invokeDecision.isDenied) {
|
|
41
|
+
return invokeDecision;
|
|
42
|
+
}
|
|
43
|
+
return urlDecision;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Evaluate one action for a caller against a Function URL.
|
|
30
47
|
*
|
|
31
48
|
* The URL's auth type is supplied as `lambda:FunctionUrlAuthType`, which is
|
|
32
49
|
* what a grant conditions on in practice: a permission granted for `AWS_IAM`
|
|
@@ -38,10 +55,10 @@ export class SimLambdaUrlAuthorizer {
|
|
|
38
55
|
* no source supplies neither, so a permission conditioned on one does not
|
|
39
56
|
* match rather than matching anything.
|
|
40
57
|
*/
|
|
41
|
-
|
|
58
|
+
decide(action, input) {
|
|
42
59
|
const { source } = input;
|
|
43
60
|
return this.iam.authorize({
|
|
44
|
-
action
|
|
61
|
+
action,
|
|
45
62
|
resource: input.simFunction.arn,
|
|
46
63
|
caller: input.caller,
|
|
47
64
|
resourcePolicies: simLambdaResourcePolicies(input.simFunction),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-lambda-url-authorizer.js","sourceRoot":"","sources":["../../../../../src/service/lambda/serve/auth/sim-lambda-url-authorizer.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,yBAAyB,EAAE,MAAM,yDAAyD,CAAC;AACpG,OAAO,EACL,wCAAwC,EACxC,kCAAkC,EAClC,8BAA8B,GAC/B,MAAM,gDAAgD,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-lambda-url-authorizer.js","sourceRoot":"","sources":["../../../../../src/service/lambda/serve/auth/sim-lambda-url-authorizer.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,yBAAyB,EAAE,MAAM,yDAAyD,CAAC;AACpG,OAAO,EACL,wCAAwC,EACxC,kCAAkC,EAClC,8BAA8B,GAC/B,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,6BAA6B,EAC7B,gCAAgC,EAChC,kCAAkC,GACnC,MAAM,oCAAoC,CAAC;AAoB5C;;;;;;;;;;GAUG;AACH,MAAM,OAAO,sBAAsB;IAChB,GAAG,CAA0B;IAE9C,YAAY,UAA4C;QACtD,IAAI,CA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CACF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { SimAwsCaller } from "../../../aws/caller/sim-aws-caller.js";
|
|
2
|
+
/**
|
|
3
|
+
* The IAM action a Function URL invocation is authorized against.
|
|
4
|
+
*
|
|
5
|
+
* This is deliberately not `lambda:InvokeFunction`, which is what the Invoke
|
|
6
|
+
* API maps to. Real AWS separates the two so a policy can grant the HTTP
|
|
7
|
+
* endpoint without granting the SDK operation, and a test asserting on that
|
|
8
|
+
* distinction should see it hold here.
|
|
9
|
+
*
|
|
10
|
+
* That is the whole rule for a caller signing its own request. It is not the
|
|
11
|
+
* whole rule for a CloudFront origin access control, which needs
|
|
12
|
+
* `lambda:InvokeFunction` as well.
|
|
13
|
+
*/
|
|
14
|
+
export declare const simLambdaInvokeFunctionUrlAction = "lambda:InvokeFunctionUrl";
|
|
15
|
+
/**
|
|
16
|
+
* The action the Invoke API maps to, which reaching a Function URL through a
|
|
17
|
+
* CloudFront origin access control takes on top of the URL action.
|
|
18
|
+
*
|
|
19
|
+
* Real Lambda answers an origin access control granted only the URL action
|
|
20
|
+
* with 403 and never runs the handler. Both grants go to the CloudFront
|
|
21
|
+
* service principal and both are conditioned on the Distribution, as described
|
|
22
|
+
* in [Restrict access to an AWS Lambda function URL
|
|
23
|
+
* origin](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-lambda.html).
|
|
24
|
+
*/
|
|
25
|
+
export declare const simLambdaInvokeFunctionAction = "lambda:InvokeFunction";
|
|
26
|
+
/**
|
|
27
|
+
* Whether reaching this Function URL also takes `lambda:InvokeFunction`.
|
|
28
|
+
*
|
|
29
|
+
* True for CloudFront, and false for anything else, which is the distinction
|
|
30
|
+
* real Lambda draws: a caller signing the request itself needs the URL action
|
|
31
|
+
* alone.
|
|
32
|
+
*/
|
|
33
|
+
export declare function simLambdaUrlRequiresInvokeFunction(caller: SimAwsCaller): boolean;
|
|
34
|
+
//# sourceMappingURL=sim-lambda-url-invoke-actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-lambda-url-invoke-actions.d.ts","sourceRoot":"","sources":["../../../../../src/service/lambda/serve/auth/sim-lambda-url-invoke-actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAEb,MAAM,uCAAuC,CAAC;AAE/C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gCAAgC,6BAA6B,CAAC;AAE3E;;;;;;;;;GASG;AACH,eAAO,MAAM,6BAA6B,0BAA0B,CAAC;AAWrE;;;;;;GAMG;AACH,wBAAgB,kCAAkC,CAChD,MAAM,EAAE,YAAY,GACnB,OAAO,CAQT"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The IAM action a Function URL invocation is authorized against.
|
|
3
|
+
*
|
|
4
|
+
* This is deliberately not `lambda:InvokeFunction`, which is what the Invoke
|
|
5
|
+
* API maps to. Real AWS separates the two so a policy can grant the HTTP
|
|
6
|
+
* endpoint without granting the SDK operation, and a test asserting on that
|
|
7
|
+
* distinction should see it hold here.
|
|
8
|
+
*
|
|
9
|
+
* That is the whole rule for a caller signing its own request. It is not the
|
|
10
|
+
* whole rule for a CloudFront origin access control, which needs
|
|
11
|
+
* `lambda:InvokeFunction` as well.
|
|
12
|
+
*/
|
|
13
|
+
export const simLambdaInvokeFunctionUrlAction = "lambda:InvokeFunctionUrl";
|
|
14
|
+
/**
|
|
15
|
+
* The action the Invoke API maps to, which reaching a Function URL through a
|
|
16
|
+
* CloudFront origin access control takes on top of the URL action.
|
|
17
|
+
*
|
|
18
|
+
* Real Lambda answers an origin access control granted only the URL action
|
|
19
|
+
* with 403 and never runs the handler. Both grants go to the CloudFront
|
|
20
|
+
* service principal and both are conditioned on the Distribution, as described
|
|
21
|
+
* in [Restrict access to an AWS Lambda function URL
|
|
22
|
+
* origin](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-lambda.html).
|
|
23
|
+
*/
|
|
24
|
+
export const simLambdaInvokeFunctionAction = "lambda:InvokeFunction";
|
|
25
|
+
/**
|
|
26
|
+
* The service principal CloudFront reaches an Origin as.
|
|
27
|
+
*
|
|
28
|
+
* Named here rather than imported from simulated CloudFront, so that simulated
|
|
29
|
+
* Lambda goes on depending on nothing in that service. What real Lambda wants
|
|
30
|
+
* the second action for is the principal, whatever is simulating it.
|
|
31
|
+
*/
|
|
32
|
+
const cloudFrontServicePrincipal = "cloudfront.amazonaws.com";
|
|
33
|
+
/**
|
|
34
|
+
* Whether reaching this Function URL also takes `lambda:InvokeFunction`.
|
|
35
|
+
*
|
|
36
|
+
* True for CloudFront, and false for anything else, which is the distinction
|
|
37
|
+
* real Lambda draws: a caller signing the request itself needs the URL action
|
|
38
|
+
* alone.
|
|
39
|
+
*/
|
|
40
|
+
export function simLambdaUrlRequiresInvokeFunction(caller) {
|
|
41
|
+
const principal = callerPrincipal(caller);
|
|
42
|
+
if (principal.kind !== "service") {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
return principal.service === cloudFrontServicePrincipal;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The principal a caller names.
|
|
49
|
+
*
|
|
50
|
+
* Credentials name one too, but only once IAM has authenticated them, and
|
|
51
|
+
* nothing reaching a Function URL as a service principal presents any: an
|
|
52
|
+
* origin access control states who it is at the boundary instead.
|
|
53
|
+
*/
|
|
54
|
+
function callerPrincipal(caller) {
|
|
55
|
+
if (caller.kind === "resolved") {
|
|
56
|
+
return caller.principal;
|
|
57
|
+
}
|
|
58
|
+
if (caller.kind === "credentials") {
|
|
59
|
+
return { kind: "anonymous" };
|
|
60
|
+
}
|
|
61
|
+
return caller;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=sim-lambda-url-invoke-actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-lambda-url-invoke-actions.js","sourceRoot":"","sources":["../../../../../src/service/lambda/serve/auth/sim-lambda-url-invoke-actions.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,0BAA0B,CAAC;AAE3E;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,uBAAuB,CAAC;AAErE;;;;;;GAMG;AACH,MAAM,0BAA0B,GAAG,0BAA0B,CAAC;AAE9D;;;;;;GAMG;AACH,MAAM,UAAU,kCAAkC,CAChD,MAAoB;IAEpB,MAAM,SAAS,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IAE1C,IAAI,SAAS,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QACjC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,SAAS,CAAC,OAAO,KAAK,0BAA0B,CAAC;AAC1D,CAAC;AAED;;;;;;GAMG;AACH,SAAS,eAAe,CAAC,MAAoB;IAC3C,IAAI,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QAC/B,OAAO,MAAM,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;QAClC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;IAC/B,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What real Lambda says when it refuses a Function URL request.
|
|
3
|
+
*
|
|
4
|
+
* A refused request never reaches the handler and writes no log stream, so
|
|
5
|
+
* this body is the only thing a deployment has to go on. The wording is real
|
|
6
|
+
* Lambda's, down to the link, because that is what someone will be reading.
|
|
7
|
+
*/
|
|
8
|
+
export declare const simLambdaUrlForbiddenMessage: string;
|
|
1
9
|
/**
|
|
2
10
|
* The error responses a Function URL endpoint returns itself, before or
|
|
3
11
|
* instead of the function producing one.
|
|
@@ -12,7 +20,7 @@ export declare class SimLambdaUrlErrorResponse {
|
|
|
12
20
|
*/
|
|
13
21
|
notFound(): Response;
|
|
14
22
|
/**
|
|
15
|
-
* The
|
|
23
|
+
* The caller is not allowed to invoke this Function URL.
|
|
16
24
|
*/
|
|
17
25
|
forbidden(): Response;
|
|
18
26
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-lambda-url-error-response.d.ts","sourceRoot":"","sources":["../../../../../src/service/lambda/serve/response/sim-lambda-url-error-response.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qBAAa,yBAAyB;IACpC;;OAEG;IACH,QAAQ,IAAI,QAAQ,CAEnB;IAED;;OAEG;IACH,SAAS,IAAI,QAAQ,CAEpB;IAED;;OAEG;IACH,mBAAmB,IAAI,QAAQ,CAE9B;IAED,OAAO,CAAC,YAAY;CASrB"}
|
|
1
|
+
{"version":3,"file":"sim-lambda-url-error-response.d.ts","sourceRoot":"","sources":["../../../../../src/service/lambda/serve/response/sim-lambda-url-error-response.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,QAEsB,CAAC;AAEhE;;;;;;;GAOG;AACH,qBAAa,yBAAyB;IACpC;;OAEG;IACH,QAAQ,IAAI,QAAQ,CAEnB;IAED;;OAEG;IACH,SAAS,IAAI,QAAQ,CAEpB;IAED;;OAEG;IACH,mBAAmB,IAAI,QAAQ,CAE9B;IAED,OAAO,CAAC,YAAY;CASrB"}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What real Lambda says when it refuses a Function URL request.
|
|
3
|
+
*
|
|
4
|
+
* A refused request never reaches the handler and writes no log stream, so
|
|
5
|
+
* this body is the only thing a deployment has to go on. The wording is real
|
|
6
|
+
* Lambda's, down to the link, because that is what someone will be reading.
|
|
7
|
+
*/
|
|
8
|
+
export const simLambdaUrlForbiddenMessage = "Forbidden. For troubleshooting Function URL authorization issues, see: " +
|
|
9
|
+
"https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html";
|
|
1
10
|
/**
|
|
2
11
|
* The error responses a Function URL endpoint returns itself, before or
|
|
3
12
|
* instead of the function producing one.
|
|
@@ -14,10 +23,10 @@ export class SimLambdaUrlErrorResponse {
|
|
|
14
23
|
return this.jsonResponse(404, "Not Found");
|
|
15
24
|
}
|
|
16
25
|
/**
|
|
17
|
-
* The
|
|
26
|
+
* The caller is not allowed to invoke this Function URL.
|
|
18
27
|
*/
|
|
19
28
|
forbidden() {
|
|
20
|
-
return this.jsonResponse(403,
|
|
29
|
+
return this.jsonResponse(403, simLambdaUrlForbiddenMessage);
|
|
21
30
|
}
|
|
22
31
|
/**
|
|
23
32
|
* The function failed to handle the invocation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-lambda-url-error-response.js","sourceRoot":"","sources":["../../../../../src/service/lambda/serve/response/sim-lambda-url-error-response.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,OAAO,yBAAyB;IACpC;;OAEG;IACH,QAAQ;QACN,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"sim-lambda-url-error-response.js","sourceRoot":"","sources":["../../../../../src/service/lambda/serve/response/sim-lambda-url-error-response.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,4BAA4B,GACvC,yEAAyE;IACzE,6DAA6D,CAAC;AAEhE;;;;;;;GAOG;AACH,MAAM,OAAO,yBAAyB;IACpC;;OAEG;IACH,QAAQ;QACN,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,4BAA4B,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACH,mBAAmB;QACjB,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,uBAAuB,CAAC,CAAC;IACzD,CAAC;IAEO,YAAY,CAAC,MAAc,EAAE,OAAe;QAClD,OAAO,QAAQ,CAAC,IAAI,CAClB,EAAE,OAAO,EAAE,OAAO,EAAE,EACpB;YACE,MAAM;YACN,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;SAChD,CACF,CAAC;IACJ,CAAC;CACF"}
|
package/package.json
CHANGED