Repository navigation
11.1.0: CakePHP 5.4, Keycloak/OIDC, security and review fixes - #110
Merged
Merged
Conversation
…erroring (cherry picked from commit 653b0fc)
(cherry picked from commit 29d0fee)
require stevenmaguire/oauth2-keycloak (cherry picked from commit 48501d6)
New Exceptions for error handling (cherry picked from commit debf42e)
(cherry picked from commit 0700e22)
(cherry picked from commit a92a1c4)
(cherry picked from commit 3600ad2)
(cherry picked from commit 0ec3055)
(cherry picked from commit 504de17)
(cherry picked from commit f18f379)
(cherry picked from commit 405b444)
…om map fields in Keycloak mapper (cherry picked from commit 83d34d8)
(cherry picked from commit 291099c)
(cherry picked from commit f522e59)
(cherry picked from commit 7df2287)
(cherry picked from commit 8ee8145)
(cherry picked from commit d3f825e)
(cherry picked from commit ad6e98b)
(cherry picked from commit 891a7b7)
…ependencies - 2FA: encode the query params of string verify urls, U2FProcessor::getUrlByType() returns array|string|null like the interface. - OIDC: validate the id token iss, aud and nonce claims, cache the discovery document and the key set with `openid.cache`. - Rbac: fix the OTPRule signature, only treat arrays with a Rule `className` as rule config. - Keycloak: drop the global social login listener and the runtime role config write, clean up the mapper and add tests. - Docs, changelog and composer suggestions for the new providers. - composer.json: require cakephp/authentication ^3.3 and CakePHP ^5.4, curate the dev dependencies for PHP 8.2 to 8.5 (lowest and highest), psalm 6 phar with a baseline, remove the stan-setup script. - Tests: replace docblock PHPUnit metadata with attributes.
- Rbac: an `allowed` or `bypassAuth` rule config whose className is not a Rule
throws instead of allowing every logged in user.
- OIDC: fetch the key set again when a token uses an unknown key id, fetch the
discovery document once per instance, check response status, log decode
errors and return a generic message, clear error without firebase/php-jwt.
New tests verify RS256 tokens against a served key set.
- Keycloak: no default roles map, case-sensitive role names.
- LinkedIn OIDC: map `validated` from the `email_verified` claim.
- Routing: use the CakePHP 5 `{provider}` placeholder, `/:provider` never matched.
- SuperuserPolicy: read the role of entity identities in the
`Auth.Authorization.checked` event.
- OneTimeTokenAuthenticator: only join token arrays that are a list of strings.
- Tests for OneTimeTokenAuthenticator, SuperuserPolicy events,
OneTimePasswordAuthenticatorComponent configuration errors and plugin routes.
…ctions - cs-check, psalm and phpstan fail the build (no more continue-on-error) - add a PHP 8.2 lowest dependencies job, the prefer-lowest matrix entry was never set - comment out the Codecov upload: uploads failed without a token since 2024 - replace the deprecated ::set-output cache steps with ramsey/composer-install - actions/checkout v5, ubuntu-24.04 for both jobs, no coverage driver - read-only token permissions, cancel superseded runs, skip pull_request runs for branches of this repository (already tested by push) - only install the PHP extensions the tests use
`Plugin` and `AuthPlugin` held the same route code. `Plugin` now extends `AuthPlugin` and is deprecated, CakePHP 5.3 expects the `AuthPlugin` name.
- testPermissions() declares its data provider with #[DataProvider('provider')],
PHPUnit 12 ignores the docblock annotation.
- testPermissions() returns void, it failed with a missing array return value.
- Empty CSV lines are skipped, rows without the "Response Contains" column work,
str_getcsv() gets an explicit escape (PHP 8.4 deprecation).
- The CSV path can be changed by overriding _permissionsCsvPath().
Deprecate legacy social mappers, fix Azure validated, Keycloak mapFields, OIDC config and checks, TwoFactorMiddleware and ServiceFactory errors, BaseTestTrait. PHPStan level 8, Psalm level 2 baseline, PHPCS warnings. Docs, changelog and copyright years.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Release 11.1.0. No public API is removed; the changes are compatible for applications using the plugin as documented. See
CHANGELOG.mdfor the full list.^5.4and PHP>=8.2;cakephp/authentication ^3.3is now a runtime dependency.rolesMapper provider alias), an OpenID Connect service and theLinkedInOpenIDConnectprovider.AuthPlugin.Upgrade notes
validatedis onlytruefor a JSON booleantrue(email_verified/xms_edov). String and numeric claims no longer count as verified.allowedorbypassAutharray must be a valid rule config (aclassNameimplementingRule); malformed arrays throwInvalidArgumentExceptioninstead of allowing every logged-in user.BaseTestTraitstores the user atAuth.Authenticators.Session.sessionKey(Auth) andprovider()must be static.resetOneTimePasswordAuthenticatordefault permission now allows users with integer ids to reset their own OTP.TwoFactorProcessorInterface::getUrlByType()may return a string; callers must handle it.providerparam now return 404 instead of 500.Security
email_verifiedorxms_edovmarks an email as validated.allowed/bypassAuthrule configs throw instead of allowing any logged-in user.iss/aud/azp/nonce; only loadsjwks_uribelowopenid.baseUrland rejects dot segments (raw or percent-encoded).mapFieldsno longer dropsid,rolesandvalidated;rolesMapworks for any provider alias.truevalidates the email.Added
rolesMap, case-sensitive, first match wins).OpenIDConnectServiceand theLinkedInOpenIDConnectprovider with discovery/JWKS caching and key rotation.OTPRuleand array rule configs for Rbac.Fixed
/auth/{provider}route matching on CakePHP 5.TypeError.SuperuserPolicyevent role,TwoFactorMiddlewarewithout an auth result, andServiceFactorywithout a provider param.openidprovider settings reachOpenIDConnectService.RuleRegistryJSON encoding errors and the Rbac match reason output.BaseTestTraittest permissions and session storage.Testing
composer check(343 tests, 825 assertions, PHPCS on 130 files) andcomposer analyse(PHPStan level 8, Psalm) pass.Notes