fix(server-nestjs): guard system settings upsert behind ManageSystem - #2734
Merged
Merged
Conversation
shikanime
commented
Sep 17, 2026
shikanime
commented
Sep 17, 2026
shikanime
commented
Sep 17, 2026
shikanime
force-pushed
the
fix/settings-guard
branch
from
September 17, 2026 15:44
3fb80f8 to
180faab
Compare
POST /api/v1/system/settings was served without authentication or authorization, while the legacy router requires AdminAuthorized.ManageSystem. The gap blocked the nginx-strangler cutover of the route (#2722). - add UserGuard + @RequireAdminPermission('ManageSystem') on upsert, mirroring SystemConfigController - keep GET public (legacy parity) - lock the guard contract in a controller spec Refs #2722 #1889 Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr> Change-Id: I75ca8337943706af3cd577958c5d72db6a6a6964
shikanime
force-pushed
the
fix/settings-guard
branch
from
September 17, 2026 15:45
180faab to
71bc5de
Compare
Contributor
|
🤖 Hey ! A preview of the application is available at : https://console-pr-2734.dso.cpin-hp.numerique-interieur.fr Please be patient, deployment may take a few minutes. |
UserGuard on the system-settings routes resolves AuthService through the importing module; without AuthModule the backend crashed at boot. Co-authored-by: Automata <automata@shikanime.studio> Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr>
…dule UserGuard resolves UserPermissionService through the importing module as well; the guard crashed at boot with only AuthModule imported. Co-authored-by: Automata <automata@shikanime.studio> Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr>
|
StephaneTrebel
approved these changes
Sep 28, 2026
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.

0 New Issues
0 Fixed Issues
0 Accepted Issues
No data about coverage (24.10% Estimated after merge)
Issues liées
Refs #2722
Refs #1889
Quel est le comportement actuel ?
POST /api/v1/system/settingsest servi par server-nestjs sans garde : niUserGuard, ni@RequireAdminPermission('ManageSystem'), alors que le router legacy exigeAdminAuthorized.ManageSystem. L'écart bloque la bascule nginx-strangler de la route.Quel est le nouveau comportement ?
upsertest protégé par@UseGuards(UserGuard)+@RequireAdminPermission('ManageSystem'), même anatomie queSystemConfigController(fix(server-nestjs): register SystemConfigModule to unblock system/plugins routes #2436).GETreste public (parité legacy).Cette PR introduit-elle un breaking change ?
Non pour les clients conformes : les appels légitimes sont faits par un admin authentifié, comme côté legacy. Un appel anonyme recevrait 401 après bascule — comportement voulu (#2722).
Autres informations
Gates : vitest system-settings 3/3 vert, eslint vert sur les deux fichiers.