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
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)
ngff-zarr FAQ: authentication -
from_ngff_zarralso acceptsstorage_optionsdirectly.image.sc: Open OME-Zarr from protected object store with Python
Viewers and other tools#
image.sc: OME-Zarr viewer supporting private S3 buckets - Community overview: napari-ome-zarr (via fsspec), WebKnossos (private S3, GCS and authenticated HTTP), Image Data Explorer, Fiji / N5-viewer, Vizarr (Fractal prototype), and MoBIE / Fiji.
MoBIE - Fiji plugin that can open OME-Zarr multiscales from private S3 buckets; see tischi’s notes on credentials.
Neuroglancer: Issue for authenticated S3-compatible buckets (google/neuroglancer#507)
fractal-vizarr-viewer - Serving Vizarr with server-side authentication.
OME-NGFF validator: signed requests PR (ome/ome-ngff-validator#97)
image.sc: QuPath loading OME-Zarr from a private S3 bucket - Workaround: mount the bucket as a local filesystem (e.g. with s3fs or rclone, as offered by the BAND “Mount S3 bucket” app) and open the OME-Zarr as local files.