Repository navigation
feat: allow insecure database connections via explicit opt-in - #39
Merged
Merged
Conversation
Support the sslmode values that can run without TLS (disable, allow, prefer) behind CRDB_MCP_ALLOW_INSECURE_DB=true, following the existing opt-out pattern, for local development clusters (e.g. cockroach start-single-node --insecure). Cert env vars are not required in these modes and a startup warning logs the active sslmode. Also fixes the config test clearEnv helper, which was not resetting newer env vars between subtests.
rahulcrl
force-pushed
the
add_insecure_db_optin
branch
from
July 7, 2026 07:23
f05dcfe to
1d2b660
Compare
rahulcrl
marked this pull request as ready for review
July 7, 2026 07:28
Contributor
Author
|
TFTR @TheComputerM! |
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.
Adds
CRDB_MCP_ALLOW_INSECURE_DB=trueto support local development clusters (cockroach start-single-node --insecure,cockroach demo --insecure), following the existing secure-by-default opt-out pattern (CRDB_MCP_ALLOW_INSECURE_HTTP,CRDB_MCP_ALLOW_PASSWORD_AUTH).Changes
disable,allow,prefer) are accepted only with the opt-in, in both auth paths (CRDB_DATABASE_URLand cert env vars).require/verify-ca/verify-fullbehave as before.CRDB_HOST+CRDB_USERNAME+CRDB_SSL_MODE=disableis a complete local config.clearEnvhelper, which was not resettingCRDB_MCP_ALLOW_NO_BEARER,CRDB_MCP_MAX_CONNS,CRDB_MCP_TXN_QOSbetween subtests (caught by the new gating test).Testing
t.Runcases covering accept/reject for all three gated modes, DSN shape without cert params, andInsecureDB()reporting.cockroach start-single-node --insecurenode: full MCP handshake,list_databasesreturns rows, warning logged.go test ./...passes.