Skip to main content

Module origin

Module origin 

Source
Expand description

Origin backends — the source of truth a node falls back to on a cache miss.

Origin is the seam. Three concrete implementations ship today: HttpOrigin (generic HTTP/S), FilesystemOrigin (local disk), and S3Origin (S3-compatible object stores: AWS S3, R2, B2, MinIO).

Re-exports§

pub use fs::FilesystemOrigin;
pub use http::HttpOrigin;
pub use s3::S3Credentials;
pub use s3::S3Origin;
pub use s3::S3OriginConfig;

Modules§

fs
Filesystem origin backend.
http
HTTP origin backend.
s3
S3-compatible origin backend (#437).

Structs§

OriginRangeRequest
The chunk-group-aligned span a Origin::fetch_range_data call must fetch, passed from the engine to the adapter. This is the produced-by-engine half of the range pull; the verify-against-root half lives in crate::range_pull and crate::origin_range.
OriginUrl
Parsed, scheme-validated, and path-normalized origin base URL. The only way to construct one is parse_origin_url — once you have an OriginUrl, the following invariants are guaranteed by the type:

Enums§

DecompressMode
How the HTTP origin handles Content-Encoding on the response.
OriginFetch
Result of an Origin::fetch call.
OriginKind
Tag identifying which origin backend a cache engine is configured against (#439). Surfaced through the admin eviction-preview so dry-run callers can estimate origin egress cost — re-fetching from a Filesystem origin is a local read; Http and S3 may consume metered bandwidth.
OriginRangeFetch
Result of an Origin::fetch_range_data call (ADR 037 §Origin-tier pull-through, #823).
OutboardFetch
Result of an Origin::fetch_outboard call — a standalone fetch of just the sibling {H}.obao4 outboard, with no accompanying blob data. Feeds a later “stream-while-store” serve path (#1130): a node that already holds the outboard but not the full blob can start verifying/serving a requester’s byte range before the origin pull-through of the data completes, rather than waiting on a whole-blob fetch first.

Constants§

DEFAULT_USER_AGENT
Default User-Agent header set on every origin request unless overridden via the operator-configured cache.user_agent. Embeds CARGO_PKG_VERSION of this crate (decdn-config-types). The workspace does not version-link its members, so this can drift from the running decdn-node binary’s version — that is acceptable: the decdn-node/ prefix is the stable contract operators grep on in access logs; the version segment is best-effort attribution (#435, #578). Lets origin operators attribute CDN pull-through traffic and apply origin-side rate limits or routing rules separately from anonymous client traffic.

Traits§

Origin
An origin backend. Implementors fetch a blob identified by its BLAKE3 hash.

Functions§

parse_origin_url
Parse and normalize an origin base URL. This is the single source of truth for origin-URL validation — config resolution and test helpers both go through it, and the returned OriginUrl carries the scheme/path/query invariants in the type.
redact_for_log
Return a loggable form of an origin URL with userinfo (user:pass@) stripped. Operators may legitimately use basic-auth-in-URL for internal origins, but those credentials must not reach logs or error messages.

Type Aliases§

OriginByteStream
Boxed byte stream returned by Origin::fetch. Each Bytes item is one chunk of the blob’s payload; the stream completes when the origin signals end-of-data.