Private Access#

Resources on reading OME-Zarr from private (authenticated) storage, such as private S3-compatible buckets or authenticated HTTP servers.

Note that support for authentication changes quickly between tools and versions.

Test dataset#

A small private OME-Zarr (v0.5) store, copied from IDR (idr0062A/6001240_labels.zarr), is hosted on a Hugging Face bucket for testing tools against authenticated S3. The keys below are read-only, scoped to this bucket, and published on purpose for testing:

endpoint:   https://tiagolubiana.s3.hf.co
bucket:     sample-private-ngff-dataset
access key: HFAK1E60mmwcL84SKWRc68ny1mPcxe3
secret key: f9cd5509ce593388e31bd0d88442348cf41b2235ca24e9d4ce278c854e5497ba
region:     us-east-1   (path-style addressing)

Store URL: https://tiagolubiana.s3.hf.co/sample-private-ngff-dataset/6001240_labels.zarr

An unsigned request returns 403; a SigV4-signed request succeeds:

curl --aws-sigv4 "aws:amz:us-east-1:s3" \
  --user "HFAK1E60mmwcL84SKWRc68ny1mPcxe3:f9cd5509ce593388e31bd0d88442348cf41b2235ca24e9d4ce278c854e5497ba" \
  -L https://tiagolubiana.s3.hf.co/sample-private-ngff-dataset/6001240_labels.zarr/zarr.json

Sharing within an institution#

  • Fileglancer (docs) - Web app to browse and share OME-Zarr on network file shares, deployed on an intranet with institutional login. Generates shareable links to Neuroglancer and other viewers.

Python#

Many Python tools use fsspec under the hood, so credentials can be passed as storage_options or set in the fsspec configuration or ~/.aws/credentials. For example, for ngff-zarr:

import zarr
from ngff_zarr import from_ngff_zarr

store = zarr.storage.FsspecStore.from_url(
    "s3://sample-private-ngff-dataset/6001240_labels.zarr",
    storage_options={
        "key": "HFAK1E60mmwcL84SKWRc68ny1mPcxe3",
        "secret": "f9cd5509ce593388e31bd0d88442348cf41b2235ca24e9d4ce278c854e5497ba",
        "client_kwargs": {"endpoint_url": "https://tiagolubiana.s3.hf.co"},
    },
)
multiscales = from_ngff_zarr(store)

Viewers and other tools#