@@ -65,17 +65,18 @@ type APIGatewayV2HTTPRequest struct {
6565
6666// APIGatewayV2HTTPRequestContext contains the information to identify the AWS account and resources invoking the Lambda function.
6767type APIGatewayV2HTTPRequestContext struct {
68- RouteKey string `json:"routeKey"`
69- AccountID string `json:"accountId"`
70- Stage string `json:"stage"`
71- RequestID string `json:"requestId"`
72- Authorizer * APIGatewayV2HTTPRequestContextAuthorizerDescription `json:"authorizer,omitempty"`
73- APIID string `json:"apiId"` // The API Gateway HTTP API Id
74- DomainName string `json:"domainName"`
75- DomainPrefix string `json:"domainPrefix"`
76- Time string `json:"time"`
77- TimeEpoch int64 `json:"timeEpoch"`
78- HTTP APIGatewayV2HTTPRequestContextHTTPDescription `json:"http"`
68+ RouteKey string `json:"routeKey"`
69+ AccountID string `json:"accountId"`
70+ Stage string `json:"stage"`
71+ RequestID string `json:"requestId"`
72+ Authorizer * APIGatewayV2HTTPRequestContextAuthorizerDescription `json:"authorizer,omitempty"`
73+ APIID string `json:"apiId"` // The API Gateway HTTP API Id
74+ DomainName string `json:"domainName"`
75+ DomainPrefix string `json:"domainPrefix"`
76+ Time string `json:"time"`
77+ TimeEpoch int64 `json:"timeEpoch"`
78+ HTTP APIGatewayV2HTTPRequestContextHTTPDescription `json:"http"`
79+ Authentication APIGatewayV2HTTPRequestContextAuthentication `json:"authentication"`
7980}
8081
8182// APIGatewayV2HTTPRequestContextAuthorizerDescription contains authorizer information for the request context.
@@ -140,7 +141,7 @@ type APIGatewayRequestIdentity struct {
140141 SourceIP string `json:"sourceIp"`
141142 CognitoAuthenticationType string `json:"cognitoAuthenticationType"`
142143 CognitoAuthenticationProvider string `json:"cognitoAuthenticationProvider"`
143- UserArn string `json:"userArn"`
144+ UserArn string `json:"userArn"` //nolint: stylecheck
144145 UserAgent string `json:"userAgent"`
145146 User string `json:"user"`
146147}
@@ -189,10 +190,46 @@ type APIGatewayWebsocketProxyRequestContext struct {
189190 Status string `json:"status"`
190191}
191192
192- // APIGatewayCustomAuthorizerRequestTypeRequestIdentity contains identity information for the request caller.
193+ // APIGatewayCustomAuthorizerRequestTypeRequestIdentity contains identity information for the request caller including certificate information if using mTLS .
193194type APIGatewayCustomAuthorizerRequestTypeRequestIdentity struct {
194- APIKey string `json:"apiKey"`
195- SourceIP string `json:"sourceIp"`
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 {
211+ NotAfter string `json:"notAfter"`
212+ NotBefore string `json:"notBefore"`
213+ }
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+
220+ // APIGatewayV2HTTPRequestContextAuthenticationClientCert contains client certificate information for the request caller if using mTLS.
221+ type APIGatewayV2HTTPRequestContextAuthenticationClientCert struct {
222+ ClientCertPem string `json:"clientCertPem"`
223+ IssuerDN string `json:"issuerDN"`
224+ SerialNumber string `json:"serialNumber"`
225+ SubjectDN string `json:"subjectDN"`
226+ Validity APIGatewayV2HTTPRequestContextAuthenticationClientCertValidity `json:"validity"`
227+ }
228+
229+ // APIGatewayV2HTTPRequestContextAuthenticationClientCertValidity contains client certificate validity information for the request caller if using mTLS.
230+ type APIGatewayV2HTTPRequestContextAuthenticationClientCertValidity struct {
231+ NotAfter string `json:"notAfter"`
232+ NotBefore string `json:"notBefore"`
196233}
197234
198235// APIGatewayCustomAuthorizerContext represents the expected format of an API Gateway custom authorizer response.
@@ -221,13 +258,13 @@ type APIGatewayCustomAuthorizerRequestTypeRequestContext struct {
221258type APIGatewayCustomAuthorizerRequest struct {
222259 Type string `json:"type"`
223260 AuthorizationToken string `json:"authorizationToken"`
224- MethodArn string `json:"methodArn"`
261+ MethodArn string `json:"methodArn"` //nolint: stylecheck
225262}
226263
227264// APIGatewayCustomAuthorizerRequestTypeRequest contains data coming in to a custom API Gateway authorizer function.
228265type APIGatewayCustomAuthorizerRequestTypeRequest struct {
229266 Type string `json:"type"`
230- MethodArn string `json:"methodArn"`
267+ MethodArn string `json:"methodArn"` //nolint: stylecheck
231268 Resource string `json:"resource"`
232269 Path string `json:"path"`
233270 HTTPMethod string `json:"httpMethod"`
@@ -248,6 +285,12 @@ type APIGatewayCustomAuthorizerResponse struct {
248285 UsageIdentifierKey string `json:"usageIdentifierKey,omitempty"`
249286}
250287
288+ // APIGatewayV2CustomAuthorizerSimpleResponse represents the simple format of an API Gateway V2 authorization response.
289+ type APIGatewayV2CustomAuthorizerSimpleResponse struct {
290+ IsAuthorized bool `json:"isAuthorized"`
291+ Context map [string ]interface {} `json:"context,omitempty"`
292+ }
293+
251294// APIGatewayCustomAuthorizerPolicy represents an IAM policy
252295type APIGatewayCustomAuthorizerPolicy struct {
253296 Version string
0 commit comments