René's URL Explorer Experiment


Title: Support pluggable AWS credentials for the S3 object store (credentials provider callback) · Issue #116 · apache/datafusion-java · GitHub

Open Graph Title: Support pluggable AWS credentials for the S3 object store (credentials provider callback) · Issue #116 · apache/datafusion-java

X Title: Support pluggable AWS credentials for the S3 object store (credentials provider callback) · Issue #116 · apache/datafusion-java

Description: Is your feature request related to a problem or challenge? ObjectStoreOptions.S3 currently supports two credential modes: static values (accessKeyId / secretAccessKey / sessionToken) passed once at registration, or falling through to obj...

Open Graph Description: Is your feature request related to a problem or challenge? ObjectStoreOptions.S3 currently supports two credential modes: static values (accessKeyId / secretAccessKey / sessionToken) passed once at...

X Description: Is your feature request related to a problem or challenge? ObjectStoreOptions.S3 currently supports two credential modes: static values (accessKeyId / secretAccessKey / sessionToken) passed once at...

Opengraph URL: https://github.com/apache/datafusion-java/issues/116

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support pluggable AWS credentials for the S3 object store (credentials provider callback)","articleBody":"  **Is your feature request related to a problem or challenge?**\n  \n  `ObjectStoreOptions.S3` currently supports two credential modes: static values (`accessKeyId` / `secretAccessKey` / `sessionToken`) passed once at registration, or falling through to `object_store`'s built-in provider chain (IMDS instance profile, ECS task endpoint, EKS pod identity, web identity).\n  \n  For a long-lived `SessionContext` — the intended usage pattern for DataFusion — this leaves no working credential story in several common deployments:\n  \n  - **STS-assumed roles**: IMDS only serves the instance-profile role. Credentials for an assumed role (cross-account, scoped-down, role chaining) can only be passed statically, and expire after 1–12h with no refresh. Queries then start failing with `ExpiredToken` until the store is somehow rebuilt.\n  - **AWS Lambda**: there is no IMDS endpoint. Credentials arrive via environment variables, which `object_store` captures once as a `StaticCredentialProvider`. A `SessionContext` cached across warm invocations goes stale when the environment credentials rotate underneath it.\n  - **SSO / profiles / `credential_process` / custom credential vendors**: not in `object_store`'s chain at all.\n  \n  Upstream has explicitly declined to widen the built-in chain: apache/arrow-rs#5143 (use the official AWS SDK) and apache/arrow-rs-object-store#47 (`credential_process` support) were both closed as not planned. The sanctioned extension point is\n  [`AmazonS3Builder::with_credentials(AwsCredentialProvider)`](https://docs.rs/object_store/latest/object_store/aws/struct.AmazonS3Builder.html#method.with_credentials). Quoting the object_store maintainer in those threads:\n  \n  > \"Users can provide their own credential providers […] This could even be using the AWS SDK if they so wish.\"\n  \n  > \"Encouraging the downstreams to expose, or otherwise utilize the object_store credential provider API would avoid this entirely.\"\n  \n  > \"I'd naturally prefer the solution that gives users the most flexibility and avoids needing to revisit this again when someone comes along requesting SSO or similar.\"\n  \n  The Java binding does not expose this extension point, so Java users are locked out of everything the AWS SDK for Java's default credential chain already handles. There is direct precedent for fixing this at the binding layer: arrow-rs-object-store#47 was closed *because* polars exposed a credential provider\n  callback in its Python API (\"Polars exposed it as part of their API and configured it to use boto when available. I'm going to close this…\").\n  \n  ### Describe the solution you'd like\n  \n  An S3-specific credentials provider callback on the S3 options builder, bridged to `AmazonS3Builder::with_credentials`:\n  \n  ```java\n  /**\n   * Supplies current AWS credentials. Invoked by the native layer when its cached\n   * credentials approach expiry; implementations must be thread-safe.\n   */\n  @FunctionalInterface\n  public interface AwsCredentialsProvider {\n    AwsCredentials get();\n  }\n  \n  public record AwsCredentials(\n      String accessKeyId,\n      String secretAccessKey,\n      Optional\u003cString> sessionToken,\n      Optional\u003cInstant> expiration) {}\n  \n  SessionContext.builder()\n      .registerObjectStore(\n          ObjectStoreOptions.s3()\n              .bucket(\"my-bucket\")\n              .credentialsProvider(provider) // new\n              .build())\n      .build();\n  \n  // Typical usage delegates to the AWS SDK for Java, which brings the full default chain (SSO, profiles, credential_process, STS auto-refresh, Lambda env) for free:\n  \n  var sdk = software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider.create();\n  var options = ObjectStoreOptions.s3()\n      .bucket(\"my-bucket\")\n      .credentialsProvider(() -> AwsCredentials.from(sdk.resolveCredentials()))\n      .build();\n```\n\n  Native side. A Rust struct holding a JNI GlobalRef to the Java provider implements object_store::CredentialProvider\u003cCredential = AwsCredential> and is passed to AmazonS3Builder::with_credentials in build_s3 (native/src/object_store.rs). The bridge caches the returned credentials keyed on expiration (no expiration\n  = cache indefinitely) with a min-TTL refresh-ahead check, so the JVM upcall fires roughly once per credential rotation, not per request. The repo already has the required upcall machinery: native/src/udf.rs holds a GlobalRef plus cached bridge class and calls attach_current_thread() to invoke Java from DataFusion\n  execution threads — the credentials bridge follows the same pattern. (object_store's own TokenCache is pub(crate), so the bridge implements its own small equivalent, as delta-rs does.)\n  \n  Since registration currently crosses JNI as a serialized protobuf ObjectStoreRegistration, the provider jobject would be passed alongside the message rather than inside it — the same way UDF registration passes the UDF object.\n  \n  Semantics.\n  \n  - The provider is called on native (tokio worker) threads; implementations must be thread-safe.\n  - Returning an expiration opts into refresh: the native layer re-invokes the provider before expiry. Because every request resolves credentials at sign time, rotation is safe mid-query — long scans and multipart uploads spanning a rotation just sign later requests with the newer credentials.\n  - Mutually exclusive with static accessKeyId/secretAccessKey on the same builder — setting both is a build-time error.\n  - Java exceptions from the provider are translated into object_store::Error::Generic and surface as query errors.\n  - The GlobalRef is released when the registered store is dropped.\n  \n  Non-goals.\n  \n  - No generic cross-backend credential abstraction: with_credentials is typed per backend (AwsCredential vs GcpCredential bearer tokens), so this API belongs on the S3 builder only.\n  - GCS is out of scope: service-account keys and the metadata server already self-refresh in object_store. A gcs().credentialsProvider(...) (bearer-token supplier) can follow the same pattern later if a concrete need appears.\n  - No replication of the AWS credential chain inside the binding — resolving credentials is the AWS SDK for Java's job; the binding only ferries the result. The binding takes no dependency on the AWS SDK; a convenience adapter could be a follow-up.\n  \n  ### Describe alternatives you've considered\n  \n  1. **Do nothing / document the built-in chain.** Leaves STS-assumed roles, Lambda with a cached context, SSO, and `credential_process` broken; upstream has frozen the built-in chain (apache/arrow-rs#5143, apache/arrow-rs-object-store#47), so this gap is permanent.\n  2. **Imperative `refreshCredentials(newCreds)` method.** Requires the application to run its own expiry timers, is not atomic with respect to in-flight queries without extra locking in the binding, and puts lifecycle behavior on an immutable options object. The pull-based provider + cache is race-free by\n  construction (each request resolves current credentials) and matches the design every AWS SDK converged on.\n  3. **Re-register the object store with new options.** Same timer problem, plus undefined behavior for scans already planned against the previously registered store.\n  \n  \n  ### Additional context\n  \n  - Maintainer guidance to downstream bindings: apache/arrow-rs#5143 (comments from 2024-08-29 onward) and apache/arrow-rs-object-store#47.\n  - Precedent: polars exposed exactly this callback in its Python API, which is what closed arrow-rs-object-store#47 (pola-rs/polars#18979).\n  - Rust-side reference implementation gluing the AWS SDK to a `CredentialProvider`: [delta-rs `credentials.rs`](https://github.com/delta-io/delta-rs/blob/main/crates/aws/src/credentials.rs).\n  - Existing Rust→Java upcall pattern in this repo: `native/src/udf.rs` (`GlobalRef` + `attach_current_thread`).\n  \n  I'm happy to implement this if the approach is agreed.\n","author":{"url":"https://github.com/vigneshtdev","@type":"Person","name":"vigneshtdev"},"datePublished":"2026-08-26T11:09:37Z","url":"https://github.com/apache/datafusion-java/issues/116"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:87ba1f3f-b331-122e-37e6-b5e69fa9181a
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id83E0:2815D1:21DD30:2EE2F8:6B0467F8
html-safe-noncea77facdf057265cd9d0ee77e9cd67660b01a36a56294f378d40c71d07fa91566
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4M0UwOjI4MTVEMToyMUREMzA6MkVFMkY4OjZCMDQ2N0Y4IiwidmlzaXRvcl9pZCI6IjcxODQyMDMxNzk0Nzc5ODUyNzIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacbc0266aa84d90101ab3af023559277b211df1f7c4d815d6c6bd7b7ca53ac8e66
hovercard-subject-tagissue:5256327204
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/apache/datafusion-java/116/issue_layout
twitter:imagehttps://opengraph.githubassets.com/298ffc853aa7cab39b8876af1ab6beb9668b9b80fb6057ec50fbea1e1dfc74d5/apache/datafusion-java/issues/116
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/298ffc853aa7cab39b8876af1ab6beb9668b9b80fb6057ec50fbea1e1dfc74d5/apache/datafusion-java/issues/116
og:image:altIs your feature request related to a problem or challenge? ObjectStoreOptions.S3 currently supports two credential modes: static values (accessKeyId / secretAccessKey / sessionToken) passed once at...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamevigneshtdev
hostnamegithub.com
expected-hostnamegithub.com
None83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f
turbo-cache-controlno-preview
go-importgithub.com/apache/datafusion-java git https://github.com/apache/datafusion-java.git
octolytics-dimension-user_id47359
octolytics-dimension-user_loginapache
octolytics-dimension-repository_id1237105117
octolytics-dimension-repository_nwoapache/datafusion-java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1237105117
octolytics-dimension-repository_network_root_nwoapache/datafusion-java
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseca4d07a7cef4e4b75f821dc25e7300d80c1450a9
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/apache/datafusion-java/issues/116#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fdatafusion-java%2Fissues%2F116
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fdatafusion-java%2Fissues%2F116
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=apache%2Fdatafusion-java
Reloadhttps://github.com/apache/datafusion-java/issues/116
Reloadhttps://github.com/apache/datafusion-java/issues/116
Reloadhttps://github.com/apache/datafusion-java/issues/116
apachehttps://github.com/apache
datafusion-javahttps://github.com/apache/datafusion-java
Codehttps://github.com/apache/datafusion-java
Issues10 (10)https://github.com/apache/datafusion-java/issues
Pull requests10 (10)https://github.com/apache/datafusion-java/pulls
Discussionshttps://github.com/apache/datafusion-java/discussions
Actionshttps://github.com/apache/datafusion-java/actions
Security and qualityhttps://github.com/apache/datafusion-java/security
Insightshttps://github.com/apache/datafusion-java/insights
https://github.com/apache/datafusion-java
New issuehttps://github.com/login?return_to=https://github.com/apache/datafusion-java/issues/116
New issuehttps://github.com/login?return_to=https://github.com/apache/datafusion-java/issues/116
Support pluggable AWS credentials for the S3 object store (credentials provider callback)https://github.com/apache/datafusion-java/issues/116#top
https://github.com/vigneshtdev
vigneshtdevhttps://github.com/vigneshtdev
on Aug 26, 2026https://github.com/apache/datafusion-java/issues/116#issue-5256327204
apache/arrow-rs#5143https://github.com/apache/arrow-rs/issues/5143
apache/arrow-rs-object-store#47https://github.com/apache/arrow-rs-object-store/issues/47
AmazonS3Builder::with_credentials(AwsCredentialProvider)https://docs.rs/object_store/latest/object_store/aws/struct.AmazonS3Builder.html#method.with_credentials
object_store: Use the official AWS SDK for s3 interactions arrow-rs#5143https://github.com/apache/arrow-rs/issues/5143
[object-store]: Implement credential_process support for S3 arrow-rs-object-store#47https://github.com/apache/arrow-rs-object-store/issues/47
object_store: Use the official AWS SDK for s3 interactions arrow-rs#5143https://github.com/apache/arrow-rs/issues/5143
[object-store]: Implement credential_process support for S3 arrow-rs-object-store#47https://github.com/apache/arrow-rs-object-store/issues/47
Allow Overriding Object Store Credential Provider pola-rs/polars#18979https://github.com/pola-rs/polars/issues/18979
delta-rs credentials.rshttps://github.com/delta-io/delta-rs/blob/main/crates/aws/src/credentials.rs
Sign up for freehttps://github.com/signup?return_to=https://github.com/apache/datafusion-java/issues/116
Sign in to commenthttps://github.com/login?return_to=https://github.com/apache/datafusion-java/issues/116
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.