Skip to content

Commit

Permalink
SECURITY-480: build fix
Browse files Browse the repository at this point in the history
Co-authored-by: Laszlo Losonczy <laszlo.losonczy@emarsys.com>
  • Loading branch information
knagy and losonczylaci committed Jun 14, 2024
1 parent 7868769 commit a9db444
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea
.phpunit.result.cache
composer.phar
vendor/
build/
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ build: ; docker compose build
install: ; docker compose run --rm web composer install
update: ; docker compose run --rm web composer update

test: ; docker compose run --rm web ./vendor/bin/phpunit --do-not-cache-result -c phpunit.xml
test: ; docker compose run --rm web composer test
test-only: ; docker compose run --rm web ./vendor/bin/phpunit --do-not-cache-result --group only -c phpunit.xml

3 changes: 2 additions & 1 deletion test/Escher/Test/EndToEnd/CentralTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ public function signRequestTests(JsonTestCase $testCase)
$request = $testCase->getRequest();

try {
$host = $request['headers']['Host'] ?? $request['headers']['host'];
$signedHeaders = $escher->signRequest(
$testCase->getApiKey(),
$testCase->getApiSecret(),
$request['method'],
'https://' . $request['headers']['Host'] . $request['url'],
'https://' . $host . $request['url'],
$request['body'],
$request['headers'],
$testCase->getHeadersToSign(),
Expand Down
8 changes: 4 additions & 4 deletions test/Escher/Test/Helper/JsonTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function getExpectedError(): string

public function getMandatorySignedHeaders()
{
return $this->data['mandatorySignedHeaders'] ?: [];
return $this->data['mandatorySignedHeaders'] ?? [];
}

public function getAlgoPrefix(): string
Expand All @@ -155,12 +155,12 @@ public function getHashAlgo(): string

public function getAuthHeaderName(): ?string
{
return $this->data['config']['authHeaderName'];
return $this->data['config']['authHeaderName'] ?? null;
}

public function getDateHeaderName(): ?string
{
return $this->data['config']['dateHeaderName'];
return $this->data['config']['dateHeaderName'] ?? null;
}

public function getApiKey(): string
Expand All @@ -170,7 +170,7 @@ public function getApiKey(): string

public function getApiSecret(): ?string
{
return $this->data['config']['apiSecret'];
return $this->data['config']['apiSecret'] ?? null;
}

public function getKeyDb(): array
Expand Down

0 comments on commit a9db444

Please sign in to comment.