Skip to content

[Spark][4.3] Fix OAuth case-sensitivity bug in UCTokenBasedRestClientFactory#7088

Open
seewishnew wants to merge 1 commit into
delta-io:branch-4.3from
seewishnew:fix/oauth-clientid-case-sensitivity-4.3
Open

[Spark][4.3] Fix OAuth case-sensitivity bug in UCTokenBasedRestClientFactory#7088
seewishnew wants to merge 1 commit into
delta-io:branch-4.3from
seewishnew:fix/oauth-clientid-case-sensitivity-4.3

Conversation

@seewishnew

Copy link
Copy Markdown
Collaborator

Backport of #7087 to branch-4.3.

Fixes a bug where CaseInsensitiveStringMap.entrySet() returns lowercase keys, destroying camelCase OAuth config keys like oauth.clientId in the Delta REST Catalog authentication path. See #7087 for full description and reproduction steps.

Cherry-picked cleanly with no conflicts.

@seewishnew seewishnew force-pushed the fix/oauth-clientid-case-sensitivity-4.3 branch from 3927635 to fd440c0 Compare June 24, 2026 19:52
@seewishnew seewishnew force-pushed the fix/oauth-clientid-case-sensitivity-4.3 branch from fd440c0 to 63b9062 Compare June 24, 2026 22:14
CaseInsensitiveStringMap.entrySet() returns keys lowercased via its
internal delegate map. When extractAuthConfig() iterates these entries
and strips the "auth." prefix, camelCase suffixes like "oauth.clientId"
become "oauth.clientid". The downstream OAuthTokenProvider.initialize()
then fails because it does a case-sensitive configs.get("oauth.clientId")
on the resulting plain Map.

Fix: Extract a filterByPrefix() helper that uses asCaseSensitiveMap() to
preserve original key casing from CaseInsensitiveStringMap inputs, and
returns results wrapped in a new CaseInsensitiveStringMap so downstream
consumers get case-insensitive lookups. Refactor both extractAuthConfig
and extractAppVersions to use this helper.

This mirrors the pattern used by the UC Spark connector's
AuthConfigUtils.buildAuthConfigs() which also returns a
CaseInsensitiveStringMap.
@seewishnew seewishnew force-pushed the fix/oauth-clientid-case-sensitivity-4.3 branch from 63b9062 to 63a4cc0 Compare June 24, 2026 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants