mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-09 16:14:40 +00:00
Introduce the platform-neutral decision core for contextual NIP-42 auth in commons/relayauth: - AuthPurpose / AuthPurposeKind / RelayAuthContext describe *why* a relay wants auth (send DM, deliver notification, read outbox, own relay). - RelayAuthVerdict adds an ASK outcome (runtime-only; never persisted, unlike the two-value RelayAuthDecision override). - RelayAuthResolver is a pure, unit-tested precedence ladder: blocked list > per-relay override > policy > ASK-if-attributable-else-DENY. - New TRUSTED_FOLLOWS policy: auto-auth for relays serving a followed counterparty on a write purpose (DMs/notifications), and — behind a read sub-toggle — read purposes; strangers fall through to ASK. Wires the new enum value through the existing settings screen (new option + strings, reusing the Group symbol) and the URL-only ledger path (degrades to the my-list check until challenge context is plumbed). Live prompt UI, grant-rationale persistence, and quartz challenge-context plumbing are follow-up steps. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EZjmYpgHP4pf79Sav5QT8a