fix: case-insensitive email auth and AI Gateway fallback#123
Merged
datasciencemonkey merged 2 commits intomainfrom Apr 14, 2026
Merged
fix: case-insensitive email auth and AI Gateway fallback#123datasciencemonkey merged 2 commits intomainfrom
datasciencemonkey merged 2 commits intomainfrom
Conversation
Two fixes for CODA deployments:
1. Normalize all emails to lowercase at ingestion points (get_token_owner,
get_request_user, WebSocket auth) so SSO header casing differences
don't cause authorization failures.
2. Probe auto-discovered AI Gateway URLs for reachability (2s timeout)
before using them. Workspaces without AI Gateway gracefully fall back
to {DATABRICKS_HOST}/serving-endpoints/anthropic. Result cached in
_GATEWAY_RESOLVED env var so subprocesses skip re-probing.
Co-authored-by: Isaac
4 tasks
Co-authored-by: David O'Keeffe <david.okeeffe@databricks.com>
Owner
Author
|
Context note: While the code changes here are simple, this was a real blocker — CoDA couldn't deploy on workspaces without AI Gateway enabled. The gateway auto-discovery would construct a URL, never verify it was reachable, and all agent setup scripts would fail trying to hit a non-existent endpoint. David's probe + fallback pattern fixes this cleanly. |
This was referenced Apr 14, 2026
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
Cherry-pick of #114 by @dgokeeffe, rebased onto current
main(v0.17.0)..lower()at ingestion points — fixes access denied when SSOX-Forwarded-Emailheader casing differs from stored owner email (e.g.RC.Guan@vsrc.guan@){DATABRICKS_HOST}/serving-endpoints/anthropic. Probe result cached in_GATEWAY_RESOLVEDenv var so setup subprocesses skip re-probingChanges
app.py.lower()inget_token_owner(),get_request_user(), WebSocket auth;resolve_and_cache_gateway()calls inrun_setup()and_configure_all_cli_auth()utils.py_probe_gateway(),resolve_and_cache_gateway(), Tier 0_GATEWAY_RESOLVEDcheck inget_gateway_host()tests/test_gateway_discovery.py_GATEWAY_RESOLVEDin integration test envpyproject.tomlCredit
All work in this PR is by David O'Keeffe (@dgokeeffe). Original PR: #114. Cherry-picked onto v0.17.0 main to resolve line-offset drift from #119.
Test plan
pytest tests/test_gateway_discovery.py— 12 passpytest tests/test_ws_authorization.py— 16 pass