summaryrefslogtreecommitdiffstats
path: root/internal/auth/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'internal/auth/README.md')
-rw-r--r--internal/auth/README.md13
1 files changed, 12 insertions, 1 deletions
diff --git a/internal/auth/README.md b/internal/auth/README.md
index df0de6a..366e110 100644
--- a/internal/auth/README.md
+++ b/internal/auth/README.md
@@ -209,9 +209,20 @@ authOpts := &auth.InterceptorOptions{
209- **`TimestampWindow`**: Maximum age of events in seconds (default: 60) 209- **`TimestampWindow`**: Maximum age of events in seconds (default: 60)
210- **`Required`**: Whether to reject unauthenticated requests (default: false) 210- **`Required`**: Whether to reject unauthenticated requests (default: false)
211- **`ValidatePayload`**: Whether to verify payload hash when present (default: false) 211- **`ValidatePayload`**: Whether to verify payload hash when present (default: false)
212- **`AllowedNpubs`**: Optional whitelist of allowed pubkeys (nil = allow all) 212- **`AllowedNpubsRead`**: Optional whitelist of allowed pubkeys for read operations (nil = allow all)
213 - Config accepts npub format only (human-readable bech32) 213 - Config accepts npub format only (human-readable bech32)
214 - Automatically normalized to hex format (computer-readable) at config load time 214 - Automatically normalized to hex format (computer-readable) at config load time
215 - Controls access to Query, Get, List, Subscribe, and other read methods
216- **`AllowedNpubsWrite`**: Optional whitelist of allowed pubkeys for write operations (nil = allow all)
217 - Config accepts npub format only (human-readable bech32)
218 - Automatically normalized to hex format (computer-readable) at config load time
219 - Controls access to Publish, Delete, Create, Update, and other write methods
220
221**Access Control Patterns:**
222- **Public relay**: Set `AllowedNpubsWrite` (only some can publish), leave `AllowedNpubsRead` empty (everyone can read)
223- **Private relay**: Set both lists (restricted read and write access)
224- **Open relay**: Leave both empty (everyone can read and write)
225- **Read-only relay**: Set `AllowedNpubsRead`, block all writes
215 226
216### NostrCredentials Options 227### NostrCredentials Options
217 228