Quartz::SDK::Downloader
Fetches and extracts an SDK archive for a variant+channel into a target dir.
Flow:
- Resolve (url, sha256?) via variant-specific strategy
- Stream body to <target>.partial/archive.{zip|tgz}
- Verify sha256 if expected
- Extract into <target>.partial
- Atomic rename <target>.partial -> <target>
Constants
ALLOWED_HOSTS = ["update.flipperzero.one", "github.com", "api.github.com", "objects.githubusercontent.com", "codeload.github.com", "raw.githubusercontent.com"] of ::String
Allowlist of SDK/firmware hosts. Extend via QUARTZ_SDK_HOSTS (comma-sep). Blocks SSRF via user-controlled URLs: localhost, RFC1918, link-local, cloud metadata.
DEFAULT_MAX_REDIRECTS = 5
DEFAULT_TIMEOUT = 60.seconds
Class methods
download_to(url : String, dest : String, timeout : Time::Span = DEFAULT_TIMEOUT, max_redirects : Int32 = DEFAULT_MAX_REDIRECTS) : Nil
Exposed for tests & drivers that want to stream to an arbitrary URL.
Public entrypoint. Returns the final target path.