@@ -28,7 +28,7 @@ type APIGatewayProxyResponse struct {
28
28
}
29
29
30
30
// APIGatewayProxyRequestContext contains the information to identify the AWS account and resources invoking the
31
- // Lambda function. It also includes Cognito identity information for the caller
31
+ // Lambda function. It also includes Cognito identity information for the caller.
32
32
type APIGatewayProxyRequestContext struct {
33
33
AccountID string `json:"accountId"`
34
34
ResourceID string `json:"resourceId"`
@@ -63,37 +63,6 @@ type APIGatewayV2HTTPRequest struct {
63
63
IsBase64Encoded bool `json:"isBase64Encoded"`
64
64
}
65
65
66
- // APIGatewayV2HTTPRequestContextAuthorizerCognitoIdentity contains Cognito identity information for the request contex
67
- type APIGatewayV2HTTPRequestContextAuthorizerCognitoIdentity struct {
68
- AMR []string `json:"amr"`
69
- IdentityID string `json:"identityId"`
70
- IdentityPoolID string `json:"identityPoolId"`
71
- }
72
-
73
- // APIGatewayV2HTTPRequestContextAuthorizerIAMDescription contains IAM information for the request contex
74
- type APIGatewayV2HTTPRequestContextAuthorizerIAMDescription struct {
75
- AccessKey string `json:"accessKey"`
76
- AccountID string `json:"accountId"`
77
- CallerID string `json:"callerId"`
78
- CognitoIdentity APIGatewayV2HTTPRequestContextAuthorizerCognitoIdentity `json:"cognitoIdentity,omitempty"`
79
- PrincipalOrgID string `json:"principalOrgId"`
80
- UserARN string `json:"userArn"`
81
- UserID string `json:"userId"`
82
- }
83
-
84
- // APIGatewayV2HTTPRequestContextAuthorizerJWTDescription contains JWT authorizer information for the request context.
85
- type APIGatewayV2HTTPRequestContextAuthorizerJWTDescription struct {
86
- Claims map [string ]string `json:"claims"`
87
- Scopes []string `json:"scopes,omitempty"`
88
- }
89
-
90
- // APIGatewayV2HTTPRequestContextAuthorizerDescription contains authorizer information for the request context.
91
- type APIGatewayV2HTTPRequestContextAuthorizerDescription struct {
92
- JWT * APIGatewayV2HTTPRequestContextAuthorizerJWTDescription `json:"jwt,omitempty"`
93
- Lambda map [string ]interface {} `json:"lambda,omitempty"`
94
- IAM * APIGatewayV2HTTPRequestContextAuthorizerIAMDescription `json:"iam,omitempty"`
95
- }
96
-
97
66
// APIGatewayV2HTTPRequestContext contains the information to identify the AWS account and resources invoking the Lambda function.
98
67
type APIGatewayV2HTTPRequestContext struct {
99
68
RouteKey string `json:"routeKey"`
@@ -110,6 +79,37 @@ type APIGatewayV2HTTPRequestContext struct {
110
79
Authentication APIGatewayV2HTTPRequestContextAuthentication `json:"authentication"`
111
80
}
112
81
82
+ // APIGatewayV2HTTPRequestContextAuthorizerDescription contains authorizer information for the request context.
83
+ type APIGatewayV2HTTPRequestContextAuthorizerDescription struct {
84
+ JWT * APIGatewayV2HTTPRequestContextAuthorizerJWTDescription `json:"jwt,omitempty"`
85
+ Lambda map [string ]interface {} `json:"lambda,omitempty"`
86
+ IAM * APIGatewayV2HTTPRequestContextAuthorizerIAMDescription `json:"iam,omitempty"`
87
+ }
88
+
89
+ // APIGatewayV2HTTPRequestContextAuthorizerJWTDescription contains JWT authorizer information for the request context.
90
+ type APIGatewayV2HTTPRequestContextAuthorizerJWTDescription struct {
91
+ Claims map [string ]string `json:"claims"`
92
+ Scopes []string `json:"scopes,omitempty"`
93
+ }
94
+
95
+ // APIGatewayV2HTTPRequestContextAuthorizerIAMDescription contains IAM information for the request context.
96
+ type APIGatewayV2HTTPRequestContextAuthorizerIAMDescription struct {
97
+ AccessKey string `json:"accessKey"`
98
+ AccountID string `json:"accountId"`
99
+ CallerID string `json:"callerId"`
100
+ CognitoIdentity APIGatewayV2HTTPRequestContextAuthorizerCognitoIdentity `json:"cognitoIdentity,omitempty"`
101
+ PrincipalOrgID string `json:"principalOrgId"`
102
+ UserARN string `json:"userArn"`
103
+ UserID string `json:"userId"`
104
+ }
105
+
106
+ // APIGatewayV2HTTPRequestContextAuthorizerCognitoIdentity contains Cognito identity information for the request context.
107
+ type APIGatewayV2HTTPRequestContextAuthorizerCognitoIdentity struct {
108
+ AMR []string `json:"amr"`
109
+ IdentityID string `json:"identityId"`
110
+ IdentityPoolID string `json:"identityPoolId"`
111
+ }
112
+
113
113
// APIGatewayV2HTTPRequestContextHTTPDescription contains HTTP information for the request context.
114
114
type APIGatewayV2HTTPRequestContextHTTPDescription struct {
115
115
Method string `json:"method"`
@@ -150,7 +150,7 @@ type APIGatewayRequestIdentity struct {
150
150
type APIGatewayWebsocketProxyRequest struct {
151
151
Resource string `json:"resource"` // The resource path defined in API Gateway
152
152
Path string `json:"path"` // The url path for the caller
153
- HTTPMethod string `json:"httpMethod,omitempty "`
153
+ HTTPMethod string `json:"httpMethod"`
154
154
Headers map [string ]string `json:"headers"`
155
155
MultiValueHeaders map [string ][]string `json:"multiValueHeaders"`
156
156
QueryStringParameters map [string ]string `json:"queryStringParameters"`
@@ -190,12 +190,33 @@ type APIGatewayWebsocketProxyRequestContext struct {
190
190
Status string `json:"status"`
191
191
}
192
192
193
- // APIGatewayV2HTTPRequestContextAuthenticationClientCertValidity contains client certificate validity information for the request caller if using mTLS.
194
- type APIGatewayV2HTTPRequestContextAuthenticationClientCertValidity struct {
193
+ // APIGatewayCustomAuthorizerRequestTypeRequestIdentity contains identity information for the request caller including certificate information if using mTLS.
194
+ type APIGatewayCustomAuthorizerRequestTypeRequestIdentity struct {
195
+ APIKey string `json:"apiKey"`
196
+ SourceIP string `json:"sourceIp"`
197
+ ClientCert APIGatewayCustomAuthorizerRequestTypeRequestIdentityClientCert `json:"clientCert"`
198
+ }
199
+
200
+ // APIGatewayCustomAuthorizerRequestTypeRequestIdentityClientCert contains certificate information for the request caller if using mTLS..
201
+ type APIGatewayCustomAuthorizerRequestTypeRequestIdentityClientCert struct {
202
+ ClientCertPem string `json:"clientCertPem"`
203
+ IssuerDN string `json:"issuerDN"`
204
+ SerialNumber string `json:"serialNumber"`
205
+ SubjectDN string `json:"subjectDN"`
206
+ Validity APIGatewayCustomAuthorizerRequestTypeRequestIdentityClientCertValidity `json:"validity"`
207
+ }
208
+
209
+ // APIGatewayCustomAuthorizerRequestTypeRequestIdentityClientCertValidity contains certificate validity information for the request caller if using mTLS.
210
+ type APIGatewayCustomAuthorizerRequestTypeRequestIdentityClientCertValidity struct {
195
211
NotAfter string `json:"notAfter"`
196
212
NotBefore string `json:"notBefore"`
197
213
}
198
214
215
+ // APIGatewayV2HTTPRequestContextAuthentication contains authentication context information for the request caller including client certificate information if using mTLS.
216
+ type APIGatewayV2HTTPRequestContextAuthentication struct {
217
+ ClientCert APIGatewayV2HTTPRequestContextAuthenticationClientCert `json:"clientCert"`
218
+ }
219
+
199
220
// APIGatewayV2HTTPRequestContextAuthenticationClientCert contains client certificate information for the request caller if using mTLS.
200
221
type APIGatewayV2HTTPRequestContextAuthenticationClientCert struct {
201
222
ClientCertPem string `json:"clientCertPem"`
@@ -205,33 +226,12 @@ type APIGatewayV2HTTPRequestContextAuthenticationClientCert struct {
205
226
Validity APIGatewayV2HTTPRequestContextAuthenticationClientCertValidity `json:"validity"`
206
227
}
207
228
208
- // APIGatewayV2HTTPRequestContextAuthentication contains authentication context information for the request caller including client certificate information if using mTLS..
209
- type APIGatewayV2HTTPRequestContextAuthentication struct {
210
- ClientCert APIGatewayV2HTTPRequestContextAuthenticationClientCert `json:"clientCert"`
211
- }
212
-
213
- // APIGatewayCustomAuthorizerRequestTypeRequestIdentityClientCertValidity contains certificate validity information for the request caller if using mTLS.
214
- type APIGatewayCustomAuthorizerRequestTypeRequestIdentityClientCertValidity struct {
229
+ // APIGatewayV2HTTPRequestContextAuthenticationClientCertValidity contains client certificate validity information for the request caller if using mTLS.
230
+ type APIGatewayV2HTTPRequestContextAuthenticationClientCertValidity struct {
215
231
NotAfter string `json:"notAfter"`
216
232
NotBefore string `json:"notBefore"`
217
233
}
218
234
219
- // APIGatewayCustomAuthorizerRequestTypeRequestIdentityClientCert contains certificate information for the request caller if using mTLS.
220
- type APIGatewayCustomAuthorizerRequestTypeRequestIdentityClientCert struct {
221
- ClientCertPem string `json:"clientCertPem"`
222
- IssuerDN string `json:"issuerDN"`
223
- SerialNumber string `json:"serialNumber"`
224
- SubjectDN string `json:"subjectDN"`
225
- Validity APIGatewayCustomAuthorizerRequestTypeRequestIdentityClientCertValidity `json:"validity"`
226
- }
227
-
228
- // APIGatewayCustomAuthorizerRequestTypeRequestIdentity contains identity information for the request caller including certificate information if using mTLS.
229
- type APIGatewayCustomAuthorizerRequestTypeRequestIdentity struct {
230
- APIKey string `json:"apiKey"`
231
- SourceIP string `json:"sourceIp"`
232
- ClientCert APIGatewayCustomAuthorizerRequestTypeRequestIdentityClientCert `json:"clientCert"`
233
- }
234
-
235
235
// APIGatewayCustomAuthorizerContext represents the expected format of an API Gateway custom authorizer response.
236
236
// Deprecated. Code should be updated to use the Authorizer map from APIGatewayRequestIdentity. Ex: Authorizer["principalId"]
237
237
type APIGatewayCustomAuthorizerContext struct {
0 commit comments