fix: case-insensitive email auth and AI Gateway fallback#114
Closed
dgokeeffe wants to merge 1 commit into
Closed
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
This was referenced Apr 9, 2026
5 tasks
Owner
|
Hey @dgokeeffe 👋 Thanks for this PR — both fixes are solid and exactly what we needed. I've cherry-picked your commit onto the current Your original authorship is preserved on the commit. Closing this one in favor of #123. |
datasciencemonkey
added a commit
that referenced
this pull request
Apr 14, 2026
Cherry-pick of #114 by David O'Keeffe (@dgokeeffe), rebased onto v0.17.0. 1. Normalize all emails to lowercase at ingestion points so SSO header casing differences don't cause authorization failures. 2. Probe auto-discovered AI Gateway URLs for reachability (2s timeout). Workspaces without AI Gateway gracefully fall back to serving-endpoints. Result cached in _GATEWAY_RESOLVED env var so subprocesses skip re-probing. 3. Version bump to 0.17.1. Co-authored-by: David O'Keeffe <david.okeeffe@databricks.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.
Summary
.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-probing.Changes
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 envTest plan
pytest tests/test_gateway_discovery.py::TestGetGatewayHost— 12 passpytest tests/test_ws_authorization.py— 16 passThis pull request was AI-assisted by Isaac.