Repository navigation
Fail a signature refetch instead of serving the stale signature - #832
Conversation
When a cached Release.gpg or repomd.xml.asc predates its release file and the refetch fails, the stale fallback served the old signature with the new release file, which apt and dnf reject as a bad signature. Return the upstream error instead, so the client can retry. Fixes git-pkgs#819.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Fixes #819.
proxyReleaseSignaturerefetches a cachedRelease.gpgorrepomd.xml.ascwhen it was fetched before its release file. When that refetch failed,refreshMetadatafell back to the cached copy, which is the old signature, so the client got the new release file with the old signature and gpgv reported BADSIG.Now a stale result there becomes the upstream error (502), so apt and dnf keep their old lists and retry. A signature fetched after its release file still gets the usual stale fallback.
Pairing release file and signature by digest, as the Arch handler does, would also keep serving during an outage, but needs more state; this keeps the change small.
TestStaleSignatureNotServedWithNewerReleasecovers Debian and RPM: 502 while upstream fails, the new signature once it is back. It fails onmain.go test ./internal/handler/andgolangci-lint run ./internal/handler/pass.Summary by CodeRabbit