mailship/src
Agent 40ac047629 Implement NIP-98 HTTP auth for GET/PUT/DELETE /subscription/email
Three browser-facing endpoints now require a kind-27235 HTTP auth event
(NIP-98) proving the caller controls the pubkey:

- GET  /subscription/email — pubkey extracted from auth header instead
       of query param; returns subscription for the authed pubkey.
- PUT  /subscription/email — pubkey extracted from auth header instead
       of trusting a client-supplied body field.
- DELETE /subscription/:key — verifies auth pubkey matches subscription
       owner (returns 403 if mismatch).

Server-side: decode base64 'Nostr <b64>' Authorization header, JSON.parse,
check kind === 27235, verifyEvent (nostr-tools/pure), then check u /
method / payload tags against the request URL / method / body.

README updated to reflect 'implemented' auth (not 'planned').
Integration test updated to generate NIP-98 auth headers via a new helper
script (script/nip98-auth-header.mjs).
2026-09-14 13:04:26 -04:00
..
emails fix(digest): replace hardcoded #7161FF with {{brandAccent}} 2026-09-10 11:23:31 -04:00
pages Update styling on confirmation failed page 2026-09-02 16:51:01 -04:00
worker fix: remove unused imports and variables flagged by eslint 2026-09-10 17:03:35 -04:00
actions.ts fix: remove unused imports and variables flagged by eslint 2026-09-10 17:03:35 -04:00
alert.ts fix: remove unused imports and variables flagged by eslint 2026-09-10 17:03:35 -04:00
database.ts dedupe and serialize subscription writes. 2026-09-03 13:44:02 -04:00
digest.ts Merge remote-tracking branch 'origin/main' into mailship-0da-readme-config-architecture-and-docker-co-6e1 2026-09-14 12:55:35 -04:00
env.ts fix: remove unused imports and variables flagged by eslint 2026-09-10 17:03:35 -04:00
index.ts Initial mailship fork from anchor 2026-08-18 12:21:22 -04:00
mailer.ts update digest footer 2026-08-27 15:01:13 -04:00
repository.ts Initial mailship fork from anchor 2026-08-18 12:21:22 -04:00
run.ts Initial mailship fork from anchor 2026-08-18 12:21:22 -04:00
server.ts Implement NIP-98 HTTP auth for GET/PUT/DELETE /subscription/email 2026-09-14 13:04:26 -04:00
templates.ts Initial mailship fork from anchor 2026-08-18 12:21:22 -04:00
types.d.ts Initial mailship fork from anchor 2026-08-18 12:21:22 -04:00
util.ts Initial mailship fork from anchor 2026-08-18 12:21:22 -04:00