fix: parse documented [server] auth_* config keys without dropping or mangling - #404
Merged
AutomateIP merged 1 commit intoAug 10, 2026
Conversation
… mangling
Fixes two coupled bugs in the config-file loader that broke the documented
file-based auth configuration path. docs/mcp.conf.example documents all
auth fields under [server] with an auth_* prefix, but those keys were
being silently dropped, and oauth_* field names were being mangled.
- Reorder the section-dispatch loop in config/loaders.py so server_auth_/
auth_ keys are matched before the broad server_ prefix. Previously the
server_ branch absorbed every [server] auth_* key into server_data,
where pydantic silently dropped them (dead server_auth_ branch).
- Add _strip_auth_prefix(), a prefix-only strip (removeprefix), replacing
the global key.replace("auth_", "") that mangled all 8 oauth_* field
names (e.g. oauth_client_id -> oclient_id).
- Add coverage in tests/test_config.py for the documented [server] auth_*
path, the [auth] section, oauth field-name integrity, and confirmation
that itential#403's env/CLI-over-file precedence still holds.
Addresses roadmap 0.14.0 Tier B itential#26 and itential#27. Both surfaced during itential#403
and are fixed together as they share the same dispatch/parsing path.
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
Fixes two coupled bugs in the config-file loader that broke the documented
file-based auth configuration path.
docs/mcp.conf.exampledocuments allauth fields under
[server]with anauth_*prefix, but those keys werebeing silently dropped, and
oauth_*field names were being mangled.Changes
config/loaders.pysoserver_auth_/auth_keys are matched before the broadserver_prefix. Previously theserver_branch absorbed every[server] auth_*key intoserver_data,where pydantic silently dropped them (dead
server_auth_branch)._strip_auth_prefix(), a prefix-only strip (removeprefix), replacingthe global
key.replace("auth_", "")that mangled all 8oauth_*fieldnames (e.g.
oauth_client_id->oclient_id).tests/test_config.pyfor the documented[server] auth_*path, the
[auth]section, oauth field-name integrity, and confirmationthat fix: config file values no longer override env vars and CLI flags #403's env/CLI-over-file precedence still holds.
Testing
make ci, 2829 passed)from
[server] auth_*,oauth_client_idnot mangled,[auth]and[platform]paths unaffected, env-var precedence from fix: config file values no longer override env vars and CLI flags #403 preserved,live
get_healthsucceeds)Related Issues
Addresses roadmap 0.14.0 Tier B #26 (documented
[server] auth_*keyssilently absorbed/dropped) and #27 (
oauth_*field names mangled by a globalstring replace). Both surfaced during #403 and are fixed together as they
share the same dispatch/parsing path.