Repository navigation
Conversation
Make `oauth2`, `open`, `dirs`, `sha2` optional deps gated behind a new `oauth` Cargo feature. The feature is **on by default**, so existing consumers (pyo3, napi, kernel CI, anyone using `AuthConfig::OAuthM2M` / `OAuthU2M`) see no behaviour change. The `oauth`-off build is exercised by the upcoming `MultiKernelDriverBenchmark` perf suite in `databricks-eng/universe`, which only authenticates with PAT. Shipping the ~12k lines of `oauth2` + `open` source through universe's Rust-crate vendoring system for a code path the benchmark never executes is wasted review surface; this PR lets the universe side opt out via `--no-default-features --features tls-native`. What's gated: - `auth::oauth` module (whole subtree). - `AuthConfig::OAuthM2M` / `OAuthU2M` / `OAuthFederation` variants + their Debug-redaction arms + the redaction tests. - `build_auth_provider` OAuth match arms in `session.rs` plus the imports of `AuthorizationCodeProvider` / `ClientCredentialsProvider`. - `util::runtime::block_on_in_runtime` (only OAuth providers' sync `AuthProvider::get_auth_header` impls call it). - `tests/oauth_u2m_integration.rs` (whole-file) and the OAuth variants in `tests/v0_session_e2e.rs`. `AuthConfig::Pat` and `AuthConfig::External` stay unconditional. Verified both modes locally: - `cargo test --lib` (default features) — 507 tests pass. - `cargo test --lib --no-default-features --features tls-native` — 462 tests pass (the 45 OAuth-specific tests correctly compile out). - `cargo clippy --all-targets -- -D warnings` passes in both configs. - `cargo fmt --all -- --check` passes. Signed-off-by: Gopal Lal <gopal.lal@databricks.com>
None of these are caused by the OAuth gating change; they are
pre-existing drift / new transitive dependencies that this PR
happens to surface. Fixed here to unblock CI.
1. fmt drift in src/reader/cloudfetch/arrow_parser.rs (chain
layout at L63 and L225). `cargo fmt --all` reflow only.
2. Two doc tests at src/session.rs:488 and src/config.rs:365
used `TlsConfig { custom_ca_cert: ..., ..TlsConfig::default() }`
struct-literal construction. `TlsConfig` is `#[non_exhaustive]`,
and doc tests compile as an external crate, so E0639 fires.
Switched to the mutate-after-default pattern, matching how
`ResultConfig` is already constructed externally (see PR #70).
3. tiny-keccak v2.0.2 (transitive via ahash -> const-random ->
const-random-macro) carries CC0-1.0, which was missing from
the deny.toml allow-list. CC0-1.0 is FSF-Free and effectively
public-domain dedication, so adding it is consistent with the
existing permissive allow-list (Apache-2.0, MIT, ISC, etc.).
Signed-off-by: Gopal Lal <gopal.lal@databricks.com>
This branch had an error being deployed
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
Make
oauth2,open,dirs,sha2optional deps gated behind a newoauthCargo feature. Default is on, so existing consumers (pyo3/,napi/, kernel CI, any direct-Rust caller usingAuthConfig::OAuthM2M/OAuthU2M) see no behaviour change.Motivation
The upcoming
MultiKernelDriverBenchmarkperf suite indatabricks-eng/universeconsumes the kernel via universe's Rust-crate vendoring system (each crate's full source is committed underthird_party/rust/crates/). The benchmark only authenticates with PAT and never touches OAuth at runtime, but withoauth2/openas unconditional kernel deps, universe was forced to vendor and review ~12k lines of source it would never execute. This gate lets the universe side opt out via--no-default-features --features tls-native.What's gated
auth::oauthmodule (whole subtree).AuthConfig::OAuthM2M/OAuthU2M/OAuthFederationvariants + theirDebugredaction arms + the redaction tests insrc/config.rs.build_auth_providerOAuth match arms insrc/session.rs, plus the imports ofAuthorizationCodeProvider/ClientCredentialsProvider.util::runtime::block_on_in_runtime(only the OAuth providers' synchronousAuthProvider::get_auth_headerimpls call it).tests/oauth_u2m_integration.rs(whole-file#![cfg(feature = "oauth")]) and the OAuth-specific arms oftests/v0_session_e2e.rs.AuthConfig::PatandAuthConfig::Externalremain unconditional.Verification
Ran the full pre-commit checklist (per
CLAUDE.md) in both feature configs:oauthon (default)oauthoffcargo test --libcargo clippy --all-targets -- -D warningscargo fmt --all -- --checkCompatibility
oauth-off consumers: 3AuthConfigvariants +crate::auth::oauth::*symbols are absent. Match statements overAuthConfigget smaller (PAT + External only). Wrappers that compile againstdefault-features = truesee no difference.DCO sign-off included; commit message follows conventional-commits per repo convention.