Commit 960a2ee
lsc
fix: address non-blocking P2s from yujiawei's approval review
@yujiawei approved but flagged 7 P2 hardening suggestions. Take the
three that are mechanical + safe; skip the four that need judgment or
backend coordination.
- Mirror the presence guard `uploadMcpIconReal` already has: reject
`initResp` with missing `presigned_url`/`object_key` in
`skillApiReal.uploadIcon` so a malformed 200 response yields a
normalized Toast error, not an uncaught TypeError inside
`uploadFile` (P2 #6).
- Soften the `assertSafeUploadURL` / `assertSafeExternalURL` doc
comments so they no longer overstate the protection: they are
scheme-level guards only; an `https://` URL pointing at an internal
or metadata host still passes. Also spell out why the residual blast
radius stays bounded (P2 #2).
- Document that `VITE_USE_MOCK` swaps only the 8 CRUD endpoints — the
upload / parse / poll / download pipeline is always bound to the
real backend because the mock module has no upload surface. Prevents
the "why is my mock env hitting the real server" surprise (P2 #7).
Skipped:
- P2 #1 (icon <img src> host allowlist): needs a marketplace-side
allowlist to compare against — not settled here.
- P2 #3 (SECRET_KEY_PATTERN gaps: credential/auth/bearer/…): source
comment asserts it must stay byte-identical to the backend regex, so
a frontend-only tighten would desync. Backend PR paired.
- P2 #4 (shell-escape skillId in the install prompt): value is a
backend UUID today; hardening path is UUID-validate or shell-quote,
either is a judgment call.
- P2 #5 (request<T> undefined guard): can't distinguish "delete
returned no data" from "misbehaving backend dropped data" at the
`request` layer without caller-intent context.
Refs: PR #851 review by @yujiawei (APPROVED verdict, P2 suggestions)1 parent ceccff4 commit 960a2ee
3 files changed
Lines changed: 31 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
73 | 80 | | |
74 | 81 | | |
75 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
11 | 17 | | |
12 | 18 | | |
13 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
135 | 139 | | |
136 | 140 | | |
137 | 141 | | |
| |||
358 | 362 | | |
359 | 363 | | |
360 | 364 | | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
361 | 371 | | |
362 | 372 | | |
363 | 373 | | |
| |||
0 commit comments