Skip to content

Commit e31c9a1

Browse files
committed
Rearrange struct definition order to match AWS Go project conventions
1 parent 734e78c commit e31c9a1

File tree

1 file changed

+49
-49
lines changed

1 file changed

+49
-49
lines changed

events/apigw.go

+49-49
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type APIGatewayProxyResponse struct {
2828
}
2929

3030
// 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
3232
type APIGatewayProxyRequestContext struct {
3333
AccountID string `json:"accountId"`
3434
ResourceID string `json:"resourceId"`
@@ -63,6 +63,37 @@ type APIGatewayV2HTTPRequest struct {
6363
IsBase64Encoded bool `json:"isBase64Encoded"`
6464
}
6565

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+
6697
// APIGatewayV2HTTPRequestContext contains the information to identify the AWS account and resources invoking the Lambda function.
6798
type APIGatewayV2HTTPRequestContext struct {
6899
RouteKey string `json:"routeKey"`
@@ -79,37 +110,6 @@ type APIGatewayV2HTTPRequestContext struct {
79110
Authentication APIGatewayV2HTTPRequestContextAuthentication `json:"authentication"`
80111
}
81112

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-
113113
// APIGatewayV2HTTPRequestContextHTTPDescription contains HTTP information for the request context.
114114
type APIGatewayV2HTTPRequestContextHTTPDescription struct {
115115
Method string `json:"method"`
@@ -190,28 +190,13 @@ type APIGatewayWebsocketProxyRequestContext struct {
190190
Status string `json:"status"`
191191
}
192192

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..
193+
// APIGatewayV2HTTPRequestContextAuthenticationClientCertValidity contains client certificate validity information for the request caller if using mTLS.
209194
type APIGatewayV2HTTPRequestContextAuthenticationClientCertValidity struct {
210195
NotAfter string `json:"notAfter"`
211196
NotBefore string `json:"notBefore"`
212197
}
213198

214-
// APIGatewayV2HTTPRequestContextAuthenticationClientCert contains client certificate information for the request caller if using mTLS..
199+
// APIGatewayV2HTTPRequestContextAuthenticationClientCert contains client certificate information for the request caller if using mTLS.
215200
type APIGatewayV2HTTPRequestContextAuthenticationClientCert struct {
216201
ClientCertPem string `json:"clientCertPem"`
217202
IssuerDN string `json:"issuerDN"`
@@ -225,6 +210,21 @@ type APIGatewayV2HTTPRequestContextAuthentication struct {
225210
ClientCert APIGatewayV2HTTPRequestContextAuthenticationClientCert `json:"clientCert"`
226211
}
227212

213+
// APIGatewayCustomAuthorizerRequestTypeRequestIdentityClientCertValidity contains certificate validity information for the request caller if using mTLS.
214+
type APIGatewayCustomAuthorizerRequestTypeRequestIdentityClientCertValidity struct {
215+
NotAfter string `json:"notAfter"`
216+
NotBefore string `json:"notBefore"`
217+
}
218+
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+
228228
// APIGatewayCustomAuthorizerRequestTypeRequestIdentity contains identity information for the request caller including certificate information if using mTLS.
229229
type APIGatewayCustomAuthorizerRequestTypeRequestIdentity struct {
230230
APIKey string `json:"apiKey"`

0 commit comments

Comments
 (0)