Repository navigation
feat: add NKey auth to local NATS server (#35) - #40
Merged
mfethe1 merged 1 commit intoMay 6, 2026
Conversation
Wire NATS_LOCAL_NKEY_SEED as the Ed25519 credential for the single-host NATS instance so unauthenticated clients are refused while leaving the Railway/NGS credential chain (NATS_NKEY_SEED / NATS_CREDS_FILE) intact. - infra/local-nats/nats-server.conf: add authorization block with nkey user entry (placeholder public key; replace after running gen-nkeys.sh) - infra/local-nats/gen-nkeys.sh: keygen script — generates a user NKey pair and optionally patches the conf + .env in-place (--write flag) - .env.example: document NATS_LOCAL_NKEY_SEED alongside existing NATS auth vars with clear separation between local and Railway credentials - memu/cluster.py: extract _build_auth_opts(node) so LOCAL uses NATS_LOCAL_NKEY_SEED first; Railway node ignores it - memu/nats_config.py: add resolve_local_nkey_seed() helper - tests/test_nats_local_nkey_auth.py: 15 unit tests covering isolation, priority order, fallbacks, and conf-file shape Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
mfethe1
merged commit May 6, 2026
28ebe7b
into
sandcastle/openclaw-memory-prd-base
1 of 2 checks passed
mfethe1
deleted the
sandcastle/issue-35-feat-add-nkey-auth-to-local-nats-server
branch
May 6, 2026 17:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #35
Changes
infra/local-nats/gen-nkeys.sh— NKey pair generator;--writepatches conf +.envin-placeinfra/local-nats/nats-server.conf— authorization block with placeholder key (inactive untilgen-nkeys.sh --writeis run on mack)memu/cluster.py—_build_auth_opts(node)extracted; LOCAL node usesNATS_LOCAL_NKEY_SEEDfirstmemu/nats_config.py—resolve_local_nkey_seed()helpertests/test_nats_local_nkey_auth.py— 15 tests; 469 total passingActivate on mack
🤖 Sandcastle agent