Title: feat: --provision-keys Phase 2 — wire the owner key into the WebID profile, close the LWS-CID loop (#437) · Issue #443 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: feat: --provision-keys Phase 2 — wire the owner key into the WebID profile, close the LWS-CID loop (#437) · Issue #443 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: feat: --provision-keys Phase 2 — wire the owner key into the WebID profile, close the LWS-CID loop (#437) · Issue #443 · JavaScriptSolidServer/JavaScriptSolidServer
Description: Phase 2 of #437. Close the loop between the Phase 1 owner key and the auth path that's already shipped. What's already in jss Capability Where Phase 1 keypair on disk (/private/privkey.jsonld, CID v1.0 Multikey, 0o600 + WAC) src/keys/pro...
Open Graph Description: Phase 2 of #437. Close the loop between the Phase 1 owner key and the auth path that's already shipped. What's already in jss Capability Where Phase 1 keypair on disk (/private/privkey.jsonld, CID ...
X Description: Phase 2 of #437. Close the loop between the Phase 1 owner key and the auth path that's already shipped. What's already in jss Capability Where Phase 1 keypair on disk (/private/privkey.json...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/443
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat: --provision-keys Phase 2 — wire the owner key into the WebID profile, close the LWS-CID loop (#437)","articleBody":"Phase 2 of [#437](https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/437). Close the loop between the Phase 1 owner key and the auth path that's already shipped.\n\n## What's already in jss\n\n| Capability | Where |\n|---|---|\n| Phase 1 keypair on disk (`/private/privkey.jsonld`, CID v1.0 Multikey, 0o600 + WAC) | `src/keys/provision.js`, wired in `src/handlers/container.js` + `src/server.js` |\n| LWS-CID authentication verifier (W3C LWS 1.0 / FPWD 2026-04-23): reads `kid` from a JWT header, fetches WebID profile, locates VM, verifies JWT against `publicKeyJwk` / `publicKeyMultibase` | `src/auth/lws-cid.js` |\n| WebID profile generator with CID v1.0 `verificationMethod` / `publicKeyMultibase` / `publicKeyJwk` JSON-LD context | `src/webid/profile.js` |\n| `did:nostr:` → WebID resolver (with redirect guards, cache) | `src/auth/did-nostr.js` |\n| Local `did:nostr` resolution via JSS-published well-known DID-doc | `src/idp/well-known-did-nostr.js` |\n| Pubkey extractor from a profile's VM entries (handles both f-form Multikey and JWK with BIP-340 even-y check) | `src/auth/nostr-keys.js` |\n\n## The gap\n\nThe seeded WebID profile (`/profile/card.jsonld`) has a `verificationMethod` slot but the Phase 1 public key **never lands in it**. So the entire authentication loop is broken at exactly one wire:\n\n- An agent has the secret at `/private/privkey.jsonld`.\n- They sign a JWT (LWS-CID style: `kid` = a fragment of their WebID profile pointing at a VM).\n- The LWS-CID verifier fetches their WebID profile, looks for the VM by `kid`, finds **nothing**, returns 401.\n- The keypair we just minted can't actually authenticate the agent via the mechanism it was minted for.\n\nPhase 2 connects these two ends.\n\n## Scope\n\nWhen `--provision-keys` is on:\n\n1. After generating the keypair and writing `/private/privkey.jsonld`, **also inject a `verificationMethod` entry into the seeded WebID profile** pointing at the public side of the same key.\n2. The VM should look something like:\n ```json\n {\n \"id\": \"\u003cpodUri>profile/card.jsonld#owner-key\",\n \"type\": \"Multikey\",\n \"controller\": \"\u003cwebId>\",\n \"publicKeyMultibase\": \"fe70102…\"\n }\n ```\n Same `publicKeyMultibase` value as in `/private/privkey.jsonld`. Optionally also a JWK form for tools that prefer it (the LWS-CID verifier already handles either).\n3. Flip the Phase 1 controller in `/private/privkey.jsonld` from WebID to `did:nostr:\u003cnpub>` once we've confirmed jss's existing resolver round-trips. The Phase 1 design log explicitly anticipated this swap; Phase 2 is when it lands.\n\n## Acceptance\n\n- [ ] On `--provision-keys`, the seeded profile contains a VM with `publicKeyMultibase` matching `/private/privkey.jsonld`.\n- [ ] A JWT signed with the secret, `kid` set to the VM's `id`, presented to a WAC-protected resource, authenticates as the pod owner via the existing LWS-CID verifier — no changes to the verifier.\n- [ ] The Phase 1 controller in `/private/privkey.jsonld` is `did:nostr:\u003cnpub>`, and `resolveDidNostrToWebId(\u003cpubkey>)` resolves back to the pod owner's WebID locally (via the well-known DID-doc index).\n- [ ] No regression: `--provision-keys` off still produces a profile with no VM (today's default).\n- [ ] `extractNostrPubkeysFromProfile` round-trips the new VM (same shape it already accepts for did:nostr verification).\n\n## Tests\n\n- Unit: profile generator, given a `publicKeyMultibase`, emits the right VM shape; absent the option, the VM array stays empty.\n- Round-trip: feed the generated VM through `extractNostrPubkeysFromProfile` and assert the recovered xonly pubkey matches.\n- Integration: `--provision-keys` + a small client that signs an LWS-CID JWT with the on-disk secret + `kid` set to the VM's `id` → 200 on a WAC-protected GET. (Reuses the existing LWS-CID test harness if there is one; otherwise builds the JWT inline.)\n- did:nostr round-trip: `resolveDidNostrLocally(pubkey)` returns the pod owner's WebID after Phase 2 wiring.\n\n## Why this is small\n\nNo new crypto. No new auth path. No new resolver. No new file format. The verifier, the profile generator, the resolver, the extractor, and the keypair generator are all in tree already. Phase 2 is **two wires** plus a controller flip.\n\n## Out of scope\n\n- Phase 3 work: `--key-passphrase` / scrypt+aesgcm wrap, BIP-39 seed phrase derivation.\n- Phase 4 work: hardware wallets, KMS, encrypted-at-rest.\n- Anything that changes the LWS-CID verifier (no need — it already accepts the shape Phase 2 will produce).\n\nRefs #437.\n","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-05-14T10:57:39Z","url":"https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/443"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:00a0e552-faf4-915e-f872-28afa017dfe4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 83BC:39680A:4D38E8:62244E:6B038BC8 |
| html-safe-nonce | b204e7660beb4a2d2e742a101cd832066e8726a553dc04f7ecd1d48edb7668d0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4M0JDOjM5NjgwQTo0RDM4RTg6NjIyNDRFOjZCMDM4QkM4IiwidmlzaXRvcl9pZCI6IjkxODc2ODAxOTA0MDU1MTIxMzYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5a64aa07a069c1be9d3e51114841c4bc11db18bb93033b56f111f513d6cdd9bf |
| hovercard-subject-tag | issue:4445347986 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/JavaScriptSolidServer/JavaScriptSolidServer/443/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ca5e05efcbebcc41a5b7bd2083bf1388b34e20ccfab965e744d264d8211685bd/JavaScriptSolidServer/JavaScriptSolidServer/issues/443 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ca5e05efcbebcc41a5b7bd2083bf1388b34e20ccfab965e744d264d8211685bd/JavaScriptSolidServer/JavaScriptSolidServer/issues/443 |
| og:image:alt | Phase 2 of #437. Close the loop between the Phase 1 owner key and the auth path that's already shipped. What's already in jss Capability Where Phase 1 keypair on disk (/private/privkey.jsonld, CID ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | melvincarvalho |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/JavaScriptSolidServer/JavaScriptSolidServer git https://github.com/JavaScriptSolidServer/JavaScriptSolidServer.git |
| octolytics-dimension-user_id | 205442424 |
| octolytics-dimension-user_login | JavaScriptSolidServer |
| octolytics-dimension-repository_id | 958025407 |
| octolytics-dimension-repository_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 958025407 |
| octolytics-dimension-repository_network_root_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width