Skip to content

Commit

Permalink
v2.5.0 -- Allow symfony 7.x and don't use public-read when uploading …
Browse files Browse the repository at this point in the history
…to s3
  • Loading branch information
gdbrown committed Jan 26, 2024
1 parent bf677c1 commit 18a1447
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 22 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG-2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
This changelog references the relevant changes done in 2.x versions.


## v2.5.0
* Require php 8.3.
* Allow symfony 7.x
* Do not use public-read when uploading to s3.


## v2.4.4
* Check for empty unslotted nodes in SearchTeasersRequestHandler and SearchArticlesRequestHandler.

Expand Down
30 changes: 15 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@
"type": "library",
"license": "Apache-2.0",
"require": {
"php": ">=8.1",
"php": ">=8.3",
"ext-apcu": "*",
"ext-json": "*",
"ext-openssl": "*",
"ext-redis": "*",
"ext-zlib": "*",
"aws/aws-sdk-php-symfony": "^2.2",
"gdbots/app-bundle": "^2.4",
"gdbots/crypto-bundle": "^3.1",
"aws/aws-sdk-php-symfony": "^2.6",
"gdbots/app-bundle": "^2.5",
"gdbots/crypto-bundle": "^3.2",
"gdbots/enrichments": "^3.0",
"gdbots/iam-bundle": "^3.0",
"google/apiclient": "^2.9",
"guzzlehttp/oauth-subscriber": "~0.5",
"ruflin/elastica": "^7.1",
"symfony/asset": "^6.2",
"symfony/expression-language": "^6.2",
"symfony/monolog-bundle": "^3.7",
"symfony/twig-bundle": "^6.2",
"symfony/web-link": "^6.2",
"symfony/yaml": "^6.2",
"gdbots/iam-bundle": "^3.1",
"google/apiclient": "^2.15",
"guzzlehttp/oauth-subscriber": "~0.6",
"ruflin/elastica": "^7.3",
"symfony/asset": "^6.4 || ^7.0",
"symfony/expression-language": "^6.4 || ^7.0",
"symfony/monolog-bundle": "^3.10",
"symfony/twig-bundle": "^6.4 || ^7.0",
"symfony/web-link": "^6.4 || ^7.0",
"symfony/yaml": "^6.4 || ^7.0",
"triniti/schemas": "^3.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"phpunit/phpunit": "^10.5",
"triniti/acme-schemas": "^3.0"
},
"autoload": {
Expand Down
1 change: 1 addition & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<testsuites>
<testsuite name="Triniti">
<directory>tests/</directory>
<exclude>tests/AbstractPbjxTest.php</exclude>
</testsuite>
</testsuites>

Expand Down
2 changes: 1 addition & 1 deletion src/Dam/AssetUploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ protected function uploadToS3(AssetId $assetId, string $filename, array $options
'Key' => $options['key'] ?? $assetId->toFilePath($version, $quality),
'SourceFile' => $filename,
'ContentType' => $mimeType,
'ACL' => $options['acl'] ?? 'public-read',
'ACL' => $options['acl'] ?? 'bucket-owner-full-control',
'CacheControl' => 'max-age=31536000', // 1 year
'Metadata' => $metadata,
]);
Expand Down
2 changes: 1 addition & 1 deletion src/Dam/GetUploadUrlsRequestHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function handleRequest(Message $request, Pbjx $pbjx): Message
$command = $this->s3Client->getCommand('PutObject', [
'Bucket' => $this->bucket,
'Key' => $assetId->toFilePath($version, $quality),
'ACL' => 'public-read',
// 'ACL' => 'public-read',
'CacheControl' => 'max-age=31536000', // 1 year
'Metadata' => [
'asset-ref' => $this->assetIdToNodeRef($assetId)->toString(),
Expand Down
4 changes: 2 additions & 2 deletions tests/AppleNews/AppleNewsApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function setUp(): void
'secret',
]
)
->setMethods(
->onlyMethods(
[
'getGuzzleClient',
]
Expand Down Expand Up @@ -278,7 +278,7 @@ public function testCreateArticleNotification(): void
$this->assertTrue($response['ok']);
}

public function providerTestRequestInvalidStatusCode(): array
public static function providerTestRequestInvalidStatusCode(): array
{
/* status code*/
return [
Expand Down
2 changes: 1 addition & 1 deletion tests/AppleNews/ArticleDocumentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function testJsonSerialize(): void
$this->assertJsonStringEqualsJsonString($expectedJson, json_encode($this->articleDocument));
}

public function providerTestMissingGlobalSettings(): array
public static function providerTestMissingGlobalSettings(): array
{
$docMissingComponentLayout = new ArticleDocument();
$docMissingComponentLayout->setIdentifier('identifier');
Expand Down
2 changes: 2 additions & 0 deletions tests/Curator/TeaserableWatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

final class TeaserableWatcherTest extends AbstractPbjxTest
{
protected MockNcr $ncr;

public function setup(): void
{
parent::setup();
Expand Down
2 changes: 1 addition & 1 deletion tests/Dam/AssetEnricherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function testEnrichWithS3Object(): void
/** @var S3Client|MockObject $s3Client */
$s3Client = $this->getMockBuilder(S3Client::class)
->disableOriginalConstructor()
->setMethods(['headObject'])
->addMethods(['headObject'])
->getMock();
$s3Client->method('headObject')
->willReturn([
Expand Down
2 changes: 1 addition & 1 deletion tests/Notify/Notifier/AppleNewsNotifierTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ protected function setup(): void
$marshaler,
]
)
->setMethods(
->onlyMethods(
[
'createArticleDocument',
'updateArticleDocument',
Expand Down

0 comments on commit 18a1447

Please sign in to comment.