Skip to content

Commit 9ea42ea

Browse files
committed
Remove old container and legacy URLs
1 parent b0cf509 commit 9ea42ea

13 files changed

Lines changed: 152 additions & 1013 deletions

File tree

docs/6-oidc-upgrade.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,30 @@ statements about subordinates are removed, as the final specification
153153
explicitly states that leaf entities must not have those endpoints.
154154
This effectively means that this OP implementation can only be a leaf entity
155155
in the federation context, and not a federation operator or intermediary entity.
156+
- The legacy OIDC endpoints served directly by PHP files in the module's
157+
`public` folder are now removed (as announced in the version 5 to 6 upgrade
158+
notes). These were the old routes still reachable at URLs ending in `.php`:
159+
- `<basepath>/module.php/oidc/authorize.php`
160+
- `<basepath>/module.php/oidc/token.php`
161+
- `<basepath>/module.php/oidc/userinfo.php`
162+
- `<basepath>/module.php/oidc/jwks.php`
163+
- `<basepath>/module.php/oidc/logout.php`
164+
- `<basepath>/module.php/oidc/openid-configuration.php`
165+
166+
Use the Symfony-based routes instead, which have been the default since
167+
version 6 and are the ones advertised in the OP Configuration
168+
(`.well-known/openid-configuration`) endpoint:
169+
- `<basepath>/module.php/oidc/authorization`
170+
- `<basepath>/module.php/oidc/token`
171+
- `<basepath>/module.php/oidc/userinfo`
172+
- `<basepath>/module.php/oidc/jwks`
173+
- `<basepath>/module.php/oidc/end-session`
174+
- `<basepath>/module.php/oidc/.well-known/openid-configuration`
175+
176+
Any relying party still calling the old `.php` URLs must be updated to the
177+
new routes. Note that since version 6 the OP has been publishing the new
178+
routes in its discovery metadata, so RPs that read the OP Configuration
179+
dynamically need no change.
156180

157181
Medium impact changes:
158182

hooks/hook_cron.php

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,14 @@
1414
* file that was distributed with this source code.
1515
*/
1616

17+
use SimpleSAML\Kernel;
1718
use SimpleSAML\Logger;
1819
use SimpleSAML\Module\oidc\ModuleConfig;
19-
use SimpleSAML\Module\oidc\Repositories\AccessTokenRepository;
20-
use SimpleSAML\Module\oidc\Repositories\AuthCodeRepository;
21-
use SimpleSAML\Module\oidc\Repositories\IssuerStateRepository;
22-
use SimpleSAML\Module\oidc\Repositories\PushedAuthorizationRequestRepository;
23-
use SimpleSAML\Module\oidc\Repositories\RefreshTokenRepository;
2420
use SimpleSAML\Module\oidc\Server\Exceptions\OidcServerException;
25-
use SimpleSAML\Module\oidc\Services\Container;
21+
use SimpleSAML\Module\oidc\Services\ExpiredEntriesCleaner;
2622

2723
/**
2824
* @throws \SimpleSAML\Module\oidc\Server\Exceptions\OidcServerException
29-
* @throws \Psr\Container\ContainerExceptionInterface
30-
* @throws \Psr\Container\NotFoundExceptionInterface
3125
* @throws \Exception
3226
*/
3327
function oidc_hook_cron(array &$croninfo): void
@@ -51,31 +45,15 @@ function oidc_hook_cron(array &$croninfo): void
5145
return;
5246
}
5347

54-
$container = new Container();
55-
5648
try {
57-
/** @var \SimpleSAML\Module\oidc\Repositories\AccessTokenRepository $accessTokenRepository */
58-
$accessTokenRepository = $container->get(AccessTokenRepository::class);
59-
$accessTokenRepository->removeExpired();
60-
61-
/** @var \SimpleSAML\Module\oidc\Repositories\AuthCodeRepository $authTokenRepository */
62-
$authTokenRepository = $container->get(AuthCodeRepository::class);
63-
$authTokenRepository->removeExpired();
64-
65-
/** @var \SimpleSAML\Module\oidc\Repositories\RefreshTokenRepository $refreshTokenRepository */
66-
$refreshTokenRepository = $container->get(RefreshTokenRepository::class);
67-
$refreshTokenRepository->removeExpired();
68-
69-
/** @var \SimpleSAML\Module\oidc\Repositories\IssuerStateRepository $issuerStateRepository */
70-
$issuerStateRepository = $container->get(IssuerStateRepository::class);
71-
$issuerStateRepository->removeInvalid();
72-
73-
/** @var \SimpleSAML\Module\oidc\Repositories\PushedAuthorizationRequestRepository $parRepository */
74-
$parRepository = $container->get(PushedAuthorizationRequestRepository::class);
75-
$parRepository->removeExpired();
49+
$kernel = new Kernel(ModuleConfig::MODULE_NAME);
50+
$kernel->boot();
51+
/** @var \SimpleSAML\Module\oidc\Services\ExpiredEntriesCleaner $cleaner */
52+
$cleaner = $kernel->getContainer()->get(ExpiredEntriesCleaner::class);
53+
$cleaner->clean();
7654

7755
$croninfo['summary'][] = 'Module `oidc` clean up. Removed expired entries from storage.';
78-
} catch (Exception $e) {
56+
} catch (Throwable $e) {
7957
$message = 'Module `oidc` clean up cron script failed: ' . $e->getMessage();
8058
Logger::warning($message);
8159
$croninfo['summary'][] = $message;

public/authorize.php

Lines changed: 0 additions & 20 deletions
This file was deleted.

public/jwks.php

Lines changed: 0 additions & 20 deletions
This file was deleted.

public/logout.php

Lines changed: 0 additions & 20 deletions
This file was deleted.

public/openid-configuration.php

Lines changed: 0 additions & 20 deletions
This file was deleted.

public/token.php

Lines changed: 0 additions & 20 deletions
This file was deleted.

public/userinfo.php

Lines changed: 0 additions & 20 deletions
This file was deleted.

routing/services/services.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ services:
2424

2525
SimpleSAML\Module\oidc\Services\:
2626
resource: '../../src/Services/*'
27-
exclude: '../../src/Services/{Container.php}'
27+
28+
# Fetched from the (otherwise private) container by the cron hook after booting the module Kernel.
29+
SimpleSAML\Module\oidc\Services\ExpiredEntriesCleaner:
30+
public: true
2831

2932
SimpleSAML\Module\oidc\Repositories\:
3033
resource: '../../src/Repositories/*'

0 commit comments

Comments
 (0)