Skip to content

Add Group Service Accounts API

Drew Blessing requested to merge dblessing_service_acct_saas_api into master

What does this MR do and why?

Describe in detail what your merge request does and why.

Fixes #407775 (closed)

Add new API endpoint to create service accounts within a group.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Create a group and ensure your test user is an owner.
  2. Create a Personal Access Token with api scope.
  3. Test the API via a terminal: curl -XPOST "https://gdk.test:3443/api/v4/groups/<group_id>/service_accounts?access_token=your_test_token"
  4. Observe the API returns a response like:
    {"id":57,"username":"service_account_group_33_6018816a18e515214e0c34c2b33523fc","name":"Service account user","state":"active","avatar_url":"...","web_url":"https://gdk.test:3443/service_account_group_33_6018816a18e515214e0c34c2b33523fc"

Optionally call the API again with a non-existent group ID (returns 404 not found), or with an access token for a user that's not an owner in the group (returns forbidden).

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Drew Blessing

Merge request reports

Loading