Commit eddc277
committed
fix(starter): gate RPC auth by default instead of trusting every connection
`auth: false` was set on every real surface (the CLI's cli.auth, and both
Vite playgrounds) - each one auto-trusted any connection that could reach
its port, with no interactive handshake at all. That's the framework's
documented opt-out for a tool that's genuinely single-user and
loopback-only, not a sane starter default: a copy-pasted template should
teach the secure-by-default posture, not silently disable it everywhere.
Leave `auth` unset on `src/devframe.ts`'s `cli` and both playground
configs, so they fall through to devframe's interactive OTP gate (the
same default every hosted adapter already ships). A developer who wants
to skip the prompt for a one-off loopback session now reaches for the
CLI's existing `--no-auth` flag per invocation instead of a baked-in
opt-out.
The single playground's e2e suite still needs to drive the bridge
without solving an interactive code, so `playwright.config.ts`'s
`webServer.env` sets an explicit `DEVFRAME_E2E` flag that the playground
config checks to disable auth *only* for that automated run - a plain
`pnpm run play:single` stays gated. The unit test's own ephemeral,
loopback-only `initDevframe` instance keeps `auth: false` outright (it's
a private test fixture torn down in `afterAll`, not a listening surface
anyone else can reach) - now with a comment explaining why that one is
fine.
This PR was created with the help of an agent.1 parent 2e5b0b7 commit eddc277
6 files changed
Lines changed: 39 additions & 8 deletions
File tree
- starter
- playground
- hub
- single
- src
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | | - | |
33 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
34 | 42 | | |
35 | 43 | | |
36 | 44 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
30 | 37 | | |
31 | 38 | | |
32 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
31 | 37 | | |
32 | 38 | | |
33 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
| |||
0 commit comments