Set group_id and user_type for human users' personal access tokens
What does this MR do and why?
This MR
- ensures that when creating a personal access token for human user we set
group_idanduser_typefor the new token - ensures that when rotating a personal access token for human user we set
group_idanduser_typefor the new token - ensures that
Groups::EnterpriseUsers::AssociateServicethat claims a user, setsgroup_idto the group ID for the user's personal_access_tokens - ensures that
Groups::EnterpriseUsers::DisassociateServicethat disassociates a user from the group, setsgroup_idto NULL for the user's personal_access_tokens - adds DB migration to set
group_idbased onuser_details.enterprise_group_idanduser_typebased onusers.user_typefor existing human users' personal_access_tokens
We need to backfill those columns to be able to optimize retrieving personal access tokens for Credentials inventory index page and API endpoints, see #558112 (closed) and !201312 (merged). We will definitely benefit from this denormalization in other parts of the application.
References
- Set group_id and user_type for human users' per... (#558105 - closed)
- Optimize retrieving personal and resource acces... (#558112 - closed)
- Optimize retrieving personal and resource acces... (!201312 - merged)
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Bogdan Denkovych