Extract OAuth credentials from settings module#656
Draft
DevonFulcher wants to merge 5 commits intomainfrom
Draft
Extract OAuth credentials from settings module#656DevonFulcher wants to merge 5 commits intomainfrom
DevonFulcher wants to merge 5 commits intomainfrom
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dcd67f6 to
01a30e9
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ntials directly Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
e17fac9 to
4833fa8
Compare
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.
Why
settings.pyhas grown into a large file mixing configuration (settings classes, validators) with authentication orchestration (OAuth flow, token refresh, credential resolution). This makes the module harder to navigate and creates a tight coupling between unrelated concerns.What
src/dbt_mcp/config/credentials.pycontaining all auth orchestration logic:AuthenticationMethodenumCredentialsProviderclass (with updated OAuth URL construction via_build_dbt_platform_urlandbase_hostproperty from the base branch)get_dbt_platform_context,get_dbt_profiles_path_find_available_port,_is_context_complete,_is_token_valid,_try_refresh_tokenOAUTH_REDIRECT_STARTING_PORTconstantsettings.pyto focus on configuration classes, validators, and host prefix utilities (HostPrefixResult,parse_host_prefix,_build_dbt_platform_url)dbt_mcp.config.credentialsdirectly (no re-exports)dbt_mcp.config.credentialswhere the functions now livefrom __future__ import annotationsandTYPE_CHECKINGincredentials.pyto avoid circular imports withDbtMcpSettingsNotes
_build_dbt_platform_url,HostPrefixResult,parse_host_prefix,base_hostproperty, and the dbt_token warning in the OAuth fallback path. Those changes are incorporated into the extraction.get_dbt_hostfunction (replaced by_build_dbt_platform_url+base_hostin the base branch) is no longer present.Drafted by Claude Opus 4.6 under the direction of @DevonFulcher