Add-on libraries: let a custom source allow the hosts its URL redirects to
Context
#13296: a 5.0.0 install could not load the official add-on library, because GitHub answers a release asset URL with a 302 and the add-on library client refuses redirects. #13341 fixes it by following redirects only to a fixed list of GitHub download hosts (catalog.ReleaseAssetHosts), with every hop checked against the external URL policy.
The gap
That list is built in and the same for every library source. A custom library whose URL redirects to a host outside the list (a CDN, an object store, a mirror behind a redirect) is still refused and ends up with zero entries, the same failure that #13296 reported for the official library.
Proposal
- An optional
redirectHostslist on a library source, next to its URL and signature policy. The host of the source's own URL is allowed implicitly; the admin can add more hosts. - The official source keeps the built-in GitHub list.
- Rules stay as in #13341: https only, default port, at most 5 hops, each hop checked against the external URL policy, request headers dropped on a hop to another origin. Signature policy and entry digests stay the trust anchor.
- Settings UI field, docs under
docs/content/addons/, and a log line that names the refused host when a redirect is refused.
Related, separate bug
One failing library source empties the whole add-on list: #13347.