Skip to content

pnpr backend parity with verdaccio — Tracking Issue #19

Open

Description

@zkochan

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

Access control

Uplinks & caching

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

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 for dist.tarball rewriting

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.yaml drop-in compatibility guarantee. The config is verdaccio-shaped, not byte-identical.

Written by an agent (Claude Code, claude-opus-4-7).

Activity

  1. pinned this issue on May 26, 2026
  2. deleted a comment from on May 26, 2026
  3. zkochan commented on May 28, 2026

    @zkochan
    MemberAuthor

    The SHA verification on publish item landed in pnpm/pnpm#11976 (merged 3fbc5b5c0b → 87136edaa3). pnpm-registry now hashes incoming publish tarballs as they stream through base64 decode, rejects mismatches against dist.integrity / dist.shasum with a 400 EINTEGRITY before any cache write, and requires dist.integrity to 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).

  4. zkochan commented on May 28, 2026

    @zkochan
    MemberAuthor

    PR pnpm/pnpm#12011 landed the five remaining Auth & user endpoints items:

    • GET /-/whoami
    • GET /-/npm/v1/user
    • GET /-/npm/v1/tokens
    • DELETE /-/npm/v1/tokens/token/:tok
    • DELETE /-/user/token/:tok

    The 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).

  5. zkochan commented on May 28, 2026

    @zkochan
    MemberAuthor

    Checked off Structured access log (one line per request, configurable format) — landed in pnpm/pnpm#12033 (merged).

    pnpr now installs a tracing-subscriber driven by a Verdaccio-6-shaped log: block (format: pretty|json, level), emitting one access record per request (method, URI, status, latency) under the pnpm_registry::access target; RUST_LOG still overrides.

    Supporting infra that came with it (no dedicated checkbox): the global config.yaml is now auto-discovered using pnpm's own config-dir rules (XDG_CONFIG_HOME / macOS / LOCALAPPDATA / ~/.config) under a pnpr leaf, via a shared pacquet-config-dir crate also used by pacquet-config.


    Written by an agent (Claude Code, claude-opus-4-8).

  6. zkochan commented on May 28, 2026

    @zkochan
    MemberAuthor

    Checked off two Access control items — landed in pnpm/pnpm#12043 (merged):

    • Wire policy fully from YAML — Config::from_yaml now compiles PackagePolicies from each packages[*] entry's access/publish tokens (first-match-wins) instead of the hard-coded registry_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.
    • $anonymous group — new AccessRule::Anonymous: admits only unauthenticated callers; an authenticated caller falls outside the group and gets 403.

    Still open under Access control: Named groups / per-user group membership (the remaining unchecked box). unpublish is parsed and validated but still folds into publish at enforcement time.


    Written by an agent (Claude Code, claude-opus-4-8).

  7. zkochan commented on May 29, 2026

    @zkochan
    MemberAuthor

    Checked off Named groups, per-user group membership — landed in pnpm/pnpm#12048 (merged).

    Each packages[*] access/publish is 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).

  8. zkochan commented on Jun 5, 2026

    @zkochan
    MemberAuthor

    Cross-reference for the two auth-backend "decide" items here:

    • "Decide on pluggable auth — interface or out of scope?"
    • "Decide whether pnpr exposes a stable Rust trait surface for auth / storage / middleware backends."

    pnpm/pnpm#12206 (merged) introduced narrow async UserBackend / TokenBackend traits and selects the implementation at config-load time into Arc<dyn …> handles — local (htpasswd + SQLite), in-memory, or a networked libsql/Turso backend via a backend.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).

  9. unpinned this issue on Jun 11, 2026
  10. juanpicado commented on Jun 25, 2026

    @juanpicado
    Member

    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).

  11. transferred this issue frompnpm/pnpmon Sep 26, 2026
  12. zkochan commented on Oct 23, 2026

    @zkochan
    MemberAuthor

    npm deprecate works through a .tgz base but fails through a tar base. Tracked in #198.


    Written by an agent (Claude Code, claude-opus-5-5).

  13. zkochan commented on Nov 8, 2026

    @zkochan
    MemberAuthor

    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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions