Task 02: ActivityPub client protocol layer (internal/ap) master
Tolerant AS2 vocabulary (universal Object, string/object/array-tolerant fields), draft-cavage HTTP signatures (RSA-SHA256, digest-on-GET per Lemmy), signed-fetch client (retries, per-host rate limiting, 5MiB cap, singleflight dedupe, per-hop redirect re-signing, collection paging, TTL key cache), WebFinger both directions, and the bridge service actor with a persisted RSA key (service_keys store + migration 005). Reviewed by 4 general reviewers + a security pass + Codex gpt-5.5 + Gemini 3.1 Pro + GLM 5.2; 14 findings applied. Critical: ResolveKey now binds the resolved actor id to the keyId authority (was actor-spoofable). High: SSRF egress guard (private/loopback/metadata IPs blocked at dial time incl. redirect hops, config-gated); WebFinger self-link host validation. Plus singleflight ctx-detach, key-rotation refetch hook, detectable-invalid timestamps, truncation signalling, bounded caches, and host-required signature verification. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>