Expand description
HTTPS fetch with SHA256 verification and TTL-based local caching (wgex-inspired).
Structs§
Constants§
- DEFAULT_
MAX_ BYTES - Default max download size for a single object (20 MiB).
- DEFAULT_
TIMEOUT_ SECS - Default HTTP timeout.
- DEFAULT_
TTL_ SECS - Default TTL for cached remote objects (24 hours).
Functions§
- cache_
root - Cache root:
$JAN_CACHE_DIRor$XDG_CACHE_HOME/jan(or platform equivalent). - fetch_
and_ install_ bundle - Download a jan bundle zip, verify the zip SHA256, verify manifest members, unpack
under
~/.cache/jan/trees/<sha256>/, and return(tree_dir, root_yaml). - fetch_
verified - Fetch
url, verify againstexpected_sha256, and return the cached file path. - fetch_
verified_ text - Read verified remote content as a UTF-8 string (for YAML includes).
- looks_
like_ remote_ url - Whether a string looks like an http(s) URL suitable for
jan use. - objects_
dir - trees_
dir