3 Commits
Author SHA1 Message Date
MichilisandClaude Opus 5.5 059e763022 sources: nip05 format for whitelisting a domain's NIP-05 users
Phase 10 of PLAN.md (optional, off unless configured). `format =
"nip05"` reads a nostr.json `names` map into a pubkey list with no
expiries, usable anywhere a pubkey source is, e.g.
`whitelist.pubkey_sources`. A body without a `names` object is an error,
so a server that only answers ?name= lookups is caught at load time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 07:29:14 +00:00
MichilisandClaude Opus 5.5 3fdd9738c9 sources: http(s) transport behind the remote feature
Phase 4 of PLAN.md.

- New non-default feature `remote = ["ureq"]` (ureq is already a dep of
  `cloudflare`, so no new crates).
- Blocking GET with connect and overall timeouts from timeout_secs, an
  optional `Authorization: Bearer` read from the env var named by
  token_env, non-2xx treated as failure, and the body capped at
  max_bytes.
- declare logs whether the token is present (never its value). An
  http(s) url in a build without the feature fails at startup.
- Tests run against a local TcpListener: 200, 500 and timeout keep the
  last good copy, oversize is rejected, bearer header sent only when
  configured.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 07:15:44 +00:00
MichilisandClaude Opus 5.5 215b98576e sources: runtime with file sources, reload thread and disk cache
Phase 3 of PLAN.md.

- Top-level [sources.<name>] tables (url, format, reload_secs,
  timeout_secs, max_bytes, cache_path, token_env), declared before any
  filter is built so filters can resolve source names while they
  deserialize (PubkeyRef / WordsRef). Unknown or mismatched names fail
  at startup.
- Each source holds an Arc snapshot behind an RwLock; one background
  thread per process reloads on reload_secs (min 30). A failed fetch or
  parse keeps the last good copy and logs its age.
- First load is synchronous at startup; on failure the cache_path copy
  is used. Cache writes go through a per-process temp file and rename.
- Local files only in this phase; http(s) urls are rejected at startup.

A config without [sources] behaves exactly as before (golden test).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 07:07:24 +00:00