Commit 0caa55a
committed
fix(webapp): mask 404 as 403 when findResource returns null on authorized routes
createActionApiRoute now runs findResource before authorization so the
auth scope check can expand to alternate identifiers of the resolved
resource (Sessions are addressable by both friendlyId and externalId).
Side-effect: an authenticated-but-underscoped caller could probe
resource existence by observing 404 vs 403. Mask the 404 as 403 with
the same response shape as the auth-failed branch when the route
declares authorization, so the two cases are indistinguishable to
callers without scopes. Routes without authorization keep returning
404.1 parent 1a880fd commit 0caa55a
1 file changed
Lines changed: 20 additions & 0 deletions
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
683 | 683 | | |
684 | 684 | | |
685 | 685 | | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
686 | 706 | | |
687 | 707 | | |
688 | 708 | | |
| |||
0 commit comments