Repository navigation
chore: update api, pwa and ops dependencies - #719
Open
vincentchalamon wants to merge 12 commits into
Open
vincentchalamon wants to merge 12 commits into
vincentchalamon wants to merge 12 commits into
Conversation
Also upgrades symfony/mercure-bundle to 0.7 and symfony/mercure to 0.10. The app already uses the Hub API, protocol 1.0 and the iss/sub/client_id claims that 0.6 requires.
Mercure was unpinned: xcaddy built whatever was latest. Pin it so that upgrades are explicit. Since 1.14, the version-only tags ship PHP 8.6: use the php8.5 builder too, a binary linked against libphp 8.6 segfaults on the php8.5 runtime. PHP 8.6 waits for an APCu release supporting it. The builder now ships Go 1.27.4, which satisfies mercure/caddy (go 1.27.3): drop the GOTOOLCHAIN=auto workaround.
… external-dns chart to 1.24
ra-core 5.15.7 no longer depends on query-string, which @api-platform/admin imports without declaring it: declare it through packageExtensions, on the 7.x line, the last one with named exports. Drop the overrides whose direct dependencies now ship the fixes (postcss, js-yaml, brace-expansion, dompurify, sharp, browserslist): only undici is still needed.
The keycloak-logout route handler redirects off-site: it needs a full page load, which neither redirect() nor router.push() provide.
Components are configured at their root keys since Symfony 8.2, and the recipes drop the options matching the new defaults. Kept as is: the migrations path and namespace (the doctrine_migration_versions table of existing databases references DoctrineMigrations\*), the Mercure claims (the issuer must match the Caddyfile) and the stateless firewalls (no session to check users on refresh).
Its rules moved to the CODE_QUALITY set.
JWSLoader::loadAndVerifyWithKeySet() is deprecated since web-token 4.3. Also check the headers of the signature that was verified instead of always the first one.
DBAL 4 no longer uses them, so a database built from the migrations was out of sync with the mapping. Foundry recreated the schema before each test run, which hid it; the foundry 2.17 recipe now resets the database with the migrations.
Since Symfony 8.2, the access token authenticator is the fallback entry point of the firewall and answers anonymous requests with a text/plain 401. Restore the 401 HttpException that API Platform renders as an application/problem+json error.
Since Keycloak 26.8, the Admin REST API only accepts tokens carrying the kc-admin-api scope and the Admin API audience. ResourceResourceHandler manages the user-owned resources through it with the token of api-platform-api, so the fixtures and every book, bookmark and review creation failed with a 401. The scope is declared in the realm too: Keycloak creates it after the import, so a client of an imported realm could not reference it otherwise.
This branch has not been deployed
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.
Met à jour toutes les dépendances vers la dernière version stable, dont Mercure 1.1.7 (release de sécurité : 13 vulnérabilités, 5 rated high) et Symfony 8.2.
API
chore(api): upgrade symfony to 8.2 and update composer dependenciessymfony/mercure-bundle0.5 → 0.7 (symfony/mercure0.10) : la config utilise déjà le protocole 1.0, l'APIHubet les claimsiss/sub/client_idexigés depuis 0.6chore(api): upgrade frankenphp to 1.14 and mercure to 1.1.7chore(api): update symfony recipeschore(api): drop the INSTANCEOF rector set removed in rector 2.9CODE_QUALITYrefactor(api): verify JWS with loadAndVerify()loadAndVerifyWithKeySet()est déprécié depuis web-token 4.3 ; vérifie aussi les en-têtes de la signature validée plutôt que toujours la premièrefix(api): drop the DC2Type column commentsfix(api): keep problem details for anonymous requestsFrankenPHP 1.14 et Mercure 1.1.7
github.com/dunglas/mercure/caddy@v1.1.7), la build embarque Mercure 1.1.7 et Caddy 2.11.9. Côté app, rien à changer : uniquement des matchersmatchexacts, pas d'ID publiés, transport Bolt sanssize.1.14.0-builder: un binaire lié contre libphp 8.6 segfault sur le runtimephp8.5. On utilise donc1.14.0-builder-php8.5. PHP 8.6 attend une release d'APCu qui le supporte.mercure/caddy(go 1.27.3) : le contournementGOTOOLCHAIN=autoest retiré.Recettes Symfony
Depuis Symfony 8.2, les composants se configurent à leur propre clé racine (
cache:,router:, …) et les recettes retirent les options devenues des valeurs par défaut.config/schema.json(généré par Symfony 8.2) est versionné, commeconfig/reference.php.Non appliqué :
src/Migrations(namespaceApp\Migrations). La tabledoctrine_migration_versionsdes bases existantes référenceDoctrineMigrations\*: seulsymfony.lockest mis à jour ;MERCURE_JWT_ISSUER; l'issuer reste fixe (api-platform-demo), il doit correspondre au Caddyfile ;user_checker_on_refreshne concerne que les firewalls avec session, les nôtres sont stateless ;.symfony.local.yaml(Symfony CLI, inutilisée ici) etsession.isolate_attributes(session désactivée).Réponses 401 anonymes
Depuis Symfony 8.2,
AccessTokenAuthenticatorest le point d'entrée « fallback » du firewall et répond lui-même aux requêtes anonymes par une 401text/plain, au lieu de l'erreurapplication/problem+jsonrendue par API Platform (17 tests en échec).ProblemDetailsEntryPointrétablit l'HttpException401 de Symfony 8.1.Commentaires
DC2TypeUne base construite par les migrations n'était pas synchronisée avec le mapping (y compris sur
main, donc en prod) : la migration de 2023 pose des commentaires(DC2Type:...)que DBAL 4 n'utilise plus. Foundry recréait le schéma avant les tests, ce qui le masquait ; la recette Foundry 2.17 réinitialise désormais la base via les migrations. La nouvelle migration retire ces commentaires.PWA
chore(pwa): update dependencies and upgrade pnpm to 12.26style(pwa): silence a false positive of the next 16.4 eslint pluginno-location-assign-relative-destinationsur la déconnexion : le route handler redirige vers Keycloak, il faut un chargement complet de pagera-core5.15.7 ne dépend plus dequery-string, que@api-platform/admin4.0.9 importe sans le déclarer : il est déclaré viapackageExtensions, en 7.x (les versions suivantes n'ont plus d'export nomméstringify).postcss,js-yaml,brace-expansion,dompurify,sharp,browserslist(les dépendances directes embarquent désormais les correctifs). Seulundicireste nécessaire.main: GHSA-vcc3-ghjq-m6fr et GHSA-qr28-fpjm-wq7f (decode-uri-componentviaquery-string@7). La version corrigée est ESM-only et casse les listes react-admin. L'admin n'appelle questringify, qui ne décode rien.eslint-plugin-react/import/jsx-a11y, tirés pareslint-config-next, plafonnent à ESLint 9) et TypeScript 7 (typescript-eslintexige<6.1.0).OPS
chore(helm): upgrade keycloak to 26.8, keycloak-config-cli to 6.6 and external-dns chart to 1.24fix(helm): grant the kc-admin-api scope to the API clientchore(e2e): update playwright to 1.65e2eet image de la CIGitHub Actions : déjà à jour (Renovate).
Keycloak 26.8 et l'API admin
Depuis 26.8, l'Admin REST API n'accepte que les tokens portant le scope
kc-admin-apiet l'audience de l'API admin du realm.ResourceResourceHandlergère les ressources des utilisateurs via cette API avec le token deapi-platform-api: les fixtures et toute création de livre, favori ou avis échouaient en 401. Le scope est ajouté aux scopes par défaut du client et déclaré dans le realm : Keycloak le crée après l'import, donc un client d'un realm importé ne peut pas le référencer autrement.Vérifications locales
doctrine:schema:validate, PHPStan, Rector : OKtsc,pnpm build,pnpm audit(hors advisories ci-dessus) : OK@read24 passed / 2 flaky,@write8 passed / 3 flaky, même profil que la CI demain