API create PAT for Service Accounts by group owners
What does this MR do and why?
Provides an API endpoint for creating token for service account user by group owner This is in continuation of !122758 (merged) and Solution for #406781 (closed)
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Create a group and ensure your test user is an owner.
- Create a Personal Access Token with
api
scope. - Use the token to perform following curl requests
Create a Personal Access Token for the user
curl -XPOST "https://gdk.test:3443/api/v4/groups/<group_id>/service_accounts/<user_id>/personal_access_tokens?access_token=<token_value>" --data "scopes[]=api" --data "name=service_accounts_token"
Revoke a Personal Access Token for the user
curl -XPOST "https://gdk.test:3443/api/v4/groups/<group_id>/service_accounts/<user_id>/personal_access_tokens/<token_id_to_rotate>/rotate?access_token=<token_value>"
Screenshots showing the curl requests working
Edited by Smriti Garg