Commit 58023c7
committed
fix(plugin-security,spec): PERMISSION_DENIED stops showing developer copy to end users (#7414)
The 403 refusal is correct and its transport is fine; the message was not.
`Error.message` is the body's human-readable string on every transport and
Console renders it verbatim in a toast, so a business user in a localized app
got an English sentence naming an object API name they had never seen and
ending in `positions [org_member, everyone]`.
The error now carries two messages because it has two audiences:
- `message` — the user's half, rendered in `ExecutionContext.locale` through
the SHARED operation-message catalog #7307 built (`errors.permission_denied`).
It names no object, no operation and no position, in any shipped locale.
- `developerMessage` — the developer's half, the previous sentence byte for
byte. LOGGED at the throw site rather than shipped: unlike the 409, this
body carries no structured API names, so shipping it would have added a
disclosure instead of removing one. It is a sibling of `details`, never a
member of it, because `details` is what the dispatcher serialises.
`code` / `statusCode` / `details` unchanged; one PERMISSION_DENIED (ADR-0112),
two sentences.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BM1tNf5U3nEbHKR4fo5qVQ1 parent 2ef1807 commit 58023c7
9 files changed
Lines changed: 685 additions & 6 deletions
File tree
- .changeset
- packages
- plugins/plugin-security
- src
- rest/src
- spec/src/system
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
7 | 25 | | |
8 | 26 | | |
9 | 27 | | |
10 | 28 | | |
11 | 29 | | |
12 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
13 | 37 | | |
14 | 38 | | |
15 | 39 | | |
| 40 | + | |
16 | 41 | | |
17 | 42 | | |
18 | 43 | | |
| |||
0 commit comments