Skip to content

Commit 314b137

Browse files
turegjorupclaude
andcommitted
release: 5.0.0
Roll up the [Unreleased] section into 5.0.0 dated 2026-06-02. MAJOR per SemVer — the bundle's exception hierarchy is reworked onto the marker interface OpenIdConnectBundleExceptionInterface (extending the upstream library marker), concrete exceptions re-parent onto SPL types and no longer extend the now-deprecated ItkOpenIdConnectBundleException, and the itk-dev/openid-connect requirement moves to ^5.0. Adds the marker, custom contract-locking PHPStan rules, hardened static analysis, and an UPGRADE-5.0.md consumer migration guide. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 01697c8 commit 314b137

2 files changed

Lines changed: 83 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [5.0.0] - 2026-06-02
11+
1012
### Changed (BREAKING)
1113

1214
- **Exception hierarchy reworked.** Every exception thrown from a public
@@ -38,6 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3840
CI run — thrown exceptions must implement the marker (with documented
3941
controller/authenticator carve-outs), and wraps inside a catch must chain
4042
the caught cause as `$previous`.
43+
- `UPGRADE-5.0.md` migration guide for consumers.
4144

4245
### Changed
4346

@@ -204,7 +207,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
204207
`itk-dev/openid-connect` 1.0.0 to 2.1.0
205208
- OpenId Connect Bundle: Added CLI login feature.
206209

207-
[unreleased]: https://github.com/itk-dev/openid-connect-bundle/compare/4.2.0...HEAD
210+
[unreleased]: https://github.com/itk-dev/openid-connect-bundle/compare/5.0.0...HEAD
211+
[5.0.0]: https://github.com/itk-dev/openid-connect-bundle/compare/4.2.0...5.0.0
208212
[4.2.0]: https://github.com/itk-dev/openid-connect-bundle/compare/4.1.0...4.2.0
209213
[4.1.0]: https://github.com/itk-dev/openid-connect-bundle/compare/4.0.1...4.1.0
210214
[4.0.1]: https://github.com/itk-dev/openid-connect-bundle/compare/4.0.0...4.0.1

UPGRADE-5.0.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Upgrading from 4.x to 5.0
2+
3+
5.0 reworks the bundle's exception hierarchy onto a marker interface and
4+
bumps the `itk-dev/openid-connect` requirement to `^5.0`. Runtime behaviour
5+
is unchanged — this document covers the consumer-visible API changes you'll
6+
need to adjust catch blocks for.
7+
8+
See the architecture decision in
9+
[docs/adr/001-marker-interface-exception-hierarchy.md](docs/adr/001-marker-interface-exception-hierarchy.md).
10+
11+
## Catch the marker interface, not the abstract
12+
13+
Concrete bundle exceptions no longer extend
14+
`\ItkDev\OpenIdConnectBundle\Exception\ItkOpenIdConnectBundleException`.
15+
Existing catches against the abstract will not match anything thrown by
16+
5.0+ code:
17+
18+
```diff
19+
- } catch (\ItkDev\OpenIdConnectBundle\Exception\ItkOpenIdConnectBundleException $e) {
20+
+ } catch (\ItkDev\OpenIdConnectBundle\Exception\OpenIdConnectBundleExceptionInterface $e) {
21+
```
22+
23+
The abstract class is kept through the 5.x line as a `@deprecated` alias
24+
that still implements the marker; removal is scheduled for 6.0.
25+
26+
`OpenIdConnectBundleExceptionInterface` **extends** the upstream library's
27+
`\ItkDev\OpenIdConnect\Exception\OpenIdConnectExceptionInterface`, so a
28+
single catch handles failures from both packages:
29+
30+
```php
31+
try {
32+
$claims = $this->validateClaims($request);
33+
} catch (\ItkDev\OpenIdConnect\Exception\OpenIdConnectExceptionInterface $e) {
34+
// catches both library- and bundle-thrown OIDC failures
35+
}
36+
```
37+
38+
## Catch on SPL types still works
39+
40+
Each concrete now extends the SPL type that best fits its failure category,
41+
so catches at the SPL level continue to match:
42+
43+
| Concrete | Parent | When it fires |
44+
| --- | --- | --- |
45+
| `InvalidProviderException` | `\InvalidArgumentException` | Unknown provider key requested from the manager |
46+
| `UsernameDoesNotExistException` | `\InvalidArgumentException` | CLI login resolved a token to no username |
47+
| `CacheException` | `\RuntimeException` | PSR-6 cache layer failed during CLI login token handling |
48+
| `TokenNotFoundException` | `\RuntimeException` | CLI login token not found in the cache |
49+
| `UserDoesNotExistException` | `\RuntimeException` | Configured user provider has no matching user |
50+
51+
For example, code catching the raw `\InvalidArgumentException` around a
52+
provider lookup keeps working, because `InvalidProviderException` still
53+
extends it:
54+
55+
```php
56+
try {
57+
$provider = $providerManager->getProvider($key);
58+
} catch (\InvalidArgumentException $e) { // still catches in 5.0
59+
// ...
60+
}
61+
```
62+
63+
## Update the dependency constraint
64+
65+
If your application pins the bundle, bump it to `^5.0`. The bundle now
66+
requires `itk-dev/openid-connect:^5.0`; review that library's
67+
[UPGRADE-5.0.md](https://github.com/itk-dev/openid-connect/blob/main/UPGRADE-5.0.md)
68+
for its own contract changes (it reworks the same exception hierarchy and
69+
tightens several IdP-payload validations).
70+
71+
## Framework-boundary exceptions are unchanged
72+
73+
`LoginController` still ships Symfony `HttpException` subclasses
74+
(`NotFoundHttpException` for an unknown provider → 404,
75+
`ServiceUnavailableHttpException` for an unreachable IdP / cache failure →
76+
503), and authenticators still throw `AuthenticationException`. These are a
77+
documented carve-out from the wrap-at-boundary rule and did not change in
78+
5.0; the OIDC cause remains chained via `$previous`.

0 commit comments

Comments
 (0)