Skip to content

bucket

An organisation's bucket: registering it, checking it, and registering the files it holds.

An organisation that holds site storage registers one dedicated S3-compatible bucket, with an access key scoped to it. The platform holds the key sealed and signs every URL for the bucket. The bucket is checked from the admin's browser, which must pass, and from the platform, which is expected not to reach it.

BucketCheck pydantic-model

Bases: BaseModel

The signed requests of one check, on a small test object.

Fields:

BucketCheckOut pydantic-model

Bases: BaseModel

The latest check of the bucket from a browser, with its current key.

Fields:

checked_by pydantic-field

Who ran it: the person or the runner.

steps pydantic-field

Each step and whether it did what it should.

BucketCheckReport pydantic-model

Bases: BaseModel

What each step of a check did.

Fields:

BucketFile pydantic-model

Bases: BaseModel

A file the bucket stores, as its listing names it.

Fields:

  • key (str)
  • size (int)
  • etag (str | None)

etag = None pydantic-field

Its ETag, as the listing names it.

BucketFolders pydantic-model

Bases: BaseModel

The folders a bucket project registered files from: where to look for new files.

Fields:

folders pydantic-field

Each folder its registered files were chosen from, ending in '/', or empty for the whole bucket. A folder inside another is left out: listing the other finds its files.

BucketFound pydantic-model

Bases: BaseModel

Files a listing of the bucket found, as the client reports them.

Fields:

Validators:

  • _files_in_the_folder

files pydantic-field

The files, as the listing names them.

folder = None pydantic-field

The folder whose every file that can be registered files names, ending in '/', or empty for the whole bucket. The project's files registered from below it are judged: one the listing lacks, or names with another size or ETag, is missing at the site; one it names as registered is there again. Without it, nothing is judged.

BucketFoundOut pydantic-model

Bases: BaseModel

Which of the files a listing found the project can register.

Fields:

missing pydantic-field

The keys of the project's files registered from below the folder listed in full that are missing at the site: no file is at the key, or the file there has another size or ETag. Empty when no folder was listed in full.

new pydantic-field

The keys of the files that can be registered where they are and that the project has not registered.

BucketKey pydantic-model

Bases: BaseModel

An access key scoped to the bucket: it may read, write, list and delete there.

Fields:

secret_access_key pydantic-field

Held sealed by the platform, and never returned.

BucketKeyOut pydantic-model

Bases: BaseModel

The key the bucket is signed with; its secret is never returned.

Fields:

  • access_key_id (str)
  • created_at (datetime)

BucketListing pydantic-model

Bases: BaseModel

One page of the bucket to list, to register recordings already stored there.

Fields:

continuation_token = None pydantic-field

The previous page's NextContinuationToken, to list the next.

folders = False pydantic-field

List one level, the folders under the prefix apart from its files, to browse; else every key under it, to register.

prefix = '' pydantic-field

List the keys under this prefix; empty lists the whole bucket.

BucketOut pydantic-model

Bases: BaseModel

The organisation's bucket, its key and its checks.

Fields:

key pydantic-field

The key it is signed with; none once revoked.

projects = 0 pydantic-field

How many projects keep their recordings in it. While none does, a bucket registered in its place replaces it with nothing left behind.

ready pydantic-field

Whether the bucket can hold new projects: it has a key, a browser check with that key passed or warned, and the platform cannot reach it or that was acknowledged.

BucketReads pydantic-model

Bases: BaseModel

Files in the bucket whose headers the browser reads, to register them.

Fields:

keys pydantic-field

The files' keys, each an EDF file outside youSleep/.

BucketReadsOut pydantic-model

Bases: BaseModel

A ranged GET of each file's header, signed for the browser.

Fields:

reads pydantic-field

Each key's GET of its header, valid for a few minutes.

BucketRegistration pydantic-model

Bases: BucketKey

A bucket an organisation registers, with its key.

Fields:

Validators:

endpoint_url pydantic-field

The bucket's S3 endpoint: https://, a host and an optional port, without a path. Path-style addressing is used.

PlatformReachOut pydantic-model

Bases: BaseModel

Whether the platform could reach the bucket when it last tried.

Fields:

acknowledged_at = None pydantic-field

When an owner or admin acknowledged that the platform can reach the bucket. Only a reachable bucket needs it.

SignedRequest pydantic-model

Bases: BaseModel

A request the bucket is to receive, signed by the platform.

Fields:

  • method (str)
  • url (str)
  • headers (dict[str, str])

headers pydantic-field

Headers to send with it; they are part of the signature.

not_registrable(key)

Return why the bucket's file at key cannot be registered where it is, or None.