1
+ ---
2
+ version: 1.2.3
3
+ title: API Gateway V2 HTTP request with IAM authorizer
4
+ file: ./test/glambda_test.gleam
5
+ test_name: api_gateway_v2_http_request_iam_marshaling_test
6
+ ---
7
+ ApiGatewayProxyEventV2(
8
+ version: "2.0",
9
+ route_key: "$default",
10
+ raw_path: "/my/path",
11
+ raw_query_string: "parameter1=value1¶meter1=value2¶meter2=value",
12
+ cookies: Some(["cookie1", "cookie2"]),
13
+ headers: dict.from_list([
14
+ #("Header1", "value1"),
15
+ #("Header2", "value2"),
16
+ ]),
17
+ query_string_parameters: Some(dict.from_list([
18
+ #("parameter1", "value1,value2"),
19
+ #("parameter2", "value"),
20
+ ])),
21
+ path_parameters: Some(dict.from_list([
22
+ #("proxy", "hello/world"),
23
+ ])),
24
+ stage_variables: Some(dict.from_list([
25
+ #("stageVariable1", "value1"),
26
+ #("stageVariable2", "value2"),
27
+ ])),
28
+ request_context: ApiGatewayRequestContextV2(
29
+ route_key: "$default",
30
+ account_id: "123456789012",
31
+ stage: "$default",
32
+ request_id: "id",
33
+ authorizer: Some(Iam(iam: ApiGatewayEventRequestContextIamAuthorizer(
34
+ access_key: "ARIA2ZJZYVUEREEIHAKY",
35
+ account_id: "1234567890",
36
+ caller_id: "AROA7ZJZYVRE7C3DUXHH6:CognitoIdentityCredentials",
37
+ principal_org_id: "AwsOrgId",
38
+ user_arn: "arn:aws:iam::1234567890:user/Admin",
39
+ user_id: "AROA2ZJZYVRE7Y3TUXHH6",
40
+ ))),
41
+ api_id: "api-id",
42
+ domain_name: "id.execute-api.us-east-1.amazonaws.com",
43
+ domain_prefix: "id",
44
+ time: "12/Mar/2020:19:03:58+0000",
45
+ time_epoch: 1583348638390,
46
+ http: ApiGatewayEventRequestContextHttp(
47
+ method: "GET",
48
+ path: "/my/path",
49
+ protocol: "HTTP/1.1",
50
+ source_ip: "IP",
51
+ user_agent: "agent",
52
+ ),
53
+ authentication: Some(ApiGatewayEventRequestContextAuthentication(client_cert: APIGatewayEventClientCertificate(
54
+ client_cert_pem: "-----BEGIN CERTIFICATE-----
55
+ MIIEZTCCAk0CAQEwDQ...",
56
+ issuer_dn: "C=US,ST=Washington,L=Seattle,O=Amazon Web Services,OU=Security,CN=My Private CA",
57
+ serial_number: "1",
58
+ subject_dn: "C=US,ST=Washington,L=Seattle,O=Amazon Web Services,OU=Security,CN=My Client",
59
+ validity: APIGatewayEventValidity(
60
+ not_after: "Aug 5 00:28:21 2120 GMT",
61
+ not_before: "Aug 29 00:28:21 2020 GMT",
62
+ ),
63
+ ))),
64
+ ),
65
+ body: Some("{
66
+ "a": 1
67
+ }"),
68
+ is_base64_encoded: False,
69
+ )
0 commit comments