fix(revyl): bind uploads to admitted job destinations

Merged
TH
1d ago
+364-43

Summary

The build uploads only to an HTTPS URL from the Revyl API that resolves to a public address, over a connection to that approved address. Private, loopback and link-local hosts are refused, redirects are refused, and the Revyl bearer token is never attached. website/docs/docs/revyl.md notes that a backend returning private storage URLs cannot install local builds.

Before / after

Before: the upload URL went straight to fetch, so an internal host could receive the build.
After: uploadRevylArtifact requires https: and approves the URL with approveDownloadSourceUrl. It sends a PUT with https.request and agent: false, using a lookup pinned to the approved address. The URL host still sets SNI, certificate checks and Host. No pooled socket or proxy agent can skip the pin.
A request error at any time fails the upload. The body is exactly the stat'ed size. An empty or shortened file fails with revyl_upload_unreachable.
Reasons: revyl_upload_destination_refused, revyl_upload_rejected (with status), revyl_upload_unreachable.

Validation

Tested at 4835963: artifact-upload.test.ts 15 passed, provider-revyl tests 46 passed, hosted CI green. Removing the late error listener or the byte check fails its test.
Production delta versus 0.22: about +82 lines.
Risk: low. A live Revyl Android run at 4835963 uploaded a local APK and installed it, then released the session (receipt).