S3

The S3 key-value store is a root key-value store for accessing S3 buckets hosted by Amazon as well as other S3-compatible servers.

URL syntax

  • s3://bucket/path

    Specifies an Amazon S3 bucket (with the endpoint bucket.s3.amazonaws.com).

  • s3+https://host/path or s3+https://host/bucket/path

    Specifies an S3-compatible server at http://host or https://host.

    Note

    This URL syntax can ambiguously specify either:

    • a virtual hosted-style URL s3+https://host/path, where https://host refers to a single bucket, or

    • a path-style URL s3+https://host/bucket/path, where the bucket is specified as the first component of the path.

    Neuroglancer automatically detects which of these cases applies.

Capabilities

Supported capabilities

Byte range reads

Supported

Key listing

Supported with s3:ListBucket permission.

Authentication

Currently, only anonymous access is supported.

CORS

If the Neuroglancer client itself is not hosted in the same S3 bucket, the bucket must be configured with a CORS policy such as the following:

[
    {
        "AllowedHeaders": [
            "*"
        ],
        "AllowedOrigins": [
            "*"
        ],
        "ExposeHeaders": [
            "ETag",
            "Content-Range",
            "Content-Encoding",
            "Content-Length"
        ],
        "MaxAgeSeconds": 3000
    }
]

Warning

Write operations (e.g. for Voxel Annotation) are sent as unauthenticated requests: there is no access control yet. Only allow anonymous writes on a bucket whose contents you are willing to have publicly modified, such as a scratch bucket.

If you accept these limitations and risks, add PUT to AllowedMethods. When allowing writes, do not use a wildcard AllowedOrigins; explicitly list the origins that should be permitted to write:

[
    {
        "AllowedHeaders": [
            "*"
        ],
        "AllowedMethods": [
            "GET",
            "HEAD",
            "PUT"
        ],
        "AllowedOrigins": [
            "https://example.com"
        ],
        "ExposeHeaders": [
            "ETag",
            "Content-Range",
            "Content-Encoding",
            "Content-Length"
        ],
        "MaxAgeSeconds": 3000
    }
]