Commit f3d792b
Add security warning to tsp init documentation and CLI for external templates (#8917)
Add warning to documentation and CLI help for templateUrl parameter in
tsp init command
**Completed:**
- [x] Explore repository structure and locate documentation files
- [x] Install dependencies
- [x] Add warning to CLI reference documentation
(/website/src/content/docs/docs/handbook/cli.md)
- [x] Add warning to scaffolding template documentation
(/website/src/content/docs/docs/extending-typespec/writing-scaffolding-template.md)
- [x] Add warning to templatesUrl parameter description in CLI code
(packages/compiler/src/core/cli/cli.ts)
- [x] Build and validate the documentation changes
- [x] Address code review feedback for consistency
- [x] Add changelog entry for @typespec/compiler referencing issue #8916
- [x] Review and finalize
**Changes Made:**
- Added security warnings to both the CLI handbook and scaffolding
templates documentation
- Added security warning to the templatesUrl parameter description in
the CLI code, which appears in the `tsp init --help` output
- The warnings inform users that downloading or using an untrusted
template may contain malicious packages that can compromise their system
and data, matching the warning prompt shown in the `tsp init` command
- Warning text is consistent across documentation files and CLI help
- Added changelog entry using chronus format for @typespec/compiler
package only (no changelog needed for website documentation changes)
- Fixes #8916
<!-- START COPILOT CODING AGENT SUFFIX -->
<details>
<summary>Original prompt</summary>
>
> ----
>
> *This section details on the original issue you should resolve*
>
> <issue_title>Add warning text to documentation on `templateUrl`
parameter in tsp init command</issue_title>
> <issue_description>External templates *can* contain malicious packages
and the like. We prompt about this when folks use `tsp init`:
>
> ```bash
> warning: Downloading or using an untrusted template may contain
malicious packages that can compromise your system and data. Proceed
with caution and verify the source.
> ? Continue (Y/n)
> ```
>
> We should also add a similar warning to the reference doc on tsp
init</issue_description>
>
> <agent_instructions>Add a warning to the documentation on the
templateUrl parameter to `tsp init`, similar to the warning prompt
mentioned in the bug. It should be clear to users that using tsp init
with an external templateUrl is unsafe, unless the template source is
trusted.</agent_instructions>
>
> ## Comments on the Issue (you are @copilot in this section)
>
> <comments>
> </comments>
>
</details>
- Fixes #8916
<!-- START COPILOT CODING AGENT TIPS -->
---
✨ Let Copilot coding agent [set things up for
you](https://github.com/microsoft/typespec/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: markcowl <[email protected]>1 parent 9d36399 commit f3d792b
File tree
4 files changed
+17
-1
lines changed- .chronus/changes
- packages/compiler/src/core/cli
- website/src/content/docs/docs
- extending-typespec
- handbook
4 files changed
+17
-1
lines changedLines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
| 214 | + | |
| 215 | + | |
215 | 216 | | |
216 | 217 | | |
217 | 218 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
8 | 12 | | |
9 | 13 | | |
10 | 14 | | |
| |||
0 commit comments