abilian_cdn.client¶
The HTTP client the CLI drives. Useful on its own for a script that would rather not shell out.
abilian_cdn.client ¶
The client side: talking to a CDN from a terminal or a CI job.
Separate from the server modules on purpose — nothing here imports the
database or the object store, so cdn put works on a laptop that has neither.
ClientError ¶
Bases: RuntimeError
The server refused, and this says what it said.
Credentials
dataclass
¶
Where to talk, and what to say who we are.
load
classmethod
¶
load(path: Path = CONFIG_PATH) -> Credentials
Read the environment first, then the config file.
The environment wins so a CI job can hold its token in a secret rather than in a file it would have to write first.
Client ¶
The handful of calls the command line makes.
list_objects ¶
Every object under a prefix, following the server's paging.
A generator, so ls on a zone with a million objects prints the
first page while the rest is still arriving.
put_file ¶
Upload one file, streamed rather than read into memory.
sign ¶
Ask the service for a URL that serves this object without a token.
content_digest ¶
The digest a single-part S3 upload reports as its ETag: MD5, hex.
Not a security claim — it is the only fingerprint both ends already have,
which is what makes sync able to skip a file without downloading it.