Skip to content

Commit f37d2bc

Browse files
authored
Merge pull request #726 from rbcollins123/doc-cg-example
Document an example adding RBACContentGuard to pypi distribution
2 parents fc43b4b + 571bcba commit f37d2bc

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/admin/guides/rbac.md

+16
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,22 @@ protect who can download Python content then do so by adding a content guard to
5454
pulp python distribution update --name foo --content-guard $CONTENT_GUARD_HREF_OR_NAME
5555
```
5656

57+
Example pulp-cli workflow to add RBAC-based access to download from the index:
58+
59+
```bash
60+
pulp content-guard rbac create --name foo-guard
61+
pulp content-guard rbac assign --name foo-guard --user user1 --user user2 --group group1 --group group2
62+
CG_HREF=$(pulp content-guard rbac list --name foo-guard | jq -r ".[0].pulp_href")
63+
pulp python distribution update --name foo --content-guard $CG_HREF
64+
```
65+
66+
Links for using basic auth with various python package tools to pass the
67+
new RBACContentGuard:
68+
- [pip](https://pip.pypa.io/en/stable/topics/authentication/)
69+
- [poetry](https://python-poetry.org/docs/repositories/#private-repository-example)
70+
- [pipenv](https://pipenv.pypa.io/en/latest/credentials.html)
71+
- [pdm](https://pdm-project.org/en/latest/usage/config/#store-credentials-with-the-index)
72+
5773
!!! warning
5874
The PyPI access policies do not support `creation_hooks` or `queryset_scoping`.
5975

0 commit comments

Comments
 (0)