@@ -70,103 +70,8 @@ export const handlerContext = (fillAllFields: boolean = false): Context => {
70
70
return ctx ;
71
71
} ;
72
72
73
- export const apiGatewayRequestContext = ( ) : APIGatewayEventRequestContext => {
74
- return {
75
- accountId : '123456789012' ,
76
- apiId : 'someapi' ,
77
- authorizer : null ,
78
- httpMethod : 'GET' ,
79
- identity : {
80
- accessKey : null ,
81
- accountId : null ,
82
- apiKey : null ,
83
- apiKeyId : null ,
84
- caller : null ,
85
- clientCert : null ,
86
- cognitoAuthenticationProvider : null ,
87
- cognitoAuthenticationType : null ,
88
- cognitoIdentityId : null ,
89
- cognitoIdentityPoolId : null ,
90
- principalOrgId : null ,
91
- sourceIp : '12.12.12.12' ,
92
- user : null ,
93
- userAgent : 'curl/7.54.0' ,
94
- userArn : null ,
95
- } ,
96
- path : '/prd' ,
97
- protocol : 'HTTP/1.1' ,
98
- stage : 'prd' ,
99
- requestId : 'a507736b-259e-11e9-8fcf-4f1f08c4591e' ,
100
- requestTimeEpoch : 1548969891530 ,
101
- resourceId : 'reas23acc' ,
102
- resourcePath : '/' ,
103
- } ;
104
- } ;
105
-
106
73
export const apiGatewayRequestRawQuery = '?&foo[a]=bar%20b&foo[a]=baz%20c&x=1&x=2&y=z' ;
107
74
108
- export const apiGatewayRequest = ( ) : APIGatewayRequestEvent => {
109
- return {
110
- body : null ,
111
- httpMethod : 'GET' ,
112
- isBase64Encoded : false ,
113
- path : '/echo/asdf/a' ,
114
- resource : '/{proxy+}' ,
115
- pathParameters : { proxy : 'echo/asdf/a' } ,
116
- stageVariables : null ,
117
- requestContext : apiGatewayRequestContext ( ) ,
118
- headers : {
119
- Accept : '*/*' ,
120
- 'CloudFront-Forwarded-Proto' : 'https' ,
121
- 'CloudFront-Is-Desktop-Viewer' : 'true' ,
122
- 'CloudFront-Is-Mobile-Viewer' : 'false' ,
123
- 'CloudFront-Is-SmartTV-Viewer' : 'false' ,
124
- 'CloudFront-Is-Tablet-Viewer' : 'false' ,
125
- 'CloudFront-Viewer-Country' : 'US' ,
126
- Host : 'b5gee6dacf.execute-api.us-east-1.amazonaws.com' ,
127
- 'User-Agent' : 'curl/7.54.0' ,
128
- Via : '2.0 4ee511e558a0400aa4b9c1d34d92af5a.cloudfront.net (CloudFront)' ,
129
- 'X-Amz-Cf-Id' : 'xn-ohXlUAed-32bae2cfb7164fd690ffffb87d36b032==' ,
130
- 'X-Amzn-Trace-Id' : 'Root=1-4b5398e2-a7fbe4f92f2e911013cba76b' ,
131
- 'X-Forwarded-For' : '8.8.8.8, 2.3.4.5' ,
132
- 'X-Forwarded-Port' : '443' ,
133
- 'X-Forwarded-Proto' : 'https' ,
134
- Referer : 'https://en.wikipedia.org/wiki/HTTP_referer' ,
135
- Cookie : 'uid=abc; ga=1234; foo=bar; baz=foo%5Ba%5D; obj=j%3A%7B%22abc%22%3A123%7D; onechar=j; bad=j%3A%7Ba%7D' ,
136
- } ,
137
- multiValueHeaders : {
138
- Accept : [ '*/*' ] ,
139
- Foo : [ 'bar' , 'baz' ] ,
140
- 'CloudFront-Forwarded-Proto' : [ 'https' ] ,
141
- 'CloudFront-Is-Desktop-Viewer' : [ 'true' ] ,
142
- 'CloudFront-Is-Mobile-Viewer' : [ 'false' ] ,
143
- 'CloudFront-Is-SmartTV-Viewer' : [ 'false' ] ,
144
- 'CloudFront-Is-Tablet-Viewer' : [ 'false' ] ,
145
- 'CloudFront-Viewer-Country' : [ 'US' ] ,
146
- Host : [ 'b5gee6dacf.execute-api.us-east-1.amazonaws.com' ] ,
147
- 'User-Agent' : [ 'curl/7.54.0' ] ,
148
- Via : [ '2.0 4ee511e558a0400aa4b9c1d34d92af5a.cloudfront.net (CloudFront)' ] ,
149
- 'X-Amz-Cf-Id' : [ 'xn-ohXlUAed-32bae2cfb7164fd690ffffb87d36b032==' ] ,
150
- 'X-Amzn-Trace-Id' : [ 'Root=1-4b5398e2-a7fbe4f92f2e911013cba76b' ] ,
151
- 'X-Forwarded-For' : [ '8.8.8.8, 2.3.4.5' ] ,
152
- 'X-Forwarded-Port' : [ '443' ] ,
153
- 'X-Forwarded-Proto' : [ 'https' ] ,
154
- Referer : [ 'https://en.wikipedia.org/wiki/HTTP_referer' ] ,
155
- Cookie : [ 'uid=abc; ga=1234; foo=bar; baz=foo%5Ba%5D; obj=j%3A%7B%22abc%22%3A123%7D; onechar=j; bad=j%3A%7Ba%7D' ] ,
156
- } ,
157
- queryStringParameters : {
158
- 'foo[a]' : 'bar b' ,
159
- x : '2' ,
160
- y : 'z' ,
161
- } ,
162
- multiValueQueryStringParameters : {
163
- 'foo[a]' : [ 'bar b' , 'baz c' ] ,
164
- x : [ '1' , '2' ] ,
165
- y : [ 'z' ] ,
166
- } ,
167
- } ;
168
- } ;
169
-
170
75
export const albRequestContext = ( ) : ApplicationLoadBalancerEventRequestContext => {
171
76
return {
172
77
elb : {
0 commit comments