Skip to content

Commit

Permalink
fix: audience in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hschoenenberger committed Feb 6, 2025
1 parent cded0b7 commit 7b7747a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tests/Feature/Api/v2/ShopHealthCheck/ShowTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,12 @@ public function itShouldShowPrivateHealthCheck()
*/
public function itShouldFailWithInvalidBearer()
{
$shop = $this->shopProvider->formatShopData((array) \Shop::getShop(1));

$response = $this->client->get('/module/ps_accounts/apiV2ShopHealthCheck', [
'headers' => [
'Authorization' => 'Bearer: ' . 'some-invalid-bearer',
],
'query' => [
'shop_id' => $shop->id,
'shop_id' => 1,
],
]);

Expand Down Expand Up @@ -239,7 +237,7 @@ public function itShouldFailWithInvalidShopId()
'headers' => [
'Authorization' => 'Bearer ' . $this->makeBearer([
'aud' => [
'shop_' . $shop->id,
'shop_' . $shop->uuid,
],
]),
],
Expand All @@ -265,6 +263,12 @@ public function itShouldFailWithInvalidShopId()
*/
public function makeBearer(array $data)
{
// if (!isset($data['iat'])) {
// $data['iat'] = time();
// }
// if (!isset($data['exp'])) {
// $data['exp'] = time() + 3600;
// }
return JWT::encode($data, $this->privateKey, 'RS256', 'public:hydra.jwt.access-token');
}

Expand Down

0 comments on commit 7b7747a

Please sign in to comment.