22745 - Enforce object permissions on Script REST API write operations - #22777
22745 - Enforce object permissions on Script REST API write operations#22777arthanson wants to merge 16 commits into
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
Claude issues fixed. |
|
@claude /review Only report on issues of potential concern; we don't need commentary on anything that doesn't require further consideration. |
This comment was marked as outdated.
This comment was marked as outdated.
jeremystretch
left a comment
There was a problem hiding this comment.
Please see Claude's findings above. At least items 1 and 2 should be addressed IMO.
|
Claude finished @arthanson's task in 9m 38s —— View job Review: Enforce object permissions on Script REST API write operations
The core approach is sound: Concerns below, roughly in order of significance. I was not able to run the test suite in this environment (no configured database), so findings are from reading. 1.
|
|
Per Claude review - fixed 2, 3 and 5. 1 - was deliberate, the generic fix required a meta attribute and was for all routes fixing something that is only used by scripts that will be replaced in the future. So this isolates the change and allows easy removal / deprecation in the future. 4 - it is deliberately different and same for 1 it makes it an isolated and easier to remove in the future / limiting the blast radius of the change. |
Closes: #22745
Fixes a permissions gap in the Scripts REST API where DELETE/PUT/PATCH on
/api/extras/scripts/{id}/succeeded forview_script-only users and read-only tokens, hard-deleting or mutating scripts.Script records are created and modified by uploading their module (
/api/extras/scripts/upload/), so the script endpoint is now read-only apart from execution: GET on the list and detail routes, and POST on the detail route to run a script. Running a script enforces therunaction on the object and read-only tokens are rejected with a 403.