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§
Structs§
- Origin
Range Request - The chunk-group-aligned span a
Origin::fetch_range_datacall 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 incrate::range_pullandcrate::origin_range. - Origin
Url - Parsed, scheme-validated, and path-normalized origin base URL. The
only way to construct one is
parse_origin_url— once you have anOriginUrl, the following invariants are guaranteed by the type:
Enums§
- Decompress
Mode - How the HTTP origin handles
Content-Encodingon the response. - Origin
Fetch - Result of an
Origin::fetchcall. - Origin
Kind - 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
Filesystemorigin is a local read;HttpandS3may consume metered bandwidth. - Origin
Range Fetch - Result of an
Origin::fetch_range_datacall (ADR 037 §Origin-tier pull-through, #823). - Outboard
Fetch - Result of an
Origin::fetch_outboardcall — a standalone fetch of just the sibling{H}.obao4outboard, 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-Agentheader set on every origin request unless overridden via the operator-configuredcache.user_agent. EmbedsCARGO_PKG_VERSIONof this crate (decdn-config-types). The workspace does not version-link its members, so this can drift from the runningdecdn-nodebinary’s version — that is acceptable: thedecdn-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
OriginUrlcarries 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§
- Origin
Byte Stream - Boxed byte stream returned by
Origin::fetch. EachBytesitem is one chunk of the blob’s payload; the stream completes when the origin signals end-of-data.