editoast: add authorization to the rolling stock endpoints - #17364
Draft
younesschrifi wants to merge 24 commits into
Draft
editoast: add authorization to the rolling stock endpoints#17364younesschrifi wants to merge 24 commits into
younesschrifi wants to merge 24 commits into
Conversation
Sh099078
force-pushed
the
feature-branch/check-rolling-stock-privileges
branch
from
June 24, 2026 15:41
61083bb to
016cefe
Compare
Contributor
|
rebased on |
This was referenced Jun 25, 2026
younesschrifi
force-pushed
the
feature-branch/check-rolling-stock-privileges
branch
from
June 26, 2026 14:04
9cda363 to
af93581
Compare
Sh099078
force-pushed
the
feature-branch/check-rolling-stock-privileges
branch
from
June 29, 2026 14:35
af93581 to
49c63ff
Compare
Contributor
|
rebase on |
younesschrifi
force-pushed
the
feature-branch/check-rolling-stock-privileges
branch
from
July 1, 2026 07:53
49c63ff to
25b1202
Compare
Contributor
Author
|
rebase on dev |
younesschrifi
force-pushed
the
feature-branch/check-rolling-stock-privileges
branch
from
July 3, 2026 12:33
25b1202 to
c6e470e
Compare
younesschrifi
force-pushed
the
feature-branch/check-rolling-stock-privileges
branch
from
July 15, 2026 07:19
77c7390 to
3d24d43
Compare
Sh099078
force-pushed
the
feature-branch/check-rolling-stock-privileges
branch
from
July 17, 2026 18:46
89df84a to
86fba80
Compare
Contributor
|
rebased on dev |
Sh099078
force-pushed
the
feature-branch/check-rolling-stock-privileges
branch
from
July 21, 2026 10:18
86fba80 to
6ff73e4
Compare
Contributor
|
rebased on dev |
Contributor
|
Sh099078
force-pushed
the
feature-branch/check-rolling-stock-privileges
branch
from
July 26, 2026 18:54
13cf304 to
e6c0c41
Compare
Contributor
|
rebase on dev |
Sh099078
force-pushed
the
feature-branch/check-rolling-stock-privileges
branch
from
July 30, 2026 19:33
e6c0c41 to
91e0817
Compare
Contributor
|
rebased on |
Contributor
|
rebased on dev |
Sh099078
force-pushed
the
feature-branch/check-rolling-stock-privileges
branch
2 times, most recently
from
August 12, 2026 11:17
c53a018 to
a9f83e3
Compare
Signed-off-by: Youness CHRIFI ALAOUI <youness.chrifi@gmail.com> Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com>
add privileges checks for get_by_id and get_by_name rolling stock endpoints. Signed-off-by: Youness CHRIFI ALAOUI <youness.chrifi@gmail.com> Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com>
Signed-off-by: Youness CHRIFI ALAOUI <youness.chrifi@gmail.com> Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com>
Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com>
Signed-off-by: Youness CHRIFI ALAOUI <youness.chrifi@gmail.com> Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com>
Signed-off-by: Youness CHRIFI ALAOUI <youness.chrifi@gmail.com> Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com>
…ndpoint Signed-off-by: Youness CHRIFI ALAOUI <youness.chrifi@gmail.com> Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com>
Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com>
- Users must have the Reader grant on the rolling stock to get its usage. - No role is required (or allows) to read a rolling stock usage except admin. Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com>
Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com>
Signed-off-by: Youness CHRIFI ALAOUI <youness.chrifi@gmail.com> Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com>
Signed-off-by: Youness CHRIFI ALAOUI <youness.chrifi@gmail.com> Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com>
Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com> Signed-off-by: Youness CHRIFI ALAOUI <youness.chrifi@gmail.com>
Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com> Signed-off-by: Youness CHRIFI ALAOUI <youness.chrifi@gmail.com>
Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com>
Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com>
The endpoint is supposed to be only used by core. When authorization is not skipped, deny anyone who is not an admin. Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com>
Signed-off-by: Youness CHRIFI ALAOUI <youness.chrifi@gmail.com> Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com>
Signed-off-by: Youness CHRIFI ALAOUI <youness.chrifi@gmail.com> Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com>
Signed-off-by: Youness CHRIFI ALAOUI <youness.chrifi@gmail.com> Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com>
Signed-off-by: Youness CHRIFI ALAOUI <youness.chrifi@gmail.com> Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com>
Sh099078
force-pushed
the
feature-branch/check-rolling-stock-privileges
branch
from
August 14, 2026 10:13
444db59 to
a317b05
Compare
Contributor
|
rebased on |
The issuer must have the Reader grant on the rolling stocks. Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com>
Sh099078
force-pushed
the
feature-branch/check-rolling-stock-privileges
branch
from
August 14, 2026 10:19
a317b05 to
d0063aa
Compare
Signed-off-by: Loup Federico <16464925+Sh099078@users.noreply.github.com>
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.
Add authorization to the rolling stock and light rolling stock endpoints.
Related ticket: https://github.com/osrd-project/osrd-confidential/issues/1064
Warning
This PR is a feature branch and is not ready for review yet.
TODO
Backend - Add authorization on the following endpoints:
POST:/authz/grants#17242 editoast:POST:/authz/grantsmake it possible to give rolling stock grants #17245GET /rolling_stock/{id}andGET /rolling_stock/nameprivileges check #17218GET /rolling_stock/{id}andGET /rolling_stock/nameprivileges check #17218GET /rolling_stock/{id}andGET /rolling_stock/nameprivileges check #17218GET /rolling_stock/{id}andGET /rolling_stock/nameprivileges check #17218POST:/rolling_stock: give the request issuer ownership of the created rolling stock in the authorization store #17875POST:/rolling_stock/{id}/livery#17392GET:rolling_stock/{id}/usage#17383POST:/timetable/{id}/stdcmendpoint: add authorization for the rolling stocks used in the query #17433pathfinding_from_train_batch,core_taskor something which depends on them (example: batch simulations).POST:/level_crossing_occupancy: CanRead, filter out the trains that are unauthorized for the user (editoast : add authorization to level crossing occupancy endpoint #17993) (editoast: refactor level_crossing_occupancy endpoint #18031)POST:/train_schedules/project_path_op: CanRead, same thing astrain_schedule/track_occupancy. (editoast: add authorisation check on project_path_op #18007) (editoast: fix project_path and project_path_op 403 error #18116)POST:/train_schedules/project_path: CanRead, 403 Forbidden is some train schedules are unauthorized (editoast: add privilege check for project path endpoint #18025) (editoast: fix project_path and project_path_op 403 error #18116)GET:/timetable/{id}/requirements: only available for admins or when authz is skipped (endpoint called by core). editoast: only authorize admins to useGET:/timetable/{id}/requirements#18021GET:/timetable/{id}/conflicts: CanRead, also filter out the unauthorized trains editoast: filter out unauthorized trains inGET:/timetable/id/conflicts#18024POST:/train_schedule/occupancy_blocks: CanRead, filter out unauhtorized rolling stocks editoast: filter forbidden trains and exceptions inPOST:/train_schedule/occupancy_blocks#18104GET:/train_schedule/{id}/etcs_braking_curves: CanRead, 403 Forbidden if unauthorized editoast: requireReadergrant on the rolling stock inGET: /train_schedule/{id}/etcs_braking_curves#18019POST:/train_schedule/track_occupancy: CanRead, if the endpoint is called withuse_simulation, then unauthorized trains should trigger a 403 response from the endpoint. If there is no simulation, the train schedules authorization is skipped. editoast: add check for track occupancy #18012GET:train_schedule/{id}/path: CanRead, 403 Forbidden if unauthorized editoast: authorize the rolling stock inGET:/train_schedule/{id}/path#18013