You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 14c543d
Browse filesBrowse the repository at this point in the historyBrowse files
Address Copilot pickup on #442. --public bypasses WAC and grants
unauthenticated access to every resource — including any
/private/privkey.jsonld we'd just written. The two flags are
explicitly incompatible; refuse the combination at every entry point
so the operator hits the contradiction immediately rather than by
reading a leaked key from logs or the public web.
- New assertProvisionKeysCompatible({ provisionKeys, isPublic })
exported from src/keys/provision.js. Throws with a clear error
message naming both flags and the WAC bypass.
- src/server.js calls the assertion at server-create time. A
`jss start --single-user --provision-keys --public` invocation
now fails to start instead of silently writing a public secret.
- src/handlers/container.js handleCreatePod returns HTTP 400 when
request.config?.public is true and provisionKeys: true is sent.
Pod is not created; error explains why.
- docs/provision-keys.md gains an "Incompatible with --public"
section spelling out both refusal points.
- 4 new unit tests for the assertion (full truth table).
- 1 new HTTP integration test exercising the 400 path on a
--public test server.
- 1 new createServer-throw test asserting the synchronous refusal
on construction.
847/847 tests pass.
Copy file name to clipboardExpand all lines: docs/provision-keys.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,6 +68,17 @@ Same effect as the CLI flag; useful in containerised deployments.
68
68
69
69
The file mode is set to `0o600` on POSIX. WAC restricts HTTP access to the pod owner via `<pod>/private/.acl` (the standard private-folder ACL JSS writes anyway).
70
70
71
+
## Incompatible with `--public`
72
+
73
+
JSS refuses to provision keys when `--public` mode is on. `--public` tells JSS to skip WAC entirely and grant unauthenticated access to every resource — including `/private/privkey.jsonld`. Combined with `--provision-keys`, that would write a plaintext secret straight to a publicly-readable URL.
74
+
75
+
The two flags are explicitly incompatible:
76
+
77
+
-**At server start**: `jss start --single-user --provision-keys --public` throws at server-create time with a clear error. The server doesn't start.
78
+
-**At pod creation over HTTP**: `POST /.pods` with `provisionKeys: true` returns **400 Bad Request** when the server is in `--public` mode.
79
+
80
+
If you genuinely want both behaviours, you don't actually want both: either pick `--public` (no auth, no secrets on disk) or pick `--provision-keys` (WAC-protected secrets). There's no middle ground that's safe.
81
+
71
82
## Threat model and protection
72
83
73
84
The web user (pod owner) reads the key over HTTP, authenticated against their WebID. WAC checks the request and serves the file:
0 commit comments