Managing access and permissions Red Hat Quay 3 Managing access and permissions Red Hat OpenShift Documentation Team

Commands:
curl -X GET -H "Authorization: Bearer <your_access_token>" "<quay-server.example.com>/api/v1/organization/<organization_name>/team/<team_name>/permissions"
{"permissions": [{"repository": {"name": "api-repo", "is_public": true}, "role": "admin"}]}
curl -X PUT -H "Authorization: Bearer <your_access_token>" -H "Content-Type: application/json" -d '{ "role": "<role>" }' "<quay-server.example.com>/api/v1/organization/<organization_name>/team/<team_name>"
{"name": "testteam", "description": "", "can_view": true, "role": "creator", "avatar": {"name": "testteam", "hash": "827f8c5762148d7e85402495b126e0a18b9b168170416ed04b49aae551099dc8", "color": "#ff7f0e", "kind": "team"}, "new_team": false}
curl -X POST -H "Authorization: Bearer <bearer_token>" -H "Content-Type: application/json" --data '{ "role": "<admin_read_or_write>", "delegate": { "name": "<username>", "kind": "user" }, "activating_user": { "name": "<robot_name>" } }' https://<quay-server.example.com>/api/v1/organization/<organization_name>/prototypes
{"activating_user": {"name": "test-org+test", "is_robot": true, "kind": "user", "is_org_member": true, "avatar": {"name": "test-org+test", "hash": "aa85264436fe9839e7160bf349100a9b71403a5e9ec684d5b5e9571f6c821370", "color": "#8c564b", "kind": "robot"}}, "delegate": {"name": "testuser", "is_robot": false, "kind": "user", "is_org_member": false, "avatar": {"name": "testuser", "hash": "f660ab912ec121d1b1e928a0bb4bc61b15f5ad44d5efdc4e1c92a25e99b8e44a", "color": "#6b6ecf", "kind": "user"}}, "role": "admin", "id": "977dc2bc-bc75-411d-82b3-604e5b79a493"}
curl -X PUT -H "Authorization: Bearer <bearer_token>" -H "Content-Type: application/json" --data '{ "role": "write" }' https://<quay-server.example.com>/api/v1/organization/<organization_name>/prototypes/<prototypeid>
{"activating_user": {"name": "test-org+test", "is_robot": true, "kind": "user", "is_org_member": true, "avatar": {"name": "test-org+test", "hash": "aa85264436fe9839e7160bf349100a9b71403a5e9ec684d5b5e9571f6c821370", "color": "#8c564b", "kind": "robot"}}, "delegate": {"name": "testuser", "is_robot": false, "kind": "user", "is_org_member": false, "avatar": {"name": "testuser", "hash": "f660ab912ec121d1b1e928a0bb4bc61b15f5ad44d5efdc4e1c92a25e99b8e44a", "color": "#6b6ecf", "kind": "user"}}, "role": "write", "id": "977dc2bc-bc75-411d-82b3-604e5b79a493"}
curl -X DELETE -H "Authorization: Bearer <bearer_token>" -H "Accept: application/json" https://<quay-server.example.com>/api/v1/organization/<organization_name>/prototypes/<prototype_id>
curl -X GET -H "Authorization: Bearer <bearer_token>" -H "Accept: application/json" https://<quay-server.example.com>/api/v1/organization/<organization_name>/prototypes
{"prototypes": []}
curl -X PUT -H "Authorization: Bearer <bearer_token>" -H "Content-Type: application/json" -d '{"role": "admin"}' https://<quay-server.example.com>/api/v1/repository/<namespace>/<repository>/permissions/user/<username>
{"role": "admin", "name": "quayadmin+test", "is_robot": true, "avatar": {"name": "quayadmin+test", "hash": "ca9afae0a9d3ca322fc8a7a866e8476dd6c98de543decd186ae090e420a88feb", "color": "#8c564b", "kind": "robot"}}
curl -X DELETE -H "Authorization: Bearer <bearer_token>" -H "Accept: application/json" https://<quay-server.example.com>/api/v1/repository/<namespace>/<repository>/permissions/user/<username>
curl -X GET -H "Authorization: Bearer <bearer_token>" -H "Accept: application/json" https://<quay-server.example.com>/api/v1/repository/<namespace>/<repository>/permissions/user/<username>/
message: User does not have permission for repo.
curl -X POST -H "Authorization: Bearer GCczXwaZ5i21p8hOO09uZqjZSsTYGKteu5PC5UuA" -H "Content-Type: application/json" -d '{ "visibility": "private" }' "https://quay-server.example.com/api/v1/repository/my_namespace/test_repo_three/changevisibility"
success: yes
curl -X PUT -H "Authorization: Bearer <bearer_token>" "https://<quay-server.example.com>/api/v1/organization/<organization_name>/robots/<robot_name>"
name: orgname+robot-name
created: Fri, 10 May 2024 15:11:00 -0000
token: <example_secret>
curl -X PUT -H "Authorization: Bearer <bearer_token>" "https://<quay-server.example.com>/api/v1/user/robots/<robot_name>"
name: quayadmin+robot-name
created: Fri, 10 May 2024 15:24:57 -0000
token: <example_secret>
ROBOTS_DISALLOW: true
podman login -u="<organization-name/username>+<robot-name>" -p="KETJ6VN0WT8YLLNXUJJ4454ZI6TZJ98NV41OE02PC2IQXVXRFQ1EJ36V12345678" <quay-server.example.com>
Error: logging into "<quay-server.example.com>": invalid username/password
podman login -u="<organization-name/username>+<robot-name>" -p="KETJ6VN0WT8YLLNXUJJ4454ZI6TZJ98NV41OE02PC2IQXVXRFQ1EJ36V12345678" --log-level=debug <quay-server.example.com>
DEBU[0000] error logging into "quay-server.example.com": unable to retrieve auth token: invalid username/password: unauthorized: Robot accounts have been disabled. Please contact your administrator.
curl -X POST -H "Authorization: Bearer <bearer_token>" "<quay-server.example.com>/api/v1/organization/<orgname>/robots/<robot_shortname>/regenerate"
name: test-org+test
created: Fri, 10 May 2024 17:46:02 -0000
token: <example_secret>
curl -X POST -H "Authorization: Bearer <bearer_token>" "<quay-server.example.com>/api/v1/user/robots/<robot_shortname>/regenerate"
name: quayadmin+test
created: Fri, 10 May 2024 14:12:11 -0000
token: <example_secret>
curl -X DELETE -H "Authorization: Bearer <bearer_token>" "<quay-server.example.com>/api/v1/organization/<organization_name>/robots/<robot_shortname>"
curl -X GET -H "Authorization: Bearer <bearer_token>" "https://<quay-server.example.com>/api/v1/organization/<organization_name>/robots"
{"robots": []}
curl -X DELETE -H "Authorization: Bearer <bearer_token>" "<quay-server.example.com>/api/v1/user/robots/<robot_shortname>"
curl -X GET -H "Authorization: Bearer <bearer_token>" "<quay-server.example.com>/api/v1/user/robots/<robot_shortname>"
message: Could not find robot with specified username