mirror of
https://github.com/floci-io/floci.git
synced 2026-11-22 21:50:46 -05:00
Supports npm, pypi, and nuget, matching AWS's own documented restriction for this action (not maven, Swift, generic, Ruby, or Cargo, which carry no readme in real CodeArtifact). Neither npm nor pypi can answer this live after the fact. A real Verdaccio packument GET hoists readme to the top level only, for the single most-recently-published version, and drops the per-version field from its own response entirely, even though a real npm client's publish envelope genuinely sends one per version (confirmed against a live Verdaccio 6.10.4 container with a captured real npm-publish fixture). pypiserver has no description field anywhere in its model or its RPC2 route (confirmed by reading pypiserver's own source at the pinned version), so it never had a live path to begin with. Both formats are therefore captured at publish/upload time instead: npm's per-version readme field is read off the real publish envelope by NpmPublishEnvelopeScanner and recorded after a successful forward to the Verdaccio sidecar, and pypi's is read off the upload form's description field the same way it already was. Both go through the same recordPublishedPackageVersionReadme method and the same packageVersionReadmes account-scoped store, cleaned up on DeleteRepository and DeletePackage the same way packageOriginConfigs already is. nuget is accepted as a valid format but always 404s, since nothing in Floci implements the real NuGet wire protocol and no nuget package version can ever exist here. Refactors validatePackageToken to delegate to a new non-throwing isValidPackageToken, reused by the readme capture path (fed raw publish/upload input, never through the JSON API's own validation) to guard the same escape-collision invariant escapeKeySegment depends on. Extracts the container-backed revision synthesis already used by GetPackageVersionAsset into a shared helper so GetPackageVersionReadme reports a consistent revision for the same version coordinate.