Skip to content

feat(rbac): add Role-Based Access Control to pulp_npm - #414

Merged
dkliban merged 1 commit into
pulp:mainfrom
CryptoRodeo:feat/add-rbac
Aug 11, 2026
Merged

feat(rbac): add Role-Based Access Control to pulp_npm#414
dkliban merged 1 commit into
pulp:mainfrom
CryptoRodeo:feat/add-rbac

Conversation

@CryptoRodeo

@CryptoRodeo CryptoRodeo commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Enable fine-grained permission enforcement across all npm resources. Users can now be assigned creator, owner, or viewer roles on repositories, remotes, and distributions, with object-level scoping and cross-object permission checks.

fixes #387

📜 Checklist

  • Commits are cleanly separated with meaningful messages (simple features and bug fixes should be squashed to one commit)
  • A changelog entry or entries has been added for any significant changes
  • Follows the Pulp policy on AI Usage
  • (For new features) - User documentation and test coverage has been added

See: Pull Request Walkthrough

@CryptoRodeo
CryptoRodeo force-pushed the feat/add-rbac branch 2 times, most recently from 3971090 to 2b040a9 Compare August 3, 2026 20:51
@CryptoRodeo
CryptoRodeo marked this pull request as ready for review August 3, 2026 21:00

@dkliban dkliban left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated review — all three issues from the original review have been addressed. CI is green.

Fixes verified

  1. queryset_filtering_required_permission added to NpmPackageViewSet — content listing is now properly scoped by RBAC.

  2. NpmPingView now uses permission_classes = [AccessPolicyFromDB] with authentication_classes = [] and principal: "*" — clean, consistent with how other plugins handle public endpoints. New test_ping_unauthenticated validates it with a raw HTTP request.

  3. Content scoping test now syncs actual content via a local fixture server, verifies the sync produced content, then validates that scoping filters by repository viewer permission. The test properly checks that granting an object-level viewer role makes content visible.

  4. Typo fixed.

LGTM — the access policies, locked roles, model permissions, conditions, post_migrate signal, settings, and tests all follow pulpcore patterns correctly. Comprehensive test coverage across CRUD, sync, cross-object permissions, role management, version delegation, content scoping, object-level scoping, and unauthenticated ping access.

@dkliban dkliban left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(superseded — see updated review above)

@CryptoRodeo
CryptoRodeo force-pushed the feat/add-rbac branch 4 times, most recently from 7a2a928 to a683f03 Compare August 10, 2026 20:16
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dkliban
dkliban merged commit b6b73e9 into pulp:main Aug 11, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement RBAC

2 participants