Add projects field to personal access token form [RUN ALL RSPEC] [RUN AS-IF-FOSS]
requested to merge 22754-restrict-personal-access-tokens-to-specific-projects-fe-radio-buttons into master
📖 What does this MR do?
Related to #22754 (closed)
Preparation for adding a projects selector to the personal access token form. This MR adds the radio buttons discussed in #22754 (comment 503838015). Once completed this projects selector will allow users to scope their access tokens to one or more projects.
📋 Summary of changes
- Introduce the
personal_access_tokens_scoped_to_projects
feature flag - Add "All projects" and "Selected projects" radio buttons to personal access tokens form.
💻 Local testing
- Enable the
personal_access_tokens_scoped_to_projects
feature flag.bin/rails console
Feature.enable(:personal_access_tokens_scoped_to_projects)
- Navigate to
/-/profile/personal_access_tokens
📷 Screenshots
Before | After |
---|---|
![]() |
![]() |
📈 Future iterations
- Add a projects token selector that will be active when the "Selected projects" radio is checked
- Set the value of hidden input to a comma separated list of project IDs provided by the projects selector.
- Wire up the frontend to the backend once the controller has been updated in #15666 (closed)
- Add a "Project(s)" column to the table that lists all active PAT
- Update documentation
🚦 Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- Not needed, behind a feature flag
- [-] Documentation (if required)
- Will be added in a future iteration
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
-
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers - [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- Will ask for a security review when the backend is done
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Peter Hegman