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