From d30459513ec44ab298fafd1bfe0edc08d6ab62e4 Mon Sep 17 00:00:00 2001 From: bndw Date: Sat, 14 Feb 2026 09:58:28 -0800 Subject: feat: rename allowed_pubkeys to allowed_npubs with normalization - Config now accepts npub format only (human-readable) - Automatically converts npubs to hex pubkeys at load time - Updated InterceptorOptions.AllowedPubkeys -> AllowedNpubs - Added validation to reject hex format in config (npub only) - Updated documentation to clarify npub-only config - Added comprehensive tests for npub normalization Config is for humans (npub), internal code uses hex pubkeys. --- internal/auth/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'internal/auth/README.md') diff --git a/internal/auth/README.md b/internal/auth/README.md index c41b6cb..df0de6a 100644 --- a/internal/auth/README.md +++ b/internal/auth/README.md @@ -209,7 +209,9 @@ authOpts := &auth.InterceptorOptions{ - **`TimestampWindow`**: Maximum age of events in seconds (default: 60) - **`Required`**: Whether to reject unauthenticated requests (default: false) - **`ValidatePayload`**: Whether to verify payload hash when present (default: false) -- **`AllowedPubkeys`**: Optional whitelist of allowed pubkeys (nil = allow all) +- **`AllowedNpubs`**: Optional whitelist of allowed pubkeys (nil = allow all) + - Config accepts npub format only (human-readable bech32) + - Automatically normalized to hex format (computer-readable) at config load time ### NostrCredentials Options -- cgit v1.2.3