forked from aws/aws-lambda-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
APIGatewayHttpApiV2ProxyRequest.cs
344 lines (290 loc) · 11.7 KB
/
APIGatewayHttpApiV2ProxyRequest.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
using System;
using System.Collections.Generic;
using System.Text;
namespace Amazon.Lambda.APIGatewayEvents
{
/// <summary>
/// For request using using API Gateway HTTP API version 2 payload proxy format
/// https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
/// </summary>
public class APIGatewayHttpApiV2ProxyRequest
{
/// <summary>
/// The payload format version
/// </summary>
public string Version { get; set; }
/// <summary>
/// The route key
/// </summary>
public string RouteKey { get; set; }
/// <summary>
/// The raw path
/// </summary>
public string RawPath { get; set; }
/// <summary>
/// The raw query string
/// </summary>
public string RawQueryString { get; set; }
/// <summary>
/// Cookies sent along with the request
/// </summary>
public string[] Cookies { get; set; }
/// <summary>
/// Headers sent with the request. Multiple values for the same header will be separated by a comma.
/// </summary>
public IDictionary<string, string> Headers { get; set; }
/// <summary>
/// Query string parameters sent with the request. Multiple values for the same parameter will be separated by a comma.
/// </summary>
public IDictionary<string, string> QueryStringParameters { get; set; }
/// <summary>
/// The request context for the request
/// </summary>
public ProxyRequestContext RequestContext { get; set; }
/// <summary>
/// The HTTP request body.
/// </summary>
public string Body { get; set; }
/// <summary>
/// Path parameters sent with the request.
/// </summary>
public IDictionary<string, string> PathParameters { get; set; }
/// <summary>
/// True if the body of the request is base 64 encoded.
/// </summary>
public bool IsBase64Encoded { get; set; }
/// <summary>
/// The stage variables defined for the stage in API Gateway
/// </summary>
public IDictionary<string, string> StageVariables { get; set; }
/// <summary>
/// The ProxyRequestContext contains the information to identify the AWS account and resources invoking the
/// Lambda function.
/// </summary>
public class ProxyRequestContext
{
/// <summary>
/// The account id that owns the executing Lambda function
/// </summary>
public string AccountId { get; set; }
/// <summary>
/// The API Gateway rest API Id.
/// </summary>
public string ApiId { get; set; }
/// <summary>
/// Information about the current requesters authorization including claims and scopes.
/// </summary>
public AuthorizerDescription Authorizer { get; set; }
/// <summary>
/// The domin name.
/// </summary>
public string DomainName { get; set; }
/// <summary>
/// The domain prefix
/// </summary>
public string DomainPrefix { get; set; }
/// <summary>
/// Information about the HTTP request like the method and path.
/// </summary>
public HttpDescription Http {get;set;}
/// <summary>
/// The unique request id
/// </summary>
public string RequestId { get; set; }
/// <summary>
/// The route id
/// </summary>
public string RouteId { get; set; }
/// <summary>
/// The selected route key.
/// </summary>
public string RouteKey { get; set; }
/// <summary>
/// The API Gateway stage name
/// </summary>
public string Stage { get; set; }
/// <summary>
/// Gets and sets the request time.
/// </summary>
public string Time { get; set; }
/// <summary>
/// Gets and sets the request time as an epoch.
/// </summary>
public long TimeEpoch { get; set; }
/// <summary>
/// Properties for authentication.
/// </summary>
public ProxyRequestAuthentication Authentication { get; set; }
}
/// <summary>
/// Container for authentication properties.
/// </summary>
public class ProxyRequestAuthentication
{
/// <summary>
/// Properties for a client certificate.
/// </summary>
public ProxyRequestClientCert ClientCert { get; set; }
}
/// <summary>
/// Container for the properties of the client certificate.
/// </summary>
public class ProxyRequestClientCert
{
/// <summary>
/// The PEM-encoded client certificate that the client presented during mutual TLS authentication.
/// Present when a client accesses an API by using a custom domain name that has mutual
/// TLS enabled. Present only in access logs if mutual TLS authentication fails.
/// </summary>
public string ClientCertPem { get; set; }
/// <summary>
/// The distinguished name of the subject of the certificate that a client presents.
/// Present when a client accesses an API by using a custom domain name that has
/// mutual TLS enabled. Present only in access logs if mutual TLS authentication fails.
/// </summary>
public string SubjectDN { get; set; }
/// <summary>
/// The distinguished name of the issuer of the certificate that a client presents.
/// Present when a client accesses an API by using a custom domain name that has
/// mutual TLS enabled. Present only in access logs if mutual TLS authentication fails.
/// </summary>
public string IssuerDN { get; set; }
/// <summary>
/// The serial number of the certificate. Present when a client accesses an API by
/// using a custom domain name that has mutual TLS enabled.
/// Present only in access logs if mutual TLS authentication fails.
/// </summary>
public string SerialNumber { get; set; }
/// <summary>
/// The rules for when the client cert is valid.
/// </summary>
public ClientCertValidity Validity { get; set; }
}
/// <summary>
/// Container for the validation properties of a client cert.
/// </summary>
public class ClientCertValidity
{
/// <summary>
/// The date before which the certificate is invalid. Present when a client accesses an API by using a custom domain name
/// that has mutual TLS enabled. Present only in access logs if mutual TLS authentication fails.
/// </summary>
public string NotBefore { get; set; }
/// <summary>
/// The date after which the certificate is invalid. Present when a client accesses an API by using a custom domain name that
/// has mutual TLS enabled. Present only in access logs if mutual TLS authentication fails.
/// </summary>
public string NotAfter { get; set; }
}
/// <summary>
/// Information about the HTTP elements for the request.
/// </summary>
public class HttpDescription
{
/// <summary>
/// The HTTP method like POST or GET.
/// </summary>
public string Method { get; set; }
/// <summary>
/// The path of the request.
/// </summary>
public string Path { get; set; }
/// <summary>
/// The protocal used to make the rquest
/// </summary>
public string Protocol { get; set; }
/// <summary>
/// The source ip for the request.
/// </summary>
public string SourceIp { get; set; }
/// <summary>
/// The user agent for the request.
/// </summary>
public string UserAgent { get; set; }
}
/// <summary>
/// Information about the current requesters authorization.
/// </summary>
public class AuthorizerDescription
{
/// <summary>
/// The JWT description including claims and scopes.
/// </summary>
public JwtDescription Jwt { get; set; }
/// <summary>
/// The Lambda authorizer description
/// </summary>
public IDictionary<string, object> Lambda { get; set; }
/// <summary>
/// The IAM authorizer description
/// </summary>
public IAMDescription IAM { get; set; }
/// <summary>
/// Describes the information from an IAM authorizer
/// </summary>
public class IAMDescription
{
/// <summary>
/// The Access Key of the IAM Authorizer
/// </summary>
public string AccessKey { get; set; }
/// <summary>
/// The Account Id of the IAM Authorizer
/// </summary>
public string AccountId { get; set; }
/// <summary>
/// The Caller Id of the IAM Authorizer
/// </summary>
public string CallerId { get; set; }
/// <summary>
/// The Cognito Identity of the IAM Authorizer
/// </summary>
public CognitoIdentityDescription CognitoIdentity { get; set; }
/// <summary>
/// The Principal Org Id of the IAM Authorizer
/// </summary>
public string PrincipalOrgId { get; set; }
/// <summary>
/// The User ARN of the IAM Authorizer
/// </summary>
public string UserARN { get; set; }
/// <summary>
/// The User Id of the IAM Authorizer
/// </summary>
public string UserId { get; set; }
}
/// <summary>
/// The Cognito identity description for an IAM authorizer
/// </summary>
public class CognitoIdentityDescription
{
/// <summary>
/// The AMR of the IAM Authorizer
/// </summary>
public IList<string> AMR { get; set; }
/// <summary>
/// The Identity Id of the IAM Authorizer
/// </summary>
public string IdentityId { get; set; }
/// <summary>
/// The Identity Pool Id of the IAM Authorizer
/// </summary>
public string IdentityPoolId { get; set; }
}
/// <summary>
/// Describes the information in the JWT token
/// </summary>
public class JwtDescription
{
/// <summary>
/// Map of the claims for the requester.
/// </summary>
public IDictionary<string, string> Claims { get; set; }
/// <summary>
/// List of the scopes for the requester.
/// </summary>
public string[] Scopes { get; set; }
}
}
}
}