Add basic-auth (username/password) login for Dremio Software deployments - #126
Open
cq2wgwtzb5-lgtm wants to merge 1 commit into
Open
Add basic-auth (username/password) login for Dremio Software deployments#126cq2wgwtzb5-lgtm wants to merge 1 commit into
cq2wgwtzb5-lgtm wants to merge 1 commit into
Conversation
Dremio Software Community edition cannot issue PATs, which makes the MCP server unusable there: the PAT support key is absent and token endpoints return 404. This adds an optional dremio.basic_auth config block (username + password, '@' file references supported) that exchanges the credentials for a session token via POST /apiv2/login and installs it as the effective token (the REST API accepts session tokens as Bearer tokens). The token is refreshed automatically ahead of its server-reported expiry, mirroring the existing OAuth2 pattern. PAT and Dremio Cloud behavior are unchanged; PAT wins if both are configured. Verified against a live Dremio Software Community deployment (RunSqlQuery end-to-end) plus unit tests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
|
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 #125
What
Adds an optional
dremio.basic_authconfiguration block for Dremio Software deployments that cannot issue PATs (e.g. Community edition — the PAT support key is absent and token endpoints 404 there):How
config/settings.py— newBasicAuthmodel mirroringOAuth2(username, password with the existing@-file resolution convention, expiry tracking viahas_expired);Dremio.basic_authfield +basic_auth_configuredproperty (guarded off for Cloud).api/basic_auth.py(new) — exchanges credentials for a session token viaPOST /apiv2/login;SessionToken.update_settings()installs it as the effective token, with a 5-minute safety margin ahead of the server-reported expiry. Stdliburllibonly, no new dependencies.api/transport.py— one branch inDremioAsyncHttpClient.__init__, exactly parallel to the OAuth branch: if basic auth is configured and there is no valid token (or the session expired), log in and refresh. No changes to header construction — the REST API accepts session tokens asBearertokens.PAT and Dremio Cloud behavior are unchanged; if both
patandbasic_authare configured, the PAT wins.Testing
tests/api/test_basic_auth.py): settings parsing,@-file password resolution + serialization keeping the reference (not the resolved secret), Cloud guard, mocked login flow updating settings, expiry detection.blackclean.dremio-mcp-server tools invoke -t RunSqlQueryend-to-end against a real Dremio Software Community deployment using only username/password.Docs
docs/settings.mdgains a "Basic auth (Dremio Software without PAT support)" section.🤖 Generated with Claude Code