Repository navigation
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
I read this from the proxy's side, for
Minor: |
Probe Packages.adb with HEAD and refuse package file names containing path or URL characters.
|
Thanks, all four points are covered. One more: Smaller: a 403 on the |
Part of #62: the v2
APKINDEX.tar.gzside. v3Packages.adbdecoding waits on an ADB decoder shared with git-pkgs/archives#30 and a fixture generated withapk mkndx.Adds an
apkregistry with no default URL, so a missing URL gets the existing "no registry URL configured" error. The URL is one architecture directory such ashttps://dl-cdn.alpinelinux.org/alpine/v3.23/main/x86_64, or an exact index URL in one. Nothing is inferred from a mirror root. For a directory the client asks forPackages.adbfirst and falls back toAPKINDEX.tar.gzonly on a 404, as apk-tools does. If aPackages.adbis served, it returnsErrV3IndexUnsupportedrather than reading the other index, so v3 support can later turn that error into a result without changing what any repository resolves to today. The index is fetched once per registry instance.The parser reads the
APKINDEXmember across the signature and index gzip streams and maps the fields from apk-tools'apk_adb.c: name, version, description, URL, license, arch, build time (PublishedAt), maintainer, file and installed size, origin, commit, provider priority, depends, provides, replaces and install-if. Malformed lines, records with noPorV, bad numbers, truncated archives and archives with noAPKINDEXmember returnErrMalformedIndex. Versions sort with theapkscheme fromvers, so-r10sorts above-r9, and lookups match the exact version including the revision.FetchDependenciesreturnsDentries as runtime dependencies with the operator kept inRequirements(libcurl/=8.22.0-r0), and leaves out!conflicts. Everything is also in version metadata. Maintainers inName <email>form are split; anything else is kept whole as the name. Names may carry the PURL vendor namespace:alpine/curllooks upcurlandFetchPackagereturnsNamespace: "alpine".The
C:checksum is not used as integrity. Oncurl-8.22.0-r0.apk, theQ1value25ef42c2…8161is the SHA-1 of the package's second gzip stream (the control section), while the whole file's SHA-1 isb9119fc5…1e73. Putting it inIntegritywould make a consumer that verifies downloads, such as git-pkgs/proxy, reject every package. It's exposed in metadata aschecksum(raw),checksum_algorithm(sha1, ormd5for legacy hex),checksum_hexandchecksum_covers: control.Each version has one artifact,
<name>-<version>.apkbeside the index, withS:as its size andarchin its metadata.URLs().Downloadbuilds the same URL without loading the index, sofetch.Resolverresolves APKs with no request.The test fixture is four records trimmed from the live v3.23
main/x86_64index, packed into the same two-stream layout in the test. Againstdl-cdn.alpinelinux.org,v3.23/main/x86_64andv3.23/main/aarch64/APKINDEX.tar.gzresolvecurl8.22.0-r0 with sizes matching the files, andedge/community/x86_64(about 2.5 MB compressed) loads in under a second.https://claude.ai/code/session_01NxsA75HBjdWQKcdx7FDTDc