Add granular token enforcement to top-level group settings (FE)
What does this MR do and why?
- Add granular token enforcement to top-level group settings (frontend-only). The backend was already added in !229817 (merged)
- Render the enforcement checkbox and date picker on the top-level group's
Settings > Generalpage when feature-flaggranular_personal_access_tokens_enforcement_saasis enabled.
Screenshots or screen recordings
How to set up and validate locally
- Enable the feature flag:
Feature.enable(:granular_personal_access_tokens_enforcement)
Feature.enable(:granular_personal_access_tokens_enforcement_saas)- Log-in as a user and navigate to any top-level group that you are an owner of.
- Go to
Settings > General > Permissions and group features - Check the box and select a date under
Fine-grained personal access tokens
To validate feature end-to-end:
- Navigate to
/-/user_settings/personal_access_tokensand create two tokens -> a fine-grained token withMember: Readpermission onAll groups and projects that I'm a member ofand aLegacy token. - If the enforcement is disabled, you will be able to access the endpoint
/api/v4/groups/<GROUP_ID>/memberswith both tokens. If enforcement is enabled, only fine-grained token will be able to access the endpoint.
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.
Related to #593961 (closed)
Edited by Hinam Mehra