Skip to content

Commit 2e5a30a

Browse files
author
roadiz-ci
committed
chore: bumped
1 parent 93fa453 commit 2e5a30a

12 files changed

Lines changed: 47 additions & 49 deletions

‎.github/workflows/run-test.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
strategy:
2121
matrix:
22-
php-version: ['8.3', '8.4']
22+
php-version: ['8.2', '8.3']
2323
steps:
2424
- uses: shivammathur/setup-php@v2
2525
with:

‎LICENSE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright © 2025 Ambroise Maupate
3+
Copyright © 2024 Ambroise Maupate
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66

‎composer.json‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@
1313
],
1414
"prefer-stable": true,
1515
"require": {
16-
"php": ">=8.3",
16+
"php": ">=8.2",
1717
"ext-json": "*",
1818
"codercat/jwk-to-pem": "^1.0",
1919
"lcobucci/jwt": "^5.3",
2020
"lcobucci/clock": "^3.0",
2121
"psr/cache": ">=1.0.1",
22-
"roadiz/jwt": "2.6.*",
23-
"roadiz/models": "2.6.*",
24-
"roadiz/random": "2.6.*",
22+
"roadiz/jwt": "2.5.*",
23+
"roadiz/models": "2.5.*",
24+
"roadiz/random": "2.5.*",
2525
"symfony/event-dispatcher-contracts": "^3.5.1",
26-
"symfony/http-client": "7.3.*",
27-
"symfony/http-foundation": "7.3.*",
28-
"symfony/routing": "7.3.*",
29-
"symfony/security-core": "7.3.*",
30-
"symfony/security-csrf": "7.3.*",
31-
"symfony/security-http": "7.3.*"
26+
"symfony/http-client": "6.4.*",
27+
"symfony/http-foundation": "6.4.*",
28+
"symfony/routing": "6.4.*",
29+
"symfony/security-core": "6.4.*",
30+
"symfony/security-csrf": "6.4.*",
31+
"symfony/security-http": "6.4.*"
3232
},
3333
"require-dev": {
3434
"phpstan/phpstan": "^1.5.3",
@@ -46,8 +46,8 @@
4646
},
4747
"extra": {
4848
"branch-alias": {
49-
"dev-main": "2.6.x-dev",
50-
"dev-develop": "2.7.x-dev"
49+
"dev-main": "2.5.x-dev",
50+
"dev-develop": "2.6.x-dev"
5151
}
5252
}
5353
}

‎src/Authentication/OpenIdAuthenticator.php‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ public function __construct(
6060
]);
6161
}
6262

63-
#[\Override]
6463
public function supports(Request $request): ?bool
6564
{
6665
return null !== $this->discovery
@@ -70,7 +69,6 @@ public function supports(Request $request): ?bool
7069
&& ($request->query->has('code') || $request->query->has('error'));
7170
}
7271

73-
#[\Override]
7472
public function authenticate(Request $request): Passport
7573
{
7674
if (
@@ -203,13 +201,14 @@ function (Plain $jwt) {
203201
);
204202
}
205203
$passport = new Passport(
206-
new UserBadge($username, fn () =>
204+
new UserBadge($username, function () use ($jwt, $username) {
207205
/*
208206
* Load user from Identity provider, create a virtual user
209207
* with roles configured in config/packages/roadiz_rozier.yaml
210208
* and need to validate JWT token.
211209
*/
212-
$this->loadUser($jwt->claims()->all(), $username, $jwt)),
210+
return $this->loadUser($jwt->claims()->all(), $username, $jwt);
211+
}),
213212
$customCredentials
214213
);
215214
$passport->setAttribute('jwt', $jwt);
@@ -232,7 +231,6 @@ protected function loadUser(array $payload, string $identity, Plain $jwt): UserI
232231
);
233232
}
234233

