fix: require authentication by default in standalone mode#431
fix: require authentication by default in standalone mode#431ambient-code[bot] wants to merge 3 commits intomainfrom
Conversation
Standalone mode previously defaulted to no passphrase, exposing an unauthenticated gRPC server. Now a random passphrase is auto-generated when --passphrase is not provided. Users must pass --unsafe-no-auth to explicitly disable authentication. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
✅ Deploy Preview for jumpstarter-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
@ambient-code you need to update the e2e tests most probably... |
Existing tests that ran without authentication now use --unsafe-no-auth since the exporter auto-generates a passphrase when neither --passphrase nor --unsafe-no-auth is provided. Also adds tests for auto-generated passphrase output, --unsafe-no-auth flag, and mutual exclusivity of --passphrase and --unsafe-no-auth. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Updated the e2e tests in
Commit: a25a70f |
Status UpdateReviewed the PR and its current state: Comments: The only actionable comment was from @mangelajo requesting e2e test updates. This was addressed in commit a25a70f which:
CI: No failures so far. Several checks have passed (lint-python, typos, pytest-matrix ubuntu 3.11/3.12, e2e-compat-old-client). Some checks are still pending (e2e-tests, macOS pytest-matrix runs). Will need to confirm once those complete. Code review notes:
No fixes required -- waiting on remaining CI checks to complete. |
| --tls-grpc-listener "$LISTENER_PORT" \ | ||
| --tls-grpc-insecure 2>"${BATS_TEST_TMPDIR}/exporter.log" & | ||
| LISTENER_PID=$! | ||
| echo "$LISTENER_PID" > "${BATS_TEST_TMPDIR}/exporter.pid" |
There was a problem hiding this comment.
How is the lifecycle of this exporter handled , will something kill it?
There was a problem hiding this comment.
The exporter's lifecycle is managed by the existing teardown() function (line 96), which calls stop_exporter(). The test writes the PID to ${BATS_TEST_TMPDIR}/exporter.pid (line 193), and stop_exporter() reads that file, kills the process, waits for it, and removes the PID file. This is the same mechanism used by all other tests in this file via _start_exporter().
The auto-generated passphrase test was waiting only for the port to become available before reading the log file. Because the passphrase message is printed to stderr before the server starts listening, a race condition could cause the grep to run before the log file was flushed, leading to a hang or timeout in CI. Fix by first waiting (with retries) for the passphrase message to appear in the log, then separately waiting for the port before attempting to connect with the extracted passphrase. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
Fixes #356 — standalone mode previously exposed an unauthenticated, unencrypted gRPC server by default.
secrets.token_urlsafe(32)) when--passphraseis not provided in standalone mode, printed to stderr for sharing with clients--unsafe-no-authflag to explicitly disable authentication (mutually exclusive with--passphrase)--unsafe-no-authis used, with a stronger warning when combined with--tls-grpc-insecureTest plan
make lint-fix)jmp run --exporter myconfig --tls-grpc-listener 1234 --tls-grpc-insecurenow auto-generates and prints a passphrasejmp run --exporter myconfig --tls-grpc-listener 1234 --tls-grpc-insecure --unsafe-no-authwarns but allows unauthenticated access--passphraseand--unsafe-no-authtogether produces a UsageError🤖 Generated with Claude Code