ferro-cargo-registry-server
Server-side primitives for the Cargo Alternative Registry Protocol, sparse-index variant. As far as we can tell, this is the first crate on crates.io that publishes the server half of this protocol; existing crates implement the client (cargo itself) or git-index internals.
⚠️ Alpha (
v0.0.1). API will shift beforev0.1.
Part of the Ferro ecosystem. Extracted from FerroRepo, a private Rust artifact repository.
What this crate does
config—/config.jsonresponse (registry API host, alternate registries list)index— sparse-index format: line-per-version JSON entries (IndexEntry,IndexDep),entry_from_manifest/parse_lines/render_linesname— canonical crate name validation (lowercase ASCII, hyphens, length cap)publish— binary publish-request parser (length-prefixed metadata JSON + tarball bytes) per spec §"Publish"version— semver validationowners— owners API request / response typesyank— yank/unyank responsehandlers/router— Axum router for/config.json,/index/{*path},/api/v1/crates/**. Mounts aBlobStorefromferro-blob-store.
What this crate does not do
- Git index format — sparse only.
cargo1.68+ defaults to sparse, controllable per-registry viaCARGO_REGISTRIES_*_PROTOCOL=sparse. Git-index support is on the roadmap behind a separate feature once the in-tree git primitives stabilise. - Authentication — handlers are open. Layer your auth in the Axum middleware stack above this router.
- TUF v2 metadata — the spec's TUF metadata layer is a separate crate (Phase 3).
- crates.io federation / mirroring — this is for alternative registries (private registries / mirrors / corp internal). The server here does not pull from upstream crates.io.
Quick start
use Arc;
use Router;
use FsBlobStore;
use ;
# async
Client-side: point cargo at it via your ~/.cargo/config.toml:
[]
= "sparse+https://my-registry.example.com/index/"
Status
| Aspect | Status |
|---|---|
| API stability | alpha (v0.0.x) |
| Sparse index | working |
| Git index | not yet |
| Authentication | scaffold only — wire your own middleware |
| TUF metadata | not in this crate (Phase 3, separate) |
| MSRV | rustc 1.88 |
Used in production by
- FerroRepo (private) — Rust artifact repository.
License
Apache-2.0. See LICENSE.