Files
floci/src/main/java
Priamo Germosen 2cf011f726 fix(codeartifact): make npm republish of identical content idempotent (#5163)
Real AWS CodeArtifact documents PublishPackageVersion as idempotent: republishing
an existing asset with identical content succeeds. Verdaccio, which backs the npm
data plane, and real npm registries reject every republish of an existing version
with 409, even for byte-identical content, so Floci inherited that behavior.

A PUT to a bare package path is now spooled to a temp file in bounded chunks and
scanned as a stream. Each attachment's base64 data is hashed as it passes, and the
publish answers 200 without reaching Verdaccio only when every version's integrity
matches the stored packument, every dist-tag the publish sends already points where
it says, and no attachment is left unaccounted for. Anything else forwards the
spooled body unchanged, so Verdaccio's response stays authoritative. Envelope size
never has to fit on heap.

At most four publishes run this check at once; a publish beyond that waits in a
bounded queue, and when the queue is full it is answered 429 with Retry-After.
2026-10-06 20:31:50 -05:00
..