Repository navigation
fix: apply token path scope to apps that depend on a runnable - #12828
rubenfiszel wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
/review |
|
Claude finished @rubenfiszel's task in 22s —— View job Good to merge Summary
FindingsNone blocking. The scripts and flows variants of this endpoint, and AGENTS.md compliance
Test coverage
|
Codex ReviewGood to merge No issues found. The handler applies the existing app-read scope predicate to every returned path while preserving RLS and unscoped-token behavior. The endpoint has no pagination, so filtering the fetched results is appropriate. Test coverageThe focused API integration test covers both scoped and unscoped tokens against two dependent apps. That sufficiently guards this handler-only change; no new predicate logic needs unit tests. I did not run tests. The PR reports the integration test passes and fails when the fix is reverted. The PR also reports live verification: requesting |
Deploying windmill with
|
| Latest commit: |
99f95b5
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b30532d8.windmill.pages.dev |
| Branch Preview URL: | https://ruben-win-2882-apply-token-p.windmill.pages.dev |
Pi ReviewGood to merge Summary
I verified the predicate semantics in The regression test ( Considered and dismissed
Test coverage
The PR's test plan already describes the manual verification (two apps depending on one script in different folders, unscoped vs |
Summary
GET /api/w/{workspace}/apps/list_paths_from_workspace_runnable/{runnable_kind}/{path}returned the paths of every app that depends on a script or flow without applying the token's path scope. A token restricted withapps:read:<prefix>received app paths outside that prefix, even thoughapps/getfor those paths returns 403. RLS still limited results to apps the token owner can read, so only out-of-scope paths leaked.Changes
list_paths_from_workspace_runnable(backend/windmill-api/src/apps.rs) filters its rows throughbuild_scope_path_predicate(&authed, "apps", "read"), aslist_search_appsalready does. Unscoped tokens and sessions are unaffected. The endpoint is not paginated, so filtering after the fetch reveals nothing through page sizes.backend/tests/app_runnable_paths_scope.rs: an unscoped token sees both dependent apps, anapps:read:u/test-user/*token sees only the one in scope. It fails without the fix.Out of scope, noted for follow-up: the scripts and flows variants of
list_paths_from_workspace_runnable(andlist_paths_linking_agent) don't filter their returned paths by the token's path scope either.Test plan
cargo test --features quickjs --test app_runnable_paths_scopepasses, and fails with the handler change revertedu/admin/sinf/allowedandf/other; an unscoped token gets["f/allowed/app1","f/other/app2"], anapps:read:f/allowed/*token gets["f/allowed/app1"]Left in draft: touches a token-scope (auth) path, wants a human look before ready.
🤖 Generated with Claude Code
Summary by cubic
Fixes
GET /apps/list_paths_from_workspace_runnableso tokens restricted withapps:read:<prefix>no longer receive app paths outside that prefix. Previously the endpoint returned out-of-scope paths even thoughapps/geton the same paths returns 403; RLS still limited results to apps the token owner can read.build_scope_path_predicate, matching whatlist_search_appsalready does.apps:read:u/test-user/*token (sees only in-scope apps).list_paths_linking_agent, still don't filter by token path scope; noted for follow-up.Written for commit 99f95b5. Summary will update on new commits.