feat(api): add full service account support at instance, group, and project level#3361
feat(api): add full service account support at instance, group, and project level#3361syphernl wants to merge 2 commits intopython-gitlab:mainfrom
Conversation
154f447 to
358da71
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3361 +/- ##
==========================================
+ Coverage 92.16% 95.78% +3.62%
==========================================
Files 100 100
Lines 6125 6170 +45
==========================================
+ Hits 5645 5910 +265
+ Misses 480 260 -220
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
b67174c to
611dd0f
Compare
There was a problem hiding this comment.
Pull request overview
Adds first-class support for GitLab Service Accounts across instance, group, and project scopes in the python-gitlab v4 object model, including personal access token sub-resources for group/project service accounts, plus docs and unit tests to validate the new endpoints.
Changes:
- Introduces instance-level
gl.service_accountswith list/create/update (PATCH) andsave()support. - Expands group-level service accounts with update (PATCH), delete, and a
personal_access_tokenssub-resource (list/create/delete/rotate). - Adds project-level service accounts CRUD and a matching
personal_access_tokenssub-resource, with docs + unit tests.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
gitlab/v4/objects/service_accounts.py |
Implements instance/group/project service account managers + token sub-resources (create/list/update/delete/rotate) using existing mixins. |
gitlab/client.py |
Exposes instance-level service_accounts manager on the GitLab client (gl.service_accounts). |
gitlab/v4/objects/projects.py |
Adds service_accounts manager typing/import so project.service_accounts is available. |
tests/unit/objects/test_service_accounts.py |
Adds unit tests for service account operations and token sub-resource operations across instance/group/project levels. |
docs/gl_objects/service_accounts.rst |
New documentation page covering usage for all scopes and token sub-resources. |
docs/api-objects.rst |
Registers the new service accounts documentation page in the API objects docs index. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Also, I'm okay with this as a follow-up or updating this commit. It would be good to update Same for Thanks! |
…I actions Add GroupServiceAccountAccessTokenManager, ProjectServiceAccountAccessTokenManager, GroupServiceAccountAccessToken, and ProjectServiceAccountAccessToken to the cli.register_custom_action cls_names in RotateMixin and ObjectRotateMixin.
Changes
Extends service account support to cover all API levels and adds missing CRUD operations. Closes #2812. Supersedes #3109.
Instance-level service accounts (
gl.service_accounts)GET /service_accountsPOST /service_accountsPATCH /service_accounts/:id(via.update()or.save())Group-level service accounts (
group.service_accounts)PATCH /groups/:id/service_accounts/:user_idemailparameter to create/updateorder_by/sortlist filtersservice_account.access_tokens):list, create, delete, rotate — mirrors group access tokens
Project-level service accounts (
project.service_accounts)PATCH), deleteservice_account.access_tokens): list, create, delete, rotateUsage
Notes
GetMixinis added at any level. The API exposes list-only, not fetch-by-id.Documentation and testing