Skip to content

feat(virtual): authorize S3 chunks from icechunk repo metadata hints - #1504

Closed
betolink wants to merge 1 commit into
earthaccess-dev:pluginsfrom
betolink:feat/vds-credential-hints
Closed

betolink wants to merge 1 commit into
earthaccess-dev:pluginsfrom
betolink:feat/vds-credential-hints

Conversation

@betolink

@betolink betolink commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

What

open_virtual() now reads the credential hints the vds plugin records in the
icechunk repository metadata (earthaccess:virtual_chunk_credentials) and builds
a refreshable Credentials.S3 provider for each hinted container.

That closes the "custom store" gap: a store whose chunks live in a NASA S3
bucket can be opened from just its href — no CMR result, no provider=, no
hand-built authorize_virtual_chunk_access:

ds = ea.open_virtual("s3://its-live-data/test-space/vds/MUR-SST")

Precedence: explicit authorize_virtual_chunk_access= > metadata hints >
environment/collection defaults. Hints whose prefix is not a configured
container are ignored.

Also fixes a latent bug

authorize_virtual_chunk_access values must be icechunk.credentials.Credentials
wrappers in icechunk 2.3. _build_vcc_credentials returned raw
S3Credentials.* / GCS / Azure values, so any S3-chunk store opened through
earthaccess raised TypeError
(HTTPS stores worked only because the
HttpAccess sentinel is already a Credentials). They are wrapped now; the
three existing VCC tests are updated accordingly.

How

  • _endpoint_credentials(endpoint): module-level, picklable callable that
    exchanges the EDL token at the endpoint (falls back to
    earthaccess.login(strategy="environment"), so it also works on Dask workers
    holding EARTHDATA_TOKEN).
  • _metadata_credential_mapping(metadata, vccs) and
    _reopen_with_metadata_credentials(repo, mapping, explicit): used by the two
    href-based open paths. The collection path keeps its collection credentials.

Tests

  • tests/unit/test_virtual_credentials.py (8): hint parsing, unknown prefixes,
    missing endpoint, real reopen authorizes the container, explicit wins, no-hint
    stores do not reopen, endpoint token exchange.
  • Updated 3 VCC tests for the Credentials wrapper.
  • Full unit suite 919 passed, mypy clean (113 files), ruff clean,
    pre-commit clean.

Pairs with

  • earthaccess-dev/earthaccess-plugin-vds#2 (merged): the writer that records
    the hints.
  • The hints are inert for older readers; the wrapper fix is independent.

📚 Documentation preview 📚: https://earthaccess--1504.org.readthedocs.build/en/1504/

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Binder 👈 Launch a binder notebook on this branch for commit d074073

I will automatically update this comment whenever this PR is modified

Binder 👈 Launch a binder notebook on this branch for commit ab5bc1b

open_virtual() now reads `earthaccess:virtual_chunk_credentials` from the
repository metadata (written by the vds plugin) and builds a refreshable
`Credentials.S3` for each hinted container, so a bare `asset.href` opens
without the caller passing provider=/credentials. Precedence: explicit
`authorize_virtual_chunk_access` > metadata hints > environment defaults.

Also fixes a latent runtime bug: `authorize_virtual_chunk_access` values must
be `icechunk.credentials.Credentials` wrappers, so raw `S3Credentials.*` /
GCS / Azure values raised TypeError on open (HTTPS stores were unaffected
because the sentinels are already Credentials). They are wrapped now.

Tests: tests/unit/test_virtual_credentials.py (8 cases) plus the existing VCC
tests updated for the wrapper.
@betolink
betolink force-pushed the feat/vds-credential-hints branch from d074073 to ab5bc1b Compare November 16, 2026 05:44
@betolink betolink closed this Nov 16, 2026
@betolink
betolink deleted the feat/vds-credential-hints branch November 16, 2026 06:01
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.

1 participant