diff options
| author | bndw <ben@bdw.to> | 2026-02-14 09:58:28 -0800 |
|---|---|---|
| committer | bndw <ben@bdw.to> | 2026-02-14 09:58:28 -0800 |
| commit | d30459513ec44ab298fafd1bfe0edc08d6ab62e4 (patch) | |
| tree | 1e4442f940c11544cd60b6bf72f2038338da67ce /internal/config/README.md | |
| parent | fe3708eaf495613cc6e2340b821795f25811d6ed (diff) | |
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.
Diffstat (limited to 'internal/config/README.md')
| -rw-r--r-- | internal/config/README.md | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/internal/config/README.md b/internal/config/README.md index 79e1b89..dbb8760 100644 --- a/internal/config/README.md +++ b/internal/config/README.md | |||
| @@ -90,9 +90,13 @@ auth: | |||
| 90 | # Timestamp window in seconds for replay protection | 90 | # Timestamp window in seconds for replay protection |
| 91 | timestamp_window: 60 | 91 | timestamp_window: 60 |
| 92 | 92 | ||
| 93 | # Allowed pubkeys (optional, whitelist) | 93 | # Allowed npubs (optional, whitelist) |
| 94 | # If empty, all valid signatures are accepted | 94 | # If empty, all valid signatures are accepted |
| 95 | allowed_pubkeys: [] | 95 | # Use npub format only (e.g., npub1...) |
| 96 | allowed_npubs: [] | ||
| 97 | # Example: | ||
| 98 | # allowed_npubs: | ||
| 99 | # - npub1a2b3c4d5e6f... | ||
| 96 | 100 | ||
| 97 | # Skip authentication for these methods | 101 | # Skip authentication for these methods |
| 98 | skip_methods: | 102 | skip_methods: |
| @@ -217,8 +221,8 @@ Examples: | |||
| 217 | Complex types: | 221 | Complex types: |
| 218 | 222 | ||
| 219 | ```bash | 223 | ```bash |
| 220 | # Lists (comma-separated) | 224 | # Lists (comma-separated, npub format) |
| 221 | export MUXSTR_AUTH_ALLOWED_PUBKEYS="pubkey1,pubkey2,pubkey3" | 225 | export MUXSTR_AUTH_ALLOWED_NPUBS="npub1...,npub1...,npub1..." |
| 222 | 226 | ||
| 223 | # Durations | 227 | # Durations |
| 224 | export MUXSTR_SERVER_READ_TIMEOUT="30s" | 228 | export MUXSTR_SERVER_READ_TIMEOUT="30s" |
