lance-format / lance-format/lance
Pluggable Authentication Providers for REST Namespace
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7.1k
- Forks
- 852
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 272
Description
Summary
Track the implementation of pluggable authentication providers for the Lance REST Namespace, starting with AWS SigV4. The REST Namespace today only supports OAuth2 / Bearer / API Key, which blocks integration with cloud-managed catalogs that use native IAM auth (AWS S3 Tables, API Gateway + IAM Auth). This epic introduces a RestAuthProvider trait in Rust with config-driven selection from Python/Java, and ships SigV4 as the first concrete provider.
Originating proposal: #6583 — see that issue for the full problem statement and prior discussion. Happy to attach a longer design write-up as a comment if reviewers want more depth.
Scope
In scope (this epic)
RestAuthProvidertrait +RestClientintegration pipeline- AWS SigV4 provider (with optional inner-auth delegation)
- Python and Java SDK property pass-through (
rest.auth.*) - Documentation, migration guide, and OpenAPI spec extension
Out of scope (deferred — open separate issues if user demand surfaces)
- OAuth2 auto-refresh provider — the current
header.Authorizationstatic-token path covers most users - Google Cloud / Azure AD providers — open dedicated issues when concrete user requests arrive
- Server-driven auth configuration endpoint (analogous to Iceberg's
initSession) — backwards-compatible to add later - Cross-namespace token cache sharing
Key design decisions
- No cross-FFI trait objects. Custom auth from Python/Java goes through the existing
DynamicContextProvidermechanism. The built-in SigV4 provider is Rust-only and selected by configuration properties. - Only one concrete provider in scope: SigV4.
NoopAuthProvideris the trivial built-in for the unauthenticated case; Bearer/OAuth2/GCP/Azure are deferred (see Out of scope above). Existingheader.Authorizationcontinues to work unchanged. - No decorator/delegate composition. Iceberg's
RESTSigV4AuthManagerwraps OAuth2 by default, but with OAuth2 out of scope here, decorator scaffolding has nothing to wrap. Will be revisited when a second provider lands. - Reuse the existing
RestClient.apply_headerspipeline. Header application order isbase_headers→RestAuthProvider→DynamicContextProvider(the last layer can override auth as an intentional escape hatch). RestNamespaceBuilder::build()returnsResult<RestNamespace>instead ofRestNamespace, but stays synchronous. Auth initialization (token fetch, AWS credential chain resolution) happens lazily inside each provider on first request — not at framework level, and not inbuild(). An opt-inwarm_up_auth().awaitprovides fail-fast credential validation for callers who prefer eager initialization.
Implementation plan
All work happens in lance-format/lance. Tasks are grouped by category; sequencing is implicit in inter-group dependency. PR-level packaging is left to the implementer.
Core framework
- Define
RestAuthProvidertrait,RequestContext, andNoopAuthProviderinrust/lance-namespace-impls/src/rest_auth.rs - Add
auth_providerfield toRestClient; makeapply_headersasync and insertauth.authenticate()betweenbase_headersandDynamicContextProvider - Update
RestNamespaceBuilder::from_propertiesto preserverest.auth.*keys - Add
RestNamespaceBuilder::auth_provider()setter; changebuild()to returnResult<RestNamespace>(still synchronous) - Compatibility tests: existing
header.Authorizationunchanged;rest.auth.type=noneidentical to no config
AWS SigV4 provider
Once this group lands, all three languages gain SigV4 simultaneously — the Python and Java bindings already forward arbitrary properties to RestNamespaceBuilder::from_properties unchanged.
- Add
rest-auth-sigv4Cargo feature withaws-sigv4,aws-credential-types,aws-smithy-runtime-api(aws-configalready available viacredential-vendor-aws) - Implement
SigV4AuthProviderinrest_auth/sigv4.rs: parserest.auth.sigv4.{region,service}, resolve credentials via the AWS chain, sign outgoing requests with theaws-sigv4crate - Add
create_auth_provider(properties)factory dispatching onrest.auth.type; wire intoConnectBuilder::connect() - Add
RestNamespace::warm_up_auth()for opt-in fail-fast credential validation; called byConnectBuilder::connect() - Unit tests for
SigV4AuthProvider: property parsing, header generation with deterministic timestamp, error paths (invalid region / missing credentials)
Multi-language regression coverage
Executable documentation and CI safety nets; no new capabilities.
- Python integration test:
lance.connect("rest", properties={"rest.auth.type": "sigv4", ...})against a mock or real endpoint - Java integration test mirroring the Python one
- List the new
rest.auth.*keys inPyRestNamespace::__init__docstring and JavaconnectJavadoc
Documentation
- Add an "Authentication" section to REST Namespace docs: SigV4 setup (Rust/Python/Java examples), property reference, AWS credential chain notes, migration from
header.Authorization
cc @jackye1995
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading proposal #6583 and the existing RestClient.apply_headers pipeline, then review the task list for rust/lance-namespace-impls/src/rest_auth.rs and rest_auth/sigv4.rs. Run the existing REST namespace tests before adding focused compatibility and SigV4 tests. Done means the provider framework, AWS SigV4 path, Python and Java coverage, and authentication documentation in the listed scope are complete.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, java, python, rust
- Domain
- api, authentication, backend, cloud
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100