235-
#[\Override]
236234
public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $firewallName): ?Response
237235
{
238236
if ($targetPath = $this->getTargetPath($request->getSession(), $firewallName)) {
@@ -242,7 +240,6 @@ public function onAuthenticationSuccess(Request $request, TokenInterface $token,
242240
return new RedirectResponse($this->urlGenerator->generate($this->defaultRoute));
243241
}
244242

245-
#[\Override]
246243
public function onAuthenticationFailure(Request $request, AuthenticationException $exception): ?Response
247244
{
248245
if ($request->hasSession()) {

‎src/Authentication/Provider/ChainJwtRoleStrategy.php‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ public function __construct(private array $strategies)
1818
}
1919
}
2020

21-
#[\Override]
2221
public function supports(): bool
2322
{
2423
foreach ($this->strategies as $strategy) {
@@ -30,7 +29,6 @@ public function supports(): bool
3029
return false;
3130
}
3231

33-
#[\Override]
3432
public function getRoles(): ?array
3533
{
3634
$roles = [];

‎src/Authentication/Provider/OpenIdAccountProvider.php‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,11 @@ public function loadUserByUsername(string $username): UserInterface
2020
throw new UserNotFoundException('Cannot load an OpenId account with its email.');
2121
}
2222

23-
#[\Override]
2423
public function loadUserByIdentifier(string $identifier): UserInterface
2524
{
2625
throw new UserNotFoundException('Cannot load an OpenId account with its email.');
2726
}
2827

29-
#[\Override]
3028
public function refreshUser(UserInterface $user): UserInterface
3129
{
3230
if ($user instanceof OpenIdAccount) {
@@ -43,7 +41,6 @@ public function refreshUser(UserInterface $user): UserInterface
4341
/**
4442
* @param class-string $class
4543
*/
46-
#[\Override]
4744
public function supportsClass(string $class): bool
4845
{
4946
return OpenIdAccount::class === $class;

‎src/Authentication/Provider/SettingsRoleStrategy.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@ public function __construct(
1515
) {
1616
}
1717

18-
#[\Override]
1918
public function supports(): bool
2019
{
2120
return !empty($this->settingsBag->get(static::SETTING_NAME));
2221
}
2322

24-
#[\Override]
2523
public function getRoles(): ?array
2624
{
2725
$settings = $this->settingsBag->get(static::SETTING_NAME);
2826
if (!is_string($settings)) {
2927
return null;
3028
}
3129

32-
return array_map(fn ($role) => trim((string) $role), explode(',', $settings));
30+
return array_map(function ($role) {
31+
return trim($role);
32+
}, explode(',', $settings));
3333
}
3434
}

‎src/Discovery.php‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public function isValid(): bool
4040
return !empty($this->discoveryUri) && filter_var($this->discoveryUri, FILTER_VALIDATE_URL);
4141
}
4242

43-
#[\Override]
4443
protected function populateParameters(): void
4544
{
4645
$cacheItem = $this->cacheAdapter->getItem(static::CACHE_KEY);
@@ -57,7 +56,11 @@ protected function populateParameters(): void
5756
$parameters = \json_decode(json: $response->getContent(), associative: true, flags: JSON_THROW_ON_ERROR);
5857
$cacheItem->set($parameters);
5958
$this->cacheAdapter->save($cacheItem);
60-
} catch (ExceptionInterface|\JsonException $exception) {
59+
} catch (ExceptionInterface $exception) {
60+
$this->logger->warning('Cannot fetch OpenID discovery parameters: '.$exception->getMessage());
61+
62+
return;
63+
} catch (\JsonException $exception) {
6164
$this->logger->warning('Cannot fetch OpenID discovery parameters: '.$exception->getMessage());
6265

6366
return;

‎src/Exception/OpenIdAuthenticationException.php‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ final class OpenIdAuthenticationException extends AuthenticationException
1111
/**
1212
* Message key to be used by the translation component.
1313
*/
14-
#[\Override]
1514
public function getMessageKey(): string
1615
{
1716
return 'An OpenID authentication exception occurred.';

‎src/OAuth2LinkGenerator.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class OAuth2LinkGenerator
1313
{
1414
public const OAUTH_STATE_TOKEN = 'openid_state';
15-
private readonly array $openIdScopes;
15+
private array $openIdScopes;
1616

1717
public function __construct(
1818
protected readonly ?Discovery $discovery,

0 commit comments

Comments
 (0)