Skip to content

Commit 855955a

Browse files
committed
Fix naming
1 parent aee84a2 commit 855955a

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

events/apigw.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,19 @@ type APIGatewayV2HTTPRequestContextAuthorizerJWTDescription struct {
9494
// APIGatewayV2HTTPRequestContextAuthorizerIAMDescription contains IAM information for the request context.
9595
type APIGatewayV2HTTPRequestContextAuthorizerIAMDescription struct {
9696
AccessKey string `json:"accessKey"`
97-
AccountId string `json:"accountId"`
98-
CallerId string `json:"callerId"`
97+
AccountID string `json:"accountId"`
98+
CallerID string `json:"callerId"`
9999
CognitoIdentity APIGatewayV2HTTPRequestContextAuthorizerCognitoIdentity `json:"cognitoIdentity,omitempty"`
100-
PrincipalOrgId string `json:"principalOrgId"`
101-
UserArn string `json:"userArn"`
102-
UserId string `json:"userId"`
100+
PrincipalOrgID string `json:"principalOrgId"`
101+
UserARN string `json:"userArn"`
102+
UserID string `json:"userId"`
103103
}
104104

105105
// APIGatewayV2HTTPRequestContextAuthorizerCognitoIdentity contains Cognito identity information for the request context.
106106
type APIGatewayV2HTTPRequestContextAuthorizerCognitoIdentity struct {
107-
Amr []string `json:"amr"`
108-
IdentityId string `json:"identityId"`
109-
IdentityPoolId string `json:"identityPoolId"`
107+
AMR []string `json:"amr"`
108+
IdentityID string `json:"identityId"`
109+
IdentityPoolID string `json:"identityPoolId"`
110110
}
111111

112112
// APIGatewayV2HTTPRequestContextHTTPDescription contains HTTP information for the request context.

events/apigw_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -299,28 +299,28 @@ func TestApiGatewayV2HTTPRequestIAMMarshaling(t *testing.T) {
299299
if authContext.IAM.AccessKey != "ARIA2ZJZYVUEREEIHAKY" {
300300
t.Errorf("could not extract accessKey from IAM authorizer: %v", authContext)
301301
}
302-
if authContext.IAM.AccountId != "1234567890" {
302+
if authContext.IAM.AccountID != "1234567890" {
303303
t.Errorf("could not extract accountId from IAM authorizer: %v", authContext)
304304
}
305-
if authContext.IAM.CallerId != "AROA7ZJZYVRE7C3DUXHH6:CognitoIdentityCredentials" {
305+
if authContext.IAM.CallerID != "AROA7ZJZYVRE7C3DUXHH6:CognitoIdentityCredentials" {
306306
t.Errorf("could not extract callerId from IAM authorizer: %v", authContext)
307307
}
308-
if authContext.IAM.CognitoIdentity.Amr[0] != "foo" {
308+
if authContext.IAM.CognitoIdentity.AMR[0] != "foo" {
309309
t.Errorf("could not extract amr from CognitoIdentity: %v", authContext)
310310
}
311-
if authContext.IAM.CognitoIdentity.IdentityId != "us-east-1:3f291106-8703-466b-8f2b-3ecee1ca56ce" {
311+
if authContext.IAM.CognitoIdentity.IdentityID != "us-east-1:3f291106-8703-466b-8f2b-3ecee1ca56ce" {
312312
t.Errorf("could not extract identityId from CognitoIdentity: %v", authContext)
313313
}
314-
if authContext.IAM.CognitoIdentity.IdentityPoolId != "us-east-1:4f291106-8703-466b-8f2b-3ecee1ca56ce" {
314+
if authContext.IAM.CognitoIdentity.IdentityPoolID != "us-east-1:4f291106-8703-466b-8f2b-3ecee1ca56ce" {
315315
t.Errorf("could not extract identityPoolId from CognitoIdentity: %v", authContext)
316316
}
317-
if authContext.IAM.PrincipalOrgId != "AwsOrgId" {
317+
if authContext.IAM.PrincipalOrgID != "AwsOrgId" {
318318
t.Errorf("could not extract principalOrgId from IAM authorizer: %v", authContext)
319319
}
320-
if authContext.IAM.UserArn != "arn:aws:iam::1234567890:user/Admin" {
320+
if authContext.IAM.UserARN != "arn:aws:iam::1234567890:user/Admin" {
321321
t.Errorf("could not extract userArn from IAM authorizer: %v", authContext)
322322
}
323-
if authContext.IAM.UserId != "AROA2ZJZYVRE7Y3TUXHH6" {
323+
if authContext.IAM.UserID != "AROA2ZJZYVRE7Y3TUXHH6" {
324324
t.Errorf("could not extract userId from IAM authorizer: %v", authContext)
325325
}
326326

0 commit comments

Comments
 (0)