Skip to content

fix(security): migrate unauthenticated NATS defaults to authenticated URL - #1292

Merged
POWERFULMOVES merged 3 commits into
mainfrom
fix/nats-auth-batch-migration
Apr 18, 2026
Merged

POWERFULMOVES merged 3 commits into
mainfrom
fix/nats-auth-batch-migration

Conversation

@POWERFULMOVES

Copy link
Copy Markdown
Owner

AGNOTE4482 P0 — NATS Auth Batch Migration

Summary

Batch migration of unauthenticated NATS connection strings across production code.

Changes

  • Services (5 files): work-marshaling, node-registry — 12 refs migrated
  • Tools (9 files): beats_to_cgp, consciousness_harvester, ingest_gdrive_beats, publish_handshake, realtime_listener, supaserch_smoke, voice_follow_agent, voice_follow_cast_agent, voice_chain_e2e_test — 15 refs migrated
  • Docs (1 file): chat-relay/README.md example updated

Pattern

nats://localhost:4222 and nats://127.0.0.1:4222nats://nats:pmoves@nats:4222

Preservation

  • Test isolation preserved: chat-relay/tests/test_relay.py untouched (test cases override with custom URLs)

Stats

  • 15 files changed, 30 insertions, 28 deletions
  • 39 authenticated NATS defaults now set
  • 0 unauthenticated refs remain in production code

Agent Zero (PMOVES.AI) added 3 commits April 17, 2026 20:18
Replace nats://localhost:4222 with nats://nats:pmoves@nats:4222
in work-marshaling (5 refs) and node-registry (7 refs).

Refs: AGNOTE4482 P0
Replace nats://localhost:4222 and nats://127.0.0.1:4222 with
nats://nats:pmoves@nats:4222 across 9 tool scripts.

Refs: AGNOTE4482 P0
Update export example to show authenticated NATS URL.

Refs: AGNOTE4482 P0
@coderabbitai

coderabbitai Bot commented Apr 18, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@POWERFULMOVES has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 9 minutes and 21 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 9 minutes and 21 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e59fd056-c270-4f8f-bac0-aad0ece54c88

📥 Commits

Reviewing files that changed from the base of the PR and between 77784fc and c72684d.

📒 Files selected for processing (15)
  • pmoves/services/chat-relay/README.md
  • pmoves/services/node-registry/__init__.py
  • pmoves/services/node-registry/main.py
  • pmoves/services/node-registry/registry.py
  • pmoves/services/work-marshaling/__init__.py
  • pmoves/services/work-marshaling/main.py
  • pmoves/tools/beats_to_cgp.py
  • pmoves/tools/consciousness_harvester.py
  • pmoves/tools/ingest_gdrive_beats.py
  • pmoves/tools/publish_handshake.py
  • pmoves/tools/realtime_listener.py
  • pmoves/tools/supaserch_smoke.py
  • pmoves/tools/voice_chain_e2e_test.py
  • pmoves/tools/voice_follow_agent.py
  • pmoves/tools/voice_follow_cast_agent.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/nats-auth-batch-migration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c72684d63b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# Ignore docker-only alias when running on host.
if nats_url.startswith("nats://nats:") or nats_url.startswith("tls://nats:"):
return "nats://127.0.0.1:4222"
return "nats://nats:pmoves@nats:4222"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore host translation in voice follow NATS resolver

This script is explicitly host-run, but _resolve_nats_url now returns nats://nats:pmoves@nats:4222 when NATS_URL uses the Docker alias, which is not resolvable from the host. That regresses the previous behavior (mapping Docker alias to loopback) and causes nc.connect(...) to fail unless users manually override VOICE_FOLLOW_NATS_URL. Please keep the host translation behavior (while preserving auth) so the default path still works outside containers.

Useful? React with 👍 / 👎.

# Translate docker-only alias to host-accessible URL
if nats_url.startswith("nats://nats:") or nats_url.startswith("tls://nats:"):
return "nats://127.0.0.1:4222"
return "nats://nats:pmoves@nats:4222"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep cast follower using host-accessible NATS default

The cast follower has the same host-run resolver contract, but this change makes Docker-alias input resolve to nats://nats:pmoves@nats:4222 instead of a host-accessible URL. On non-container execution, the nats hostname typically does not resolve, so startup fails even though previous versions worked with no extra env setup. This should continue translating Docker-internal aliases to loopback for host execution.

Useful? React with 👍 / 👎.

@POWERFULMOVES
POWERFULMOVES merged commit 09b1acc into main Apr 18, 2026
19 of 20 checks passed
@POWERFULMOVES
POWERFULMOVES deleted the fix/nats-auth-batch-migration branch April 21, 2026 13:05
POWERFULMOVES added a commit that referenced this pull request Jun 2, 2026
…2 non-urgent) (#1690)

Lane 1 (Archon fork-sync): DONE — fork synced to upstream main 0.4.1, bun
1.3.14-slim base, Archon #15 merged, gitlinks reconciled #1674, vendored pin
retired, branch protection right-sized for solo operator.

Lane 2 (NATS-auth): scope-and-report overturned the "~17 urgent files" framing.
env.shared.example already emits the authed NATS_URL and all production wiring
reads it via os.getenv — zero consumers of the bare nats://nats:4222 constant.
DoX already normalizes both forms (#1375/#1292); pmoves_health's literal is
__main__ example code; the ~30 triple copies have drifted (md5 differs) so
there is no clean single-source fix. Decision: no 30-file hardened-branch sweep
for a non-issue; any fallback hardening is a separate low-priority refactor at
the canonical pmoves-cipher-mcp package.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant