Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send SSE AES256 header by default #174

Merged
merged 2 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes for Amazon S3 for Craft CMS

## 2.2.0 - 2024-03-13

- Uploads will now include the `x-amz-server-side-encryption=AES256` header for parity with S3 defaults. (Thanks @drieshooghe!) [#172](https://github.com/craftcms/aws-s3/pull/172)

## 2.1.0 - 2024-03-11

- Added Craft 5 compatibility.
Expand Down
18 changes: 17 additions & 1 deletion src/Fs.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,23 @@ public function getRootUrl(): ?string
protected function createAdapter(): FilesystemAdapter
{
$client = static::client($this->_getConfigArray(), $this->_getCredentials());
return new AwsS3V3Adapter($client, Craft::parseEnv($this->bucket), $this->_subfolder(), new PortableVisibilityConverter($this->visibility()), null, [], false);
$options = [

// This is the S3 default for all objects, but explicitly
// sending the header allows for bucket policies that require it.
// @see https://github.com/craftcms/aws-s3/pull/172
'ServerSideEncryption' => 'AES256',
];

return new AwsS3V3Adapter(
$client,
App::parseEnv($this->bucket),
$this->_subfolder(),
new PortableVisibilityConverter($this->visibility()),
null,
$options,
false,
);
}

/**
Expand Down
Loading