Skip to main content

Module config

Module config 

Source
Expand description

The mesh’s configuration: Config, from code or from the environment (Config::from_env).

Secrets never come from here directly: the signing key and the API keys are read from files that must have mode 0600 (read_secret_file).

Structs§

Config
The mesh’s configuration.
ConfigError
A configuration error: what and why.
Policy
Per-function rules, by fully qualified function name. Functions without one are free.
RateLimits
Rate limits (token buckets), per minute. Refused requests are answered rate_limited with retry_after_seconds and Retry-After; nothing is ever queued.
Ttls
Cache lifetimes. Content-addressed objects (descriptors, receipts, manifests, blobs) never expire: their bytes are fixed by their hash.

Enums§

BaseUrlError
Why a base URL (Config::base_url) is refused.
PublishDomains
Which hosts may publish with POST /bundles (DATUMESH_PUBLISH_DOMAINS): the mesh’s own namespaces always; then none (the default), named hosts, or any host with a valid key document (*).
Rule
What a function’s cells need (the licence and payment stubs of step 1.4).

Constants§

DEFAULT_BATCH_MAX
The default bound on a POST /cells batch.
DEFAULT_BUDGET
The default wall-clock budget of a request before it is answered pending (SPEC 5.5).
DEFAULT_POOL_SIZE
The default size of the blocking pool, which is the concurrency limit of evaluation and store access (see the crate documentation for why).
DEFAULT_SLICE_PAGE
The default number of members in one JSON page of GET /slice.
MAX_SLICE_MEMBERS
The bound on the members of a slice served (SPEC 10.1: a manifest has at most 1,048,576).
MAX_SLICE_PAGE
The bound on a JSON page of GET /slice (limit=).

Functions§

check_base_url
Checks a base URL (Config::base_url) for a mesh signing as host: https:// with any host, or, when host is unrooted (is_unrooted), http:// with 127.0.0.1, [::1] or localhost; then an optional :<port> (1 to 65535) and nothing else: no path, query, fragment, trailing slash or userinfo. The form is checked first, then the scheme’s rule: http:// for a rooted host is BaseUrlError::HttpRootedHost before anything about the URL’s host.
is_unrooted
Whether a host is unrooted (SPEC 2.5, spec-0.4.3): its last label is invalid (local.invalid, agent-7.local.invalid). Every other host is rooted.
read_secret_file
Reads a file holding a secret, refusing it unless only its owner may read or write it (mode 0600 or stricter, on Unix).