Skip to content

Commit

Permalink
MLPAB-1375: Tag evidence on upload (#736)
Browse files Browse the repository at this point in the history
  • Loading branch information
acsauk authored Sep 29, 2023
1 parent e605665 commit 4fcfb21
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/page/donor/upload_evidence.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func UploadEvidence(tmpl template.Template, payer Payer, donorStore DonorStore,
Key: aws.String(key),
Body: bytes.NewReader(file.Data),
ServerSideEncryption: types.ServerSideEncryptionAwsKms,
Tagging: aws.String("replicate=true"),
})
if err != nil {
return err
Expand Down
2 changes: 2 additions & 0 deletions internal/page/donor/upload_evidence_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,15 @@ func TestPostUploadEvidence(t *testing.T) {
On("PutObject", r.Context(), mock.MatchedBy(func(input *s3.PutObjectInput) bool {
return assert.Equal(t, aws.String("bucket-name"), input.Bucket) &&
assert.Equal(t, aws.String("lpa-uid-evidence-a-uid"), input.Key) &&
assert.Equal(t, aws.String("replicate=true"), input.Tagging) &&
assert.Equal(t, types.ServerSideEncryptionAwsKms, input.ServerSideEncryption)
})).
Return(nil, nil)
s3Client.
On("PutObject", r.Context(), mock.MatchedBy(func(input *s3.PutObjectInput) bool {
return assert.Equal(t, aws.String("bucket-name"), input.Bucket) &&
assert.Equal(t, aws.String("lpa-uid-evidence-a-uid"), input.Key) &&
assert.Equal(t, aws.String("replicate=true"), input.Tagging) &&
assert.Equal(t, types.ServerSideEncryptionAwsKms, input.ServerSideEncryption)
})).
Return(nil, nil)
Expand Down
1 change: 1 addition & 0 deletions terraform/environment/region/modules/app/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ data "aws_iam_policy_document" "task_role_access_policy" {
effect = "Allow"
actions = [
"s3:PutObject",
"s3:PutObjectTagging",
"s3:DeleteObject",
]
resources = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,6 @@ data "aws_iam_policy_document" "bucket" {
identifiers = ["*"]
}
}

provider = aws.region
}

0 comments on commit 4fcfb21

Please sign in to comment.