Skip to content

Commit d3985f2

Browse files
committed
CCM-9874: cookie casing
1 parent 65908e9 commit d3985f2

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

infrastructure/terraform/modules/backend-api/iam_role_guardduty_quarantine.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ data "aws_iam_policy_document" "guardduty_quarantine" {
7373
sid = "AllowPostScanTag"
7474
effect = "Allow"
7575
actions = [
76-
"S3:PutObjectTagging",
77-
"S3:GetObjectTagging",
78-
"S3:PutObjectVersionTagging",
79-
"S3:GetObjectVersionTagging"
76+
"s3:PutObjectTagging",
77+
"s3:GetObjectTagging",
78+
"s3:PutObjectVersionTagging",
79+
"s3:GetObjectVersionTagging"
8080
]
8181

8282
resources = [

lambdas/download-authorizer/src/__tests__/index.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ describe('download authorizer handler', () => {
6868
});
6969

7070
const uri = `/${subject}/template-id/proof1.pdf`;
71-
const cookie = `CognitoIdentityServiceProvider.${userPoolClientId}.${subject}.AccessToken=jwt`;
71+
const cookie = `CognitoIdentityServiceProvider.${userPoolClientId}.${subject}.accessToken=jwt`;
7272

7373
const event = mock<CloudFrontRequestEvent>(makeEvent(uri, cookie));
7474

@@ -89,7 +89,7 @@ describe('download authorizer handler', () => {
8989
test('returns denial if cognito configuration is not present in custom headers', async () => {
9090
const uri = '/subject/template-id/proof1.pdf';
9191
const cookie =
92-
'CognitoIdentityServiceProvider.user-pool-client-id.subject.AccessToken=jwt';
92+
'CognitoIdentityServiceProvider.user-pool-client-id.subject.accessToken=jwt';
9393

9494
const event = mock<CloudFrontRequestEvent>(
9595
makeEvent(uri, cookie, {
@@ -122,7 +122,7 @@ describe('download authorizer handler', () => {
122122

123123
test('returns denial if authorization fails', async () => {
124124
const uri = '/subject/template-id/proof1.pdf';
125-
const cookie = `CognitoIdentityServiceProvider.${userPoolClientId}.subject.AccessToken=jwt`;
125+
const cookie = `CognitoIdentityServiceProvider.${userPoolClientId}.subject.accessToken=jwt`;
126126

127127
lambdaCognitoAuthorizer.authorize.mockResolvedValue({
128128
success: false,

lambdas/download-authorizer/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function parseRequest(request: CloudFrontRequest) {
2121
const userPoolId = customHeaders?.['x-user-pool-id']?.[0]?.value;
2222
const userPoolClientId = customHeaders?.['x-user-pool-client-id']?.[0]?.value;
2323

24-
const accessTokenKey = `CognitoIdentityServiceProvider.${userPoolClientId}.${ownerPathComponent}.AccessToken`;
24+
const accessTokenKey = `CognitoIdentityServiceProvider.${userPoolClientId}.${ownerPathComponent}.accessToken`;
2525

2626
const cookies = parseCookie(request.headers.cookie?.[0]?.value ?? '');
2727
const authorizationToken = cookies[accessTokenKey];

0 commit comments

Comments
 (0)