Skip to content

Commit 1d83b07

Browse files
committed
Added ClientCert to APIGatewayCustomAuthorizerRequestTypeRequestIdentity and Authentication and ClientCert to APIGatewayV2HTTPRequestContext Struct definitions
1 parent f24acb2 commit 1d83b07

File tree

1 file changed

+51
-14
lines changed

1 file changed

+51
-14
lines changed

events/apigw.go

Lines changed: 51 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,18 @@ type APIGatewayV2HTTPRequest struct {
6565

6666
// APIGatewayV2HTTPRequestContext contains the information to identify the AWS account and resources invoking the Lambda function.
6767
type 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.
@@ -189,10 +190,46 @@ type APIGatewayWebsocketProxyRequestContext struct {
189190
Status string `json:"status"`
190191
}
191192

192-
// APIGatewayCustomAuthorizerRequestTypeRequestIdentity contains identity information for the request caller.
193+
// APIGatewayCustomAuthorizerRequestTypeRequestIdentityClientCertValidity contains certificate validity information for the request caller if using mTLS..
194+
type APIGatewayCustomAuthorizerRequestTypeRequestIdentityClientCertValidity struct {
195+
NotAfter string `json:"notAfter"`
196+
NotBefore string `json:"notBefore"`
197+
}
198+
199+
// APIGatewayCustomAuthorizerRequestTypeRequestIdentityClientCert contains certificate information for the request caller if using mTLS..
200+
type APIGatewayCustomAuthorizerRequestTypeRequestIdentityClientCert struct {
201+
ClientCertPem string `json:"clientCertPem"`
202+
IssuerDN string `json:"issuerDN"`
203+
SerialNumber string `json:"serialNumber"`
204+
SubjectDN string `json:"subjectDN"`
205+
Validity APIGatewayCustomAuthorizerRequestTypeRequestIdentityClientCertValidity `json:"validity"`
206+
}
207+
208+
// APIGatewayV2HTTPRequestContextAuthenticationClientCertValidity contains client certificate validity information for the request caller if using mTLS..
209+
type APIGatewayV2HTTPRequestContextAuthenticationClientCertValidity struct {
210+
NotAfter string `json:"notAfter"`
211+
NotBefore string `json:"notBefore"`
212+
}
213+
214+
// APIGatewayV2HTTPRequestContextAuthenticationClientCert contains client certificate information for the request caller if using mTLS..
215+
type APIGatewayV2HTTPRequestContextAuthenticationClientCert struct {
216+
ClientCertPem string `json:"clientCertPem"`
217+
IssuerDN string `json:"issuerDN"`
218+
SerialNumber string `json:"serialNumber"`
219+
SubjectDN string `json:"subjectDN"`
220+
Validity APIGatewayV2HTTPRequestContextAuthenticationClientCertValidity `json:"validity"`
221+
}
222+
223+
// APIGatewayV2HTTPRequestContextAuthentication contains authentication context information for the request caller including client certificate information if using mTLS..
224+
type APIGatewayV2HTTPRequestContextAuthentication struct {
225+
ClientCert APIGatewayV2HTTPRequestContextAuthenticationClientCert `json:"clientCert"`
226+
}
227+
228+
// APIGatewayCustomAuthorizerRequestTypeRequestIdentity contains identity information for the request caller including certificate information if using mTLS.
193229
type APIGatewayCustomAuthorizerRequestTypeRequestIdentity struct {
194-
APIKey string `json:"apiKey"`
195-
SourceIP string `json:"sourceIp"`
230+
APIKey string `json:"apiKey"`
231+
SourceIP string `json:"sourceIp"`
232+
ClientCert APIGatewayCustomAuthorizerRequestTypeRequestIdentityClientCert `json:"clientCert"`
196233
}
197234

198235
// APIGatewayCustomAuthorizerContext represents the expected format of an API Gateway custom authorizer response.

0 commit comments

Comments
 (0)