fix: harden security before production use#6
Open
wedneyyuri wants to merge 1 commit intoJustTryAI:masterfrom
Open
fix: harden security before production use#6wedneyyuri wants to merge 1 commit intoJustTryAI:masterfrom
wedneyyuri wants to merge 1 commit intoJustTryAI:masterfrom
Conversation
- Use SecretStr for DATABRICKS_TOKEN to prevent accidental log leaks - Fail-fast on missing or placeholder credentials at startup - Reject http:// hosts, enforce HTTPS only - Add 30s timeout and explicit verify=True to all HTTP requests - Fix broken sql.execute_sql() call to sql.execute_statement() - Replace stdout print() with stderr to avoid corrupting MCP stdio - Sanitize error messages returned to clients - Default SERVER_HOST to 127.0.0.1 instead of 0.0.0.0
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.
Summary
DATABRICKS_TOKENnow uses PydanticSecretStr, preventing accidental exposure in logs, repr, or stack tracesDATABRICKS_TOKENorDATABRICKS_HOSTare missing/placeholder valuesDATABRICKS_HOSTvalidator now rejectshttp://— onlyhttps://is acceptedtimeout=30sand explicitverify=Truefor TLS certificate validationsql.execute_sql()corrected tosql.execute_statement()(was causingAttributeErrorat runtime)print()calls fromconfig.pythat were corrupting the MCP protocol stream (redirected tostderr)SERVER_HOSTchanged from0.0.0.0to127.0.0.1Test plan
.envor validDATABRICKS_TOKENhttp://inDATABRICKS_HOSTexecute_sqltool works end-to-end after function name fixdatabricks_mcp.logpytest tests/)🤖 Generated with Claude Code