Commit b62945a
Add preview mock support for secrets RPCs (#3071)
The preview mock `WaveEnv` was missing the secrets RPC surface used by
config/secrets flows. This adds mock implementations for the four
secrets commands so preview and test environments can exercise secrets
behavior without a backend.
- **Added mock secrets RPC handlers**
- Implemented `GetSecretsLinuxStorageBackendCommand`
- Implemented `GetSecretsNamesCommand`
- Implemented `GetSecretsCommand`
- Implemented `SetSecretsCommand`
- **Backed secrets RPCs with in-memory state**
- Added a per-env in-memory secret store inside `makeMockRpc`
- `SetSecretsCommand` now supports both upsert and delete (`null` =>
remove)
- `GetSecretsNamesCommand` returns sorted secret names for stable
behavior
- `GetSecretsCommand` returns only requested keys that exist
- `GetSecretsLinuxStorageBackendCommand` returns `"libsecret"` on Linux
previews and `""` elsewhere
- **Kept the change scoped to preview/mock behavior**
- Wired platform into the mock RPC layer without changing production RPC
behavior
- Updated the mock environment contract comments to reflect the newly
supported RPCs
- **Added focused coverage**
- Extended `frontend/preview/mock/mockwaveenv.test.ts` to cover
set/get/list/delete semantics and Linux backend reporting
```ts
const env = makeMockWaveEnv({ platform: "linux" });
await env.rpc.SetSecretsCommand(null as any, {
OPENAI_API_KEY: "sk-test",
ANTHROPIC_API_KEY: "anthropic-test",
} as any);
const names = await env.rpc.GetSecretsNamesCommand(null as any);
// ["ANTHROPIC_API_KEY", "OPENAI_API_KEY"]
const secret = await env.rpc.GetSecretsCommand(null as any, ["OPENAI_API_KEY"]);
// { OPENAI_API_KEY: "sk-test" }
```
<!-- START COPILOT CODING AGENT TIPS -->
---
📍 Connect Copilot coding agent with [Jira](https://gh.io/cca-jira-docs),
[Azure Boards](https://gh.io/cca-azure-boards-docs) or
[Linear](https://gh.io/cca-linear-docs) to delegate work to Copilot in
one click without leaving your project management tool.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>1 parent 1ee3c46 commit b62945a
2 files changed
+61
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
96 | 119 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
| 29 | + | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
| |||
172 | 177 | | |
173 | 178 | | |
174 | 179 | | |
| 180 | + | |
175 | 181 | | |
176 | 182 | | |
177 | 183 | | |
178 | 184 | | |
179 | 185 | | |
| 186 | + | |
180 | 187 | | |
181 | 188 | | |
182 | 189 | | |
| |||
230 | 237 | | |
231 | 238 | | |
232 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
233 | 269 | | |
234 | 270 | | |
235 | 271 | | |
| |||
319 | 355 | | |
320 | 356 | | |
321 | 357 | | |
| 358 | + | |
322 | 359 | | |
323 | 360 | | |
324 | 361 | | |
| |||
0 commit comments