Watch
1
0
Fork
You've already forked pkg-proxy
1
mirror of https://github.com/git-pkgs/proxy.git synced 2026-11-09 23:59:16 -05:00
pkg-proxy/internal/handler
Repository files (latest commit first)
Filename Latest commit message Latest commit date
simon chrzanowski 1979fb098e
Accept Swift source repository PURLs in the denylist and retention rules (#641)
* Accept Swift source repository PURLs in the denylist and retention rules

Closes #613. pkg:swift/github.com/apple/swift-nio, as SBOM tools and GHSA
write Swift packages, is resolved to its registry identity through the
upstream's /identifiers:

- Denylist entries are resolved at startup, and the proxy refuses to start
  when one can't be, since a skipped entry would let the version through.
- Retention keys are accepted at validation and kept pending. The
  retention loop resolves them before each sweep, and Swift isn't swept
  while any is pending, so a rule that keeps a package is never skipped.

The mirror's source URL helper moves to the handler as SwiftSourceURL.

* Resolve Swift source denylist entries in proxy mirror too

serve resolved source-form Swift denylist entries through the upstream,
but proxy mirror built its denylist directly, so such an entry never
matched a mirror download. Both now use server.ConfigureDenylist, and
neither runs when an entry can't be resolved.

* Apply Swift source policies to every listed identity

A Swift registry may list several identities for one source repository,
but a denylist entry or retention rule naming the repository only
covered the first. Denying pkg:swift/github.com/acme/widget@1.0.0 let
acme.widget through when the registry listed other.widget first, and a
never-evict rule cleared the cached apple.swift-nio archive when
other.swift-nio came first.

Both now cover every identity the registry lists. A retention rule that
conflicts with another rule for any of them stays pending, with none
applied. Mirroring a source PURL still downloads the first identity.
2026-10-31 11:34:05 +00:00
..
apk.go Refuse '?' and '#' through rejectQueryChars in APK, Debian and RPM 2026-10-25 09:55:14 +00:00
apk_test.go Stop forwarding custom auth headers across redirects 2026-10-14 08:38:51 +02:00
arch.go Separate artifact and metadata cache metrics on /metrics and the analytics page (#463) 2026-10-20 11:25:33 +01:00
arch_concurrency_test.go Concurrent clients could still end up with a database and a signature that don't belong together. Databases are now stored under their digest like signatures, so a cache row and its bytes always agree, also with several replicas on shared storage. Writes for one database are serialized, and the signature recovery shares the refresh with database requests, so a slow fetch can no longer store an older database over a newer one. When the cache write fails, the proxy serves the database the cache still describes. Unchanged databases are no longer rewritten, and a remembered missing signature is asked for again after the metadata TTL. The new tests force these interleavings with storage and upstream hooks. 2026-10-12 20:06:59 +02:00
arch_test.go Stop forwarding custom auth headers across redirects 2026-10-14 08:38:51 +02:00
artifact_size_test.go Use shared registries size limits and rate-limit gate (#516) 2026-10-19 13:28:55 +02:00
cache_key.go Refuse '?' and '#' through rejectQueryChars in APK, Debian and RPM 2026-10-25 09:55:14 +00:00
cache_key_test.go Hash path-based metadata cache keys 2026-10-24 12:55:00 +02:00
cargo.go Expire cooldown rewrites when a withheld version becomes available (#638) 2026-10-30 14:06:42 +00:00
cargo_test.go Stop forwarding custom auth headers across redirects 2026-10-14 08:38:51 +02:00
chef.go Fix npm search routing and abbreviated packuments under cooldown 2026-10-23 13:22:49 +02:00
chef_test.go Add Chef Supermarket proxy support for Berkshelf and Policyfiles (#518) 2026-10-19 07:59:39 +01:00
coalesce_semantics_test.go Verify npm tarballs against dist.integrity 2026-10-14 15:40:36 +02:00
coalesce_test.go Fix duplicate fetches and 502s on concurrent cache misses (#329) 2026-09-15 19:59:03 +01:00
composer.go Expire cooldown rewrites when a withheld version becomes available (#638) 2026-10-30 14:06:42 +00:00
composer_download_lookup_test.go Serve cached Composer releases without a metadata lookup 2026-10-23 13:22:56 +02:00
composer_hosted.go Fix npm search routing and abbreviated packuments under cooldown 2026-10-23 13:22:49 +02:00
composer_hosted_test.go Host generic files and share one push path across hosted ecosystems 2026-10-21 12:23:54 +02:00
composer_rewrite_bench_test.go Update x/net and remove unused production helpers 2026-10-19 08:35:46 +01:00
composer_rewrite_test.go Update x/net and remove unused production helpers 2026-10-19 08:35:46 +01:00
composer_routes_test.go Add package routes for private Composer and npm registries (#426) 2026-10-11 18:06:18 +01:00
composer_shasum_test.go Leave Composer dev branch archives unverified 2026-10-14 18:06:01 +02:00
composer_test.go Update x/net and remove unused production helpers 2026-10-19 08:35:46 +01:00
conan.go Hash path-based metadata cache keys 2026-10-24 12:55:00 +02:00
conan_test.go Update x/net and remove unused production helpers 2026-10-19 08:35:46 +01:00
conda.go Expire cooldown rewrites when a withheld version becomes available (#638) 2026-10-30 14:06:42 +00:00
conda_encoding_test.go Hash path-based metadata cache keys 2026-10-24 12:55:00 +02:00
conda_repodata_variants_test.go Refuse unfiltered conda repodata while cooldown is on 2026-10-25 17:50:49 +01:00
conda_shards.go Refuse '?' and '#' in paths in more handlers 2026-10-24 12:57:20 +02:00
conda_shards_test.go Accept only relative paths in a conda shard index's base URLs 2026-10-23 19:06:07 +02:00
conda_subdir_test.go Cache conda packages per subdir 2026-10-22 20:42:17 +02:00
conda_test.go Stream conda repodata through the cooldown filter (#527) 2026-10-19 07:47:34 +02:00
container.go Merge pull request #599 from simonchrz/perf/oci-tag-head-revalidation 2026-10-25 18:15:01 +00:00
container_manifest.go Revalidate stale OCI tags with HEAD and share the request 2026-10-25 17:32:22 +01:00
container_manifest_fetch.go Revalidate stale OCI tags with HEAD and share the request 2026-10-25 17:32:22 +01:00
container_manifest_key_test.go Mirroring a tag now checks it with a HEAD first and reuses the cached manifest when the digest is unchanged, falls back to the cached tag when the upstream body is cut off, and keeps a tag that a client pull moved while the walk ran. The platform filter is checked across the whole image, so a nested index without the wanted platform no longer fails it, and a 304 for a per-Accept fallback entry only refreshes that client's own keys instead of overwriting the shared entry. 2026-10-13 17:02:32 +02:00
container_manifest_revalidate_test.go Revalidate stale OCI tags with HEAD and share the request 2026-10-25 17:32:22 +01:00
container_metadata.go Count cached metadata against max_size and evict it LRU (#507) 2026-10-20 10:22:55 +01:00
container_mirror.go Re-mirror container images on a schedule (#508) 2026-10-18 18:33:13 +01:00
container_mirror_test.go Re-mirror container images on a schedule (#508) 2026-10-18 18:33:13 +01:00
container_ns_test.go Route containerd ns mirror requests to configured registries (#405) 2026-10-10 07:35:50 +01:00
container_referrers.go Log per-handler request lines at debug level 2026-10-25 17:21:11 +01:00
container_referrers_test.go Update x/net and remove unused production helpers 2026-10-19 08:35:46 +01:00
container_tags.go Count cached metadata against max_size and evict it LRU (#507) 2026-10-20 10:22:55 +01:00
container_test.go Verify sha512 OCI digests and refuse ones that can't be checked 2026-10-24 08:12:59 +02:00
cooldown_expiry.go Preserve Swift and Go compatibility when upgrading PURL (#642) 2026-10-31 09:49:35 +00:00
cooldown_expiry_test.go Expire cooldown rewrites when a withheld version becomes available (#638) 2026-10-30 14:06:42 +00:00
cooldown_fail_closed.go Preserve Swift and Go compatibility when upgrading PURL (#642) 2026-10-31 09:49:35 +00:00
cooldown_fail_closed_test.go Serve cached downloads when cooldown can't read publish times 2026-10-25 12:31:33 +01:00
cooldown_metadata_cache_test.go Merge main into perf/cooldown-metadata-cache 2026-10-25 19:17:18 +01:00
cooldown_patterns_test.go Use shared cooldown package-pattern policy 2026-10-20 08:53:22 +01:00
cooldown_supported_test.go Detect Helm's cooldown check in the handler coverage test 2026-10-30 08:36:39 +00:00
cooldown_times.go Expire cooldown rewrites when a withheld version becomes available (#638) 2026-10-30 14:06:42 +00:00
cran.go Refuse '?' and '#' in paths in more handlers 2026-10-24 12:57:20 +02:00
cran_test.go Hello world 2026-01-20 22:00:31 +00:00
debian.go Refuse '?' and '#' through rejectQueryChars in APK, Debian and RPM 2026-10-25 09:55:14 +00:00
debian_test.go Hash path-based metadata cache keys 2026-10-24 12:55:00 +02:00
denylist.go feat: add exact-version package denylist 2026-09-20 14:42:30 +05:30
denylist_test.go Preserve Swift and Go compatibility when upgrading PURL (#642) 2026-10-31 09:49:35 +00:00
detached_fetch_test.go At most 64 fetches keep running after their client hangs up; beyond that a fetch is tied to its client again, so nobody can start an unbounded number of large downloads and leave. A server test now checks that client requests actually get the detach marker. 2026-10-12 00:02:02 +02:00
download_test.go Merge pull request #556 from simonchrz/fix/maven-extensions 2026-10-23 09:32:09 +01:00
fetch_lease.go Keep detached lease waits alive and stop waiting on a failed fetch 2026-10-23 19:19:22 +02:00
fetch_lease_test.go Keep detached lease waits alive and stop waiting on a failed fetch 2026-10-23 19:19:22 +02:00
fetch_path_test.go Give each fetch its own storage path 2026-09-23 16:14:43 -07:00
filename_download.go Log per-handler request lines at debug level 2026-10-25 17:21:11 +01:00
freebsd.go Check unhashed FreeBSD packages against the denylist 2026-10-23 09:57:49 +02:00
freebsd_test.go Check unhashed FreeBSD packages against the denylist 2026-10-23 09:57:49 +02:00
gem.go Keep rewritten metadata gzip-only and longer with cooldown 2026-10-29 10:52:39 +01:00
gem_test.go Read gem, Hex and conda cooldown metadata through the metadata cache 2026-10-25 17:41:40 +01:00
generic.go Require generic_paths for generic upstreams with credentials 2026-10-24 08:02:22 +02:00
generic_test.go Require generic_paths for generic upstreams with credentials 2026-10-24 08:02:22 +02:00
git.go Reuse batch download URLs and stored copies for LFS objects 2026-10-25 18:19:09 +00:00
git_lfs.go Reuse batch download URLs and stored copies for LFS objects 2026-10-25 18:19:09 +00:00
git_lfs_test.go Reuse batch download URLs and stored copies for LFS objects 2026-10-25 18:19:09 +00:00
git_test.go Bound Git requests by their body and response progress 2026-10-24 12:55:14 +02:00
go.go Preserve Swift and Go compatibility when upgrading PURL (#642) 2026-10-31 09:49:35 +00:00
go_case_test.go Preserve Swift and Go compatibility when upgrading PURL (#642) 2026-10-31 09:49:35 +00:00
go_cooldown.go Preserve Swift and Go compatibility when upgrading PURL (#642) 2026-10-31 09:49:35 +00:00
go_cooldown_test.go Fail closed in Go cooldown and key stored times by escaped path 2026-10-23 12:46:39 +02:00
go_policy_test.go Preserve Swift and Go compatibility when upgrading PURL (#642) 2026-10-31 09:49:35 +00:00
go_sumdb.go Separate artifact and metadata cache metrics on /metrics and the analytics page (#463) 2026-10-20 11:25:33 +01:00
go_sumdb_test.go Forward data tiles without storing them. The go command never fetches them, and kept for good they would add up to the whole log; the record count check from before is no longer needed. 2026-10-13 16:42:03 +02:00
go_test.go Preserve Go proxy fallback for missing modules 2026-07-12 18:48:39 +00:00
go_vulndb.go Refer to govulncheck's -db flag in comments 2026-10-28 12:58:27 +00:00
go_vulndb_test.go Serve the Go vulnerability database at /go/vulndb 2026-10-27 16:16:04 +01:00
gradle.go Separate artifact and metadata cache metrics on /metrics and the analytics page (#463) 2026-10-20 11:25:33 +01:00
gradle_test.go Separate artifact and metadata cache metrics on /metrics and the analytics page (#463) 2026-10-20 11:25:33 +01:00
handler.go Preserve Swift and Go compatibility when upgrading PURL (#642) 2026-10-31 09:49:35 +00:00
handler_bench_test.go Read metadata into a buffer of its known size 2026-10-25 17:24:24 +01:00
handler_test.go Merge pull request #597 from simonchrz/perf/memory-quick-wins 2026-10-25 18:14:03 +00:00
head_cache_hit_test.go Answer HEAD on a cached artifact without opening it 2026-10-25 17:27:05 +01:00
helm.go Expire cooldown rewrites when a withheld version becomes available (#638) 2026-10-30 14:06:42 +00:00
helm_mirror.go Mirror Helm charts 2026-10-25 19:37:22 +01:00
helm_mirror_test.go Mirror Helm charts 2026-10-25 19:37:22 +01:00
helm_oci.go fix(helm): support OCI references in HTTP repository indexes 2026-09-19 14:39:29 +05:30
helm_oci_test.go Cache Helm and PyPI metadata rewrites 2026-10-25 17:32:52 +01:00
helm_pypi_bench_test.go Cache Helm and PyPI metadata rewrites 2026-10-25 17:32:52 +01:00
helm_pypi_rewrite_test.go Mirror Helm charts 2026-10-25 19:37:22 +01:00
helm_test.go Cache Helm and PyPI metadata rewrites 2026-10-25 17:32:52 +01:00
hex.go Keep rewritten metadata gzip-only and longer with cooldown 2026-10-29 10:52:39 +01:00
hex_test.go Read gem, Hex and conda cooldown metadata through the metadata cache 2026-10-25 17:41:40 +01:00
homebrew.go fix(handler): let the ProxyCached path request a per-call Accept-Encoding (#324) 2026-09-15 19:50:44 +01:00
homebrew_bottles.go Trim BottleImage doc comment and rejoin the brew docs list 2026-10-30 08:40:35 +00:00
homebrew_bottles_test.go Mirror Homebrew bottles 2026-10-28 15:18:14 +00:00
homebrew_test.go fix(handler): let the ProxyCached path request a per-call Accept-Encoding (#324) 2026-09-15 19:50:44 +01:00
hosted.go Skip the pushed artifact lookup when hosting is disabled 2026-10-25 17:32:22 +01:00
hosted_manifest.go Host generic files and share one push path across hosted ecosystems 2026-10-21 12:23:54 +02:00
hosted_test.go Skip the pushed artifact lookup when hosting is disabled 2026-10-25 17:32:22 +01:00
if_none_match_test.go Add Homebrew JSON API and bottle proxy support (#254) 2026-09-03 16:59:12 +01:00
integrity.go Verify cache hits against the content hash only 2026-10-25 17:22:14 +01:00
integrity_test.go Verify cache hits against the content hash only 2026-10-25 17:22:14 +01:00
julia.go Index artifacts by filename and shorten Julia comments 2026-10-26 16:40:15 +01:00
julia_refresh_test.go Refresh the Julia name map only from the advertised registry 2026-10-23 13:09:31 +02:00
julia_test.go Add Julia Pkg server support (#117) 2026-05-13 06:46:35 +01:00
maven.go Log per-handler request lines at debug level 2026-10-25 17:21:11 +01:00
maven_cooldown.go Expire cooldown rewrites when a withheld version becomes available (#638) 2026-10-30 14:06:42 +00:00
maven_cooldown_test.go Polish Maven cooldown after review 2026-10-23 20:53:06 +02:00
maven_repositories_test.go Serve additional Maven repositories at /maven/{name}/ (#539) 2026-10-21 11:10:49 +01:00
maven_test.go Route every Maven artifact file through the download path 2026-10-22 20:41:51 +02:00
metadata_access_test.go Expire cooldown rewrites when a withheld version becomes available (#638) 2026-10-30 14:06:42 +00:00
metadata_coalesce_test.go Coalesce concurrent metadata fetches (#400) 2026-10-04 17:50:45 +01:00
metadata_dates.go Share the dates of rewritten metadata across replicas 2026-10-12 15:16:51 +02:00
metadata_dates_upgrade_test.go Test upgrading cached metadata through the metadata_dates migration 2026-10-12 16:11:49 +02:00
metadata_encoding_test.go fix(handler): preserve upstream content-encoding for cached metadata (#304) 2026-09-03 09:58:58 +01:00
metadata_gzip_test.go Expire cooldown rewrites when a withheld version becomes available (#638) 2026-10-30 14:06:42 +00:00
metadata_immutable.go Serve immutable Go and RPM metadata without revalidation 2026-10-25 17:29:22 +01:00
metadata_immutable_test.go Serve immutable Go and RPM metadata without revalidation 2026-10-25 17:29:22 +01:00
metadata_not_modified_test.go Fix npm search routing and abbreviated packuments under cooldown 2026-10-23 13:22:49 +02:00
metadata_path.go Queue only a row's own legacy metadata blob 2026-10-25 12:31:10 +01:00
metadata_path_test.go Queue only a row's own legacy metadata blob 2026-10-25 12:31:10 +01:00
metadata_stream.go Merge main into perf/cooldown-metadata-cache 2026-10-25 19:17:18 +01:00
metadata_stream_test.go Drop cached metadata that fails its integrity check 2026-10-25 12:51:11 +00:00
metadata_validators_test.go Expire cooldown rewrites when a withheld version becomes available (#638) 2026-10-30 14:06:42 +00:00
notfound_ecosystems_test.go Proxy FreeBSD pkg repositories at /freebsd/{name}/ 2026-10-22 12:36:27 +02:00
notfound_test.go fix: proper handling of upstream registry 404s (#209) 2026-07-26 19:07:46 +01:00
npm.go Expire cooldown rewrites when a withheld version becomes available (#638) 2026-10-30 14:06:42 +00:00
npm_attestations.go Trim npm attestations doc comments 2026-10-30 08:29:33 +00:00
npm_attestations_test.go Serve npm attestations through the proxy 2026-10-30 08:26:27 +00:00
npm_dist_tags.go Keep rewritten metadata gzip-only and longer with cooldown 2026-10-29 10:52:39 +01:00
npm_dist_tags_test.go Answer npm dist-tag ls from the served packument 2026-10-27 16:19:14 +01:00
npm_hosted.go Extract portable npm metadata transformations 2026-10-25 22:21:37 +01:00
npm_hosted_test.go Skip the pushed artifact lookup when hosting is disabled 2026-10-25 17:32:22 +01:00
npm_integrity_test.go Verify npm and Composer archives against their SHA-1 shasum 2026-10-14 18:04:31 +02:00
npm_packument_accept_test.go Fix npm search routing and abbreviated packuments under cooldown 2026-10-23 13:22:49 +02:00
npm_portable_test.go Extract portable npm metadata transformations 2026-10-25 22:21:37 +01:00
npm_rewrite_bench_test.go Extract portable npm metadata transformations 2026-10-25 22:21:37 +01:00
npm_rewrite_test.go Expire cooldown rewrites when a withheld version becomes available (#638) 2026-10-30 14:06:42 +00:00
npm_routes_test.go Don't fetch npm tarballs whose packument can't be read 2026-10-24 08:06:10 +02:00
npm_tarball_test.go Don't fetch npm tarballs whose packument can't be read 2026-10-24 08:06:10 +02:00
npm_test.go Keep rewritten metadata gzip-only and longer with cooldown 2026-10-29 10:52:39 +01:00
nuget.go Log per-handler request lines at debug level 2026-10-25 17:21:11 +01:00
nuget_cooldown.go Expire cooldown rewrites when a withheld version becomes available (#638) 2026-10-30 14:06:42 +00:00
nuget_cooldown_test.go Coalesce concurrent metadata fetches (#400) 2026-10-04 17:50:45 +01:00
nuget_test.go Enable storage retention for nuget 2026-10-12 15:24:21 +02:00
package_routes.go Mirror packages from the configured upstreams 2026-10-22 16:06:56 +02:00
package_routes_test.go Add package routes for private Composer and npm registries (#426) 2026-10-11 18:06:18 +01:00
path_traversal_test.go Check for path traversal after URL decoding (#108) 2026-05-03 09:07:16 +01:00
proxy_cached_encoding_test.go fix(handler): let the ProxyCached path request a per-call Accept-Encoding (#324) 2026-09-15 19:50:44 +01:00
pub.go Expire cooldown rewrites when a withheld version becomes available (#638) 2026-10-30 14:06:42 +00:00
pub_test.go Only cache real pub archives on download (#520) 2026-10-19 07:58:13 +01:00
pypi.go Expire cooldown rewrites when a withheld version becomes available (#638) 2026-10-30 14:06:42 +00:00
pypi_denylist.go feat: add exact-version package denylist 2026-09-20 14:42:30 +05:30
pypi_test.go Cache Helm and PyPI metadata rewrites 2026-10-25 17:32:52 +01:00
pypi_upload_time_test.go Answer PyPI download cooldown from stored upload times 2026-10-25 17:29:22 +01:00
query_in_path_test.go Refuse '?' and '#' in paths in more handlers 2026-10-24 12:57:20 +02:00
read_metadata_test.go Read metadata into a buffer of its known size 2026-10-25 17:24:24 +01:00
relay.go fix: centralize pass-through response relaying 2026-09-26 15:44:28 +05:30
relay_test.go Merge main into feat/mirror-swift 2026-10-26 16:38:56 +01:00
resolved_artifact_test.go fix(mirror): match cached artifacts by resolved filename 2026-09-23 17:51:49 +05:30
rewrite_cache.go Expire cooldown rewrites when a withheld version becomes available (#638) 2026-10-30 14:06:42 +00:00
rewrite_cache_test.go Expire cooldown rewrites when a withheld version becomes available (#638) 2026-10-30 14:06:42 +00:00
rpm.go Serve immutable Go and RPM metadata without revalidation 2026-10-25 17:29:22 +01:00
rpm_test.go Enable storage retention for rpm 2026-10-12 15:24:21 +02:00
scan_test.go Add pre-cache artifact scanning hook (trivy/ClamAV/Wiz/custom) (#298) 2026-09-03 10:06:44 +01:00
scanfetch.go Add pre-cache artifact scanning hook (trivy/ClamAV/Wiz/custom) (#298) 2026-09-03 10:06:44 +01:00
scanfetch_test.go Add pre-cache artifact scanning hook (trivy/ClamAV/Wiz/custom) (#298) 2026-09-03 10:06:44 +01:00
shared_holds_test.go Share upstream rate-limit holds across instances 2026-10-25 17:34:08 +01:00
stale_cache_test.go Verify npm tarballs against dist.integrity 2026-10-14 15:40:36 +02:00
stale_metadata_test.go Keep the stale fallback for 404 and 401/403, leave npm to #503 2026-10-22 09:14:33 +02:00
stream_artifacts_test.go Don't fetch npm tarballs whose packument can't be read 2026-10-24 08:06:10 +02:00
stream_miss.go Hold an unrecorded object for a client reading its stored copy 2026-10-27 12:30:59 +01:00
stream_miss_test.go Make the slow-client storage failure test deterministic 2026-10-28 15:57:06 +00:00
swift.go Accept Swift source repository PURLs in the denylist and retention rules (#641) 2026-10-31 11:34:05 +00:00
swift_cache.go Check cached Swift documents against their digest and resolve source PURLs 2026-10-26 16:43:42 +01:00
swift_cache_test.go Check cached Swift documents against their digest and resolve source PURLs 2026-10-26 16:43:42 +01:00
swift_mirror.go Accept Swift source repository PURLs in the denylist and retention rules (#641) 2026-10-31 11:34:05 +00:00
swift_mirror_test.go Mirror Swift registry releases 2026-10-25 21:48:59 +01:00
swift_test.go Verify npm tarballs against dist.integrity 2026-10-14 15:40:36 +02:00
unrecorded_test.go Hold an unrecorded object for a client reading its stored copy 2026-10-27 12:30:59 +01:00
upstream_auth_helper_test.go Stop forwarding custom auth headers across redirects 2026-10-14 08:38:51 +02:00
upstream_held.go Share upstream rate-limit holds across instances 2026-10-25 17:34:08 +01:00
upstream_test.go Read gem, Hex and conda cooldown metadata through the metadata cache 2026-10-25 17:41:40 +01:00