Skip to content

npm: name access levels in the docs, and test a content selector on a write grant - #465

Merged
schmitch merged 2 commits into
mainfrom
claude/npm-access-levels-docs
Oct 24, 2026
Merged

schmitch merged 2 commits into
mainfrom
claude/npm-access-levels-docs

Conversation

@schmitch

@schmitch schmitch commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

A follow-up to #463 (npm registries), found by checking it against what main changed while it was open, chiefly the access levels of #460. It was stacked on #463's branch while that sat in the merge queue; #463 has merged, and this PR now targets main. It fixes no issue of its own, and npm behaves the same before and after it.

Changes

  • Wording. Since RBAC: ordered access levels (read < write < delete) for grants and token scopes #460 a grant gives the level read, write or delete, each including the ones below it. docs/npm.md, the npm changelog fragment and the repository form's deployment-policy help text said "the write/delete permission"; they now name the levels. The Permissions table in docs/npm.md has a Level column and links to deployment.md#access-levels.
  • docs/deployment.md. The table of access levels and the writer role now name npm's publish, dist-tags and deprecations (write) and npm unpublish (delete). "delete tags" now reads "delete image tags": removing an npm dist-tag takes write.
  • docs/format-plugins.md. The crate layout lists crates/formats/npm next to NuGet and raw.
  • A test for RBAC: ordered access levels (read < write < delete) for grants and token scopes #460's rule that a content selector on a write grant filters reads as well as publishes. a_selector_on_a_write_grant_scopes_publishes_and_reads gives a user write on @acme/* only. The user publishes and tags @acme packages and reads nothing else: packument (abbreviated and full), tarball and search. A publish outside the scope answers 403, and a dist-tag or a deprecation outside it answers 404.
  • unpublishing_takes_the_delete_permission is renamed unpublishing_takes_the_delete_level, and a comment in state.rs now lists npm among the formats with all three kinds.

Tests

Run locally:

  • cargo fmt --all --check; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo xtask changelog --check
  • cargo test -p forge-server --test npm: 13 passed
  • web: tsc, vitest (417)

🤖 Generated with Claude Code

https://claude.ai/code/session_01BaGpNGgkQV54XvgL5D9ay2

…rant

Since main's access levels (#460), a grant gives the level read, write or
delete, each including the ones below, and a content selector on a write
grant filters reads too. The npm docs and the repository form's help text
said "permission"; they now name the levels, deployment.md's table of
levels names npm's publish, dist-tags, deprecations and unpublish, and
format-plugins.md's layout lists crates/formats/npm.

The new test gives a user write on @acme/* only: it publishes and tags
@acme packages, reads nothing else (packuments, tarballs, search), and is
refused a publish, a dist-tag and a deprecation outside the scope.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BaGpNGgkQV54XvgL5D9ay2
Base automatically changed from claude/41-npm-registry to main October 24, 2026 15:14
main now holds #463, this branch's former base.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BaGpNGgkQV54XvgL5D9ay2
@schmitch
schmitch enabled auto-merge October 24, 2026 15:15
@schmitch
schmitch added this pull request to the merge queue Oct 24, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 24, 2026
@schmitch
schmitch added this pull request to the merge queue Oct 24, 2026

Copy link
Copy Markdown
Member Author

The merge queue's first run of this PR (run 768) failed two checks. Neither comes from this PR's change; both passed on the PR's own run of the same tree.

The re-queued run uses the same script, so it can hit the race again until #468 merges.


Generated by Claude Code

Merged via the queue into main with commit eabe0e8 Oct 24, 2026
21 checks passed
@schmitch
schmitch deleted the claude/npm-access-levels-docs branch October 24, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants