Skip to content

Add projects field to personal access token form [RUN ALL RSPEC] [RUN AS-IF-FOSS]

📖 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

  1. Introduce the personal_access_tokens_scoped_to_projects feature flag
  2. Add "All projects" and "Selected projects" radio buttons to personal access tokens form.

💻 Local testing

  1. Enable the personal_access_tokens_scoped_to_projects feature flag.
    • bin/rails console
    • Feature.enable(:personal_access_tokens_scoped_to_projects)
  2. Navigate to /-/profile/personal_access_tokens

📷 Screenshots

Before After
Screen_Shot_2021-02-22_at_11.26.45_AM Screen_Shot_2021-02-22_at_11.26.06_AM

📈 Future iterations

  1. Add a projects token selector that will be active when the "Selected projects" radio is checkedScreen_Shot_2021-02-19_at_3.30.45_PM
  2. Set the value of hidden input to a comma separated list of project IDs provided by the projects selector.
  3. Wire up the frontend to the backend once the controller has been updated in #15666 (closed)
  4. Add a "Project(s)" column to the table that lists all active PAT image
  5. Update documentation

🚦 Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

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

Merge request reports