Group member expires at update on rotate token
What does this MR do and why?
Currently while rotating personal access token for a bot user for a group, membership is not getting updated.
We limited the access level check only for project resource. This MR fixes the issue for updating membership expires_at
date for a bot user when it belongs to group
Solves #438705 (closed)
How to set up and validate
- Create a group access toke
- List all group access token using API call
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/<group_id>/access_tokens"
- Rotate any access token using Rotate API
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/<group_id>/access_tokens/<token_id>/rotate" --date "expires_at=<value>"
Specify expires_at
to a custom date as parameter to API call
- Access Rails console bot user's membership's expires_at date should have been updated to as specified in step 3
GroupMember.where(user_id: <bot_user_id>)
Edited by Smriti Garg