Commit fa3a5c5
Clarify extension catalog trust model in docs, help, and messaging (#4177)
* Clarify extension catalog trust model in docs, help, and messaging (#4176)
Extension catalog management gave no explanation of why the community
catalog is discovery-only, and the install-error text nudged users to
flip a discovery catalog to install_allowed — exactly the wrong move.
- Docs: add a "discovery-only vs. install sources" trust-model section,
document `add --from <url>` as the lightweight vetted-install path, and
stop implying you should make community installable.
- Help: expand the `catalog` app and `--install-allowed` help to state the
vetting intent instead of bare mechanics.
- Messaging: rewrite the not-installable errors in `add`, `search`, and
`info` to point at `--from` and self-curated catalogs, and to say
explicitly not to flip a discovery-only catalog to install_allowed.
- `catalog list` now prints trust-model guidance when a discovery-only
catalog is active.
- Tests cover the new list guidance (present/absent).
Deliberately does not add a verb to toggle install_allowed on an existing
catalog: discovery-only is a security boundary, not an inconvenience.
Assisted-by: GitHub Copilot (model: Claude Opus 4.8, supervised)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a86c498e-f129-4422-9983-d1a33513fd4d
* Address PR review: copy-pasteable install hint and accurate --from warning (#4176)
- The discovery-only "install directly" hint used the user-typed argument,
which can be a display name with spaces (resolved via search) and would
break when copied as a shell command. Emit the resolved catalog ID
(ext_info['id']) instead. Added a regression test.
- The `--from` untrusted-source warning claimed the URL was "not listed in
any of your configured extension catalogs", which is false for a URL
copied from a discovery-only catalog — the exact flow this PR documents.
Reword it to state the install is bypassing trusted (install-allowed)
catalogs, which is accurate regardless of discovery-catalog membership.
Assisted-by: GitHub Copilot (model: Claude Opus 4.8, supervised)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a86c498e-f129-4422-9983-d1a33513fd4d
* Harden install hints against catalog-controlled IDs; expose archive URL (#4176)
Second review round on #4177.
Shell-safety: catalog entry IDs (especially from discovery-only catalogs)
are not validated during catalog merge, and rich.markup.escape only
neutralizes Rich markup, not shell metacharacters. A malicious ID like
`foo; rm -rf ~` was interpolated into the `specify extension add ... --from`
command we encourage the user to copy. Add `_command_safe_id`, which only
emits an ID matching the manifest rule `^[a-z0-9-]+$` (via
VALID_EXTENSION_ARTIFACT_NAME_PATTERN) and otherwise falls back to a literal
`<extension-id>` placeholder. Applied to every suggested command in `add`,
`search`, and `info`.
Discoverability: the documented `--from <archive-url>` flow gave no CLI path
to obtain the URL. `extension info` now prints the candidate `download_url`
for a discovery-only entry (clearly flagged as needing vetting), and the docs
show `extension info <name>` as the way to get the archive URL.
Tests cover the resolved-ID hint, the unsafe-ID neutralization, and pass the
full extensions + CLI suites (635).
Assisted-by: GitHub Copilot (model: Claude Opus 4.8, supervised)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a86c498e-f129-4422-9983-d1a33513fd4d
* Reject leading-hyphen catalog IDs; test info archive-URL branch (#4176)
Third review round on #4177.
_command_safe_id: an ID like `--force` satisfies the manifest character rule
`^[a-z0-9-]+$` but Typer parses a leading hyphen as an option rather than the
positional extension argument, so an untrusted catalog could still yield a
non-copyable or option-altering suggested command. Reject a leading hyphen and
fall back to the `<extension-id>` placeholder.
Tests: cover the new `extension info` discovery-only branch that surfaces the
candidate `download_url` (plus the no-URL fallback), and the leading-hyphen
rejection. Full extensions suite green (528).
Assisted-by: GitHub Copilot (model: Claude Opus 4.8, supervised)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a86c498e-f129-4422-9983-d1a33513fd4d
---------
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a86c498e-f129-4422-9983-d1a33513fd4d1 parent e4895d1 commit fa3a5c5
3 files changed
Lines changed: 380 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
99 | 118 | | |
100 | 119 | | |
101 | 120 | | |
| |||
114 | 133 | | |
115 | 134 | | |
116 | 135 | | |
117 | | - | |
| 136 | + | |
118 | 137 | | |
119 | 138 | | |
120 | 139 | | |
| |||
134 | 153 | | |
135 | 154 | | |
136 | 155 | | |
137 | | - | |
| 156 | + | |
138 | 157 | | |
139 | | - | |
| 158 | + | |
140 | 159 | | |
141 | 160 | | |
142 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
47 | 55 | | |
48 | 56 | | |
49 | 57 | | |
| |||
71 | 79 | | |
72 | 80 | | |
73 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
74 | 109 | | |
75 | 110 | | |
76 | 111 | | |
| |||
444 | 479 | | |
445 | 480 | | |
446 | 481 | | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
447 | 490 | | |
448 | 491 | | |
449 | 492 | | |
| |||
477 | 520 | | |
478 | 521 | | |
479 | 522 | | |
480 | | - | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
481 | 528 | | |
482 | 529 | | |
483 | 530 | | |
| |||
903 | 950 | | |
904 | 951 | | |
905 | 952 | | |
906 | | - | |
907 | | - | |
| 953 | + | |
| 954 | + | |
908 | 955 | | |
909 | 956 | | |
910 | 957 | | |
| |||
1007 | 1054 | | |
1008 | 1055 | | |
1009 | 1056 | | |
| 1057 | + | |
1010 | 1058 | | |
1011 | | - | |
1012 | | - | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
1013 | 1062 | | |
1014 | 1063 | | |
1015 | | - | |
1016 | | - | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
1017 | 1076 | | |
1018 | 1077 | | |
1019 | 1078 | | |
| |||
1256 | 1315 | | |
1257 | 1316 | | |
1258 | 1317 | | |
1259 | | - | |
| 1318 | + | |
1260 | 1319 | | |
1261 | | - | |
| 1320 | + | |
1262 | 1321 | | |
1263 | | - | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
1264 | 1326 | | |
1265 | | - | |
1266 | | - | |
| 1327 | + | |
1267 | 1328 | | |
1268 | 1329 | | |
1269 | 1330 | | |
| |||
1485 | 1546 | | |
1486 | 1547 | | |
1487 | 1548 | | |
| 1549 | + | |
1488 | 1550 | | |
1489 | 1551 | | |
1490 | 1552 | | |
1491 | 1553 | | |
1492 | 1554 | | |
1493 | | - | |
| 1555 | + | |
1494 | 1556 | | |
1495 | 1557 | | |
1496 | | - | |
| 1558 | + | |
1497 | 1559 | | |
1498 | 1560 | | |
1499 | 1561 | | |
1500 | 1562 | | |
1501 | | - | |
1502 | | - | |
1503 | | - | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
1504 | 1582 | | |
1505 | 1583 | | |
1506 | 1584 | | |
| |||
0 commit comments