Repository navigation
Open
Labels
Description
Tracking issue for bringing @pnpm/pnpr to feature parity with verdaccio as a backend.
Scope
- In scope: every HTTP and on-disk capability a registry server needs in production — auth, ACLs, uplinks, caching, publish lifecycle, storage integrity, observability, config.
- In scope: a complete enough HTTP/JSON surface that an external project could build a browser UI on top of it.
- Out of scope: a built-in browser UI / web frontend. We might ship one but that is not part of this issue.
- Out of scope: verdaccio's plugin-as-npm-package model. If we add extensibility it will be compile-time Rust traits, not dynamic JS plugins. Decision required (see below).
Already done
- packument and tarball serving (full + abbreviated)
- publish, unpublish (full + per-version), dist-tag CRUD
- per-package glob policy ($all / $authenticated)
- htpasswd-style auth (bcrypt, persisted to disk), basic + bearer
- bearer tokens persisted to a SQLite database (SHA-256-hashed)
- uplink proxying with packument TTL cache
- local search (
/-/v1/search) - atomic writes, verdaccio-compatible on-disk layout
- integration tests covering the above
Required for verdaccio parity
Auth & user endpoints
- Persist htpasswd users to disk (#11974, PR feat(registry): persist pnpr users and tokens to disk pnpm#11977)
- Token revocation (
DELETE /-/npm/v1/tokens/token/:tok) — landed in feat(registry): add whoami, profile, and token CRUD endpoints pnpm#12011 - Token listing (
GET /-/npm/v1/tokens) — landed in feat(registry): add whoami, profile, and token CRUD endpoints pnpm#12011 - Logout (
DELETE /-/user/token/:tok) — landed in feat(registry): add whoami, profile, and token CRUD endpoints pnpm#12011 -
GET /-/whoami— landed in feat(registry): add whoami, profile, and token CRUD endpoints pnpm#12011 -
GET /-/npm/v1/user(profile) — landed in feat(registry): add whoami, profile, and token CRUD endpoints pnpm#12011 - Decide on pluggable auth (LDAP/OAuth/etc.) — interface or out of scope?
Access control
-
$anonymousgroup — landed in feat(registry): enforce per-package access policy from YAML pnpm#12043 - Named groups, per-user group membership — landed in feat(registry): per-user access lists (verdaccio-style groups) pnpm#12048
- Wire policy fully from YAML — landed in feat(registry): enforce per-package access policy from YAML pnpm#12043
Uplinks & caching
- Forward
auth.token/ custom headers to uplinks feat(pnpr): forward uplink auth token and custom headers to upstreams pnpm#12186 - Conditional GET to upstream (ETag,
If-Modified-Since) feat(pnpr): revalidate stale packuments with conditional GET to upstream pnpm#12239 - stale-while-revalidate semantics on packuments
- Multiple-uplink fallback ordering per package
- Per-uplink timeouts,
max_fails,fail_timeout,cache: false - Offline mode (serve cached only)
Storage & integrity
- SHA verification on tarball read (detect on-disk corruption)
- SHA verification on publish (hash payload, compare to packument integrity) — landed in fix(registry): verify tarball SHA on publish pnpm#11976
- Ownership / maintainer tracking per package
- Garbage collection of orphaned tarballs
Publish lifecycle
-
npm deprecate(PUT packument with deprecated field on a version) - Configurable strict mode: reject re-publish of an existing version
- Tarball format validation (gzip header, tar entries)
- Maintainer add/remove (
PUT /-/package/:pkg/owner) - Star / unstar endpoints (optional, npm-client uses them)
Admin / management API (surface for external UIs)
- User list endpoint
- Package metadata / sidebar endpoint suitable for a UI
- Audit endpoint (
POST /-/npm/v1/security/audits) — proxy or local
Health & observability
-
/-/ping - Prometheus
/metrics - Structured access log (one line per request, configurable format) — landed in feat(registry): add logging support for requests pnpm#12033
Config
-
${ENV_VAR}substitution in YAML - Schema validation with miette-style diagnostics
- Hot reload (SIGHUP)
Networking
- Decide: built-in TLS termination, or document reverse-proxy-only
- Trust-proxy /
X-Forwarded-*handling fordist.tarballrewriting
Notifications
- Configurable webhooks on publish / unpublish / deprecate
Extensibility decision
- Decide whether pnpr exposes a stable Rust trait surface for auth / storage / middleware backends. If yes, define and document it; if no, document it as deliberately out of scope.
Non-goals (explicit)
- Verdaccio-style dynamic plugin loading from npm packages.
- A
verdaccio.yamldrop-in compatibility guarantee. The config is verdaccio-shaped, not byte-identical.
Written by an agent (Claude Code, claude-opus-4-7).
Reacted by Juan Picado
Activity
zkochan commentedon May 28, 2026
The SHA verification on publish item landed in pnpm/pnpm#11976 (merged 3fbc5b5c0b → 87136edaa3).
pnpm-registrynow hashes incoming publish tarballs as they stream through base64 decode, rejects mismatches againstdist.integrity/dist.shasumwith a400 EINTEGRITYbefore any cache write, and requiresdist.integrityto be present (rejecting the rare body that arrives without it).Read-side verification (SHA verification on serving a cached tarball back) is still open — leaving the checkbox above it unchecked.
Written by an agent (Claude Code, claude-opus-4-7).
feat(registry): add whoami, profile, and token CRUD endpoints
feat(registry): add whoami, profile, and token CRUD endpoints (#12011)
zkochan commentedon May 28, 2026
PR pnpm/pnpm#12011 landed the five remaining Auth & user endpoints items:
GET /-/whoamiGET /-/npm/v1/userGET /-/npm/v1/tokensDELETE /-/npm/v1/tokens/token/:tokDELETE /-/user/token/:tokThe only auth-section box still open is the pluggable-auth decision, which is a design call rather than an implementation task.
Written by an agent (Claude Code, claude-opus-4-7).
zkochan commentedon May 28, 2026
Checked off Structured access log (one line per request, configurable format) — landed in pnpm/pnpm#12033 (merged).
pnpr now installs a
tracing-subscriberdriven by a Verdaccio-6-shapedlog:block (format: pretty|json,level), emitting one access record per request (method, URI, status, latency) under thepnpm_registry::accesstarget;RUST_LOGstill overrides.Supporting infra that came with it (no dedicated checkbox): the global
config.yamlis now auto-discovered using pnpm's own config-dir rules (XDG_CONFIG_HOME/ macOS /LOCALAPPDATA/~/.config) under apnprleaf, via a sharedpacquet-config-dircrate also used bypacquet-config.Written by an agent (Claude Code, claude-opus-4-8).
feat(registry): enforce per-package access policy from YAML (#12043)
zkochan commentedon May 28, 2026
Checked off two Access control items — landed in pnpm/pnpm#12043 (merged):
Config::from_yamlnow compilesPackagePoliciesfrom eachpackages[*]entry'saccess/publishtokens (first-match-wins) instead of the hard-codedregistry_mock_defaults. Configured ACLs were silently ignored before, so a user-defined private scope got no protection. Unknown tokens now fail config parsing rather than mis-enforcing.$anonymousgroup — newAccessRule::Anonymous: admits only unauthenticated callers; an authenticated caller falls outside the group and gets403.Still open under Access control: Named groups / per-user group membership (the remaining unchecked box).
unpublishis parsed and validated but still folds intopublishat enforcement time.Written by an agent (Claude Code, claude-opus-4-8).
feat(registry): per-user access lists (verdaccio-style groups) (#12048)
zkochan commentedon May 29, 2026
Checked off Named groups, per-user group membership — landed in pnpm/pnpm#12048 (merged).
Each
packages[*]access/publishis now a verdaccio-style token list (space-separated string or YAML sequence) matched against the caller's identity. Tokens are the built-in pseudo-groups ($all/$authenticated/$anonymous+@/bare aliases) or a name; a name matches an authenticated caller whose username equals it — i.e. per-user access works today. Group names beyond usernames resolve here for free once a group-providing auth backend exists, which is verdaccio's model (the htpasswd plugin contributes only the username; named groups come from the auth plugin).That closes the Access control section — all three items (
$anonymous, named groups / per-user membership, YAML-driven policy) are now done. Natural next area looks like Uplinks & caching (conditional GET / stale-while-revalidate) or Health & observability (/metrics).Written by an agent (Claude Code, claude-opus-4-8).
feat(registry): per-user access lists (verdaccio-style groups) (#12048)
feat(pnpr): forward uplink auth token and custom headers to upstreams
zkochan commentedon Jun 5, 2026
Cross-reference for the two auth-backend "decide" items here:
pnpm/pnpm#12206 (merged) introduced narrow async
UserBackend/TokenBackendtraits and selects the implementation at config-load time intoArc<dyn …>handles — local (htpasswd + SQLite), in-memory, or a networked libsql/Turso backend via abackend.libsql:block. That establishes the trait shape for pluggable auth (driven by the stateless-deployment work in #21), though it stops short of the larger decisions tracked here: LDAP/OAuth providers aren’t implemented, and the traits are currently crate-internal rather than a committed stable public surface. Worth folding into those two decisions when they’re picked up.Written by an agent (Claude Code, claude-opus-4-8).
feat(pnpr): forward uplink auth token and custom headers to upstreams
feat(pnpr): forward uplink auth token and custom headers to upstreams (…
feat(pnpr): per-uplink verdaccio settings (maxage, timeout, max_fails…
juanpicado commentedon Jun 25, 2026
The Multiple-uplink fallback ordering per package item (under Uplinks & caching) is implemented in pnpm/pnpm#12648.
A
proxy:rule can now name an ordered list of uplinks (proxy: npmjs private, or the YAML sequence form), walked as a verdaccio-style serial first-success fallback chain: try in declared order, stop at the first that answers, fall through on 404 or transport/circuit failure. Each uplink is sent only its own cached validators, and tarball/packument caching is keyed off the serving uplink.This is a single checklist item — the PR references this tracking issue without a closing keyword, so merging it should not close this issue. The remaining parity items stay open.
Written by an agent (Claude Code, claude-opus-4-8).
fix(pnpr): address review on multi-uplink fallback
fix(pnpr): surface hard upstream 4xx instead of serving stale cache
feat(pnpr): multiple-uplink fallback ordering per package (#12648)
fix(pnpr): truncate upstream search at the fetch budget instead of fa…
fix(pnpr): truncate upstream search at the fetch budget instead of fa…
fix(pnpr): truncate upstream search at the fetch budget instead of fa…
zkochan commentedon Oct 23, 2026
npm deprecateworks through a.tgzbase but fails through a tar base. Tracked in #198.Written by an agent (Claude Code, claude-opus-5-5).
zkochan commentedon Nov 8, 2026
Status check against main (2026-11-08).
I ticked the boxes that have shipped: maintainers,
pnpr gc, deprecate (the remaining gap was #198, now closed), republish refusal (immutability.rs), the audit endpoint,/metrics, config diagnostics, and the TLS, trusted-proxy and webhook decisions (docs/tls-and-reverse-proxy.md,docs/webhooks.md).Left: hot reload and star/unstar. The other unchecked boxes (pluggable auth decision, read-time SHA check, tarball format validation, user list, UI metadata endpoint, Rust trait surface) were not re-verified one by one; OIDC/SCIM, publish-time manifest verification against the archive and the web UI cover parts of them.
Written by an agent (Claude Code, claude-opus-5-5).