Repository navigation
Commit 312a0ce
authored
fix(amber): return 403 instead of 401 when a user lacks access to an execution (apache#9325)
### What changes were proposed in this PR?
`validateUserCanAccessExecutions` now throws `ForbiddenException` (403)
instead of a 401. The frontend reads any 401 on an authenticated request
as an expired session, so a read-only user who bookmarked, renamed or
deleted an execution was logged out. With a 403 they stay logged in.
Bookmark puts its icon back on a refusal. Rename and delete have no
error handler, so they fail without a message; that is left out of this
PR to keep it small.
### Any related issues, documentation, discussions?
Closes apache#9324.
### How was this PR tested?
Added a read-only bookmark case to `WorkflowExecutionsResourceSpec`, and
the refusal cases now assert 403. Ran `sbt
"WorkflowExecutionService/testOnly *UserQuotaResourceSpec
*WorkflowExecutionsResourceSpec"`: 84 of 85 pass. The other one, the
per-user warehouse case of `retrieveWorkflowRuntimeStatistics`, fails
the same way locally on unmodified `main`. Putting the 401 back fails
the four cases this PR touches.
Not clicked through in a running instance.
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (claude-opus-5-5)1 parent 0549ece commit 312a0ce
3 files changed
Lines changed: 17 additions & 4 deletions
File tree
- amber/src
- main/scala/org/apache/texera/web/resource/dashboard/user/workflow
- test/scala/org/apache/texera/web/resource/dashboard/user
- quota
- workflow
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
381 | | - | |
| 381 | + | |
382 | 382 | | |
383 | 383 | | |
| 384 | + | |
384 | 385 | | |
385 | 386 | | |
386 | 387 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
699 | 699 | | |
700 | 700 | | |
701 | 701 | | |
702 | | - | |
| 702 | + | |
703 | 703 | | |
704 | 704 | | |
705 | 705 | | |
| |||
1309 | 1309 | | |
1310 | 1310 | | |
1311 | 1311 | | |
1312 | | - | |
| 1312 | + | |
1313 | 1313 | | |
1314 | 1314 | | |
1315 | 1315 | | |
1316 | 1316 | | |
1317 | 1317 | | |
1318 | 1318 | | |
1319 | 1319 | | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
1320 | 1332 | | |
1321 | 1333 | | |
1322 | 1334 | | |
| |||
0 commit comments