phac-nml / irida-next

IRIDA Next
https://phac-nml.github.io/irida-next/
Apache License 2.0
8 stars 3 forks source link

Project bot account personal access tokens UI #548

Closed deepsidhu85 closed 5 months ago

deepsidhu85 commented 5 months ago

What does this PR do and why?

Describe in detail what your merge request does and why.

This PR adds in UI functionality to generate new personal access tokens for project bot accounts, and to list active personal access tokens for the bot in a modal on bot name link click, and to revoke tokens.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other pull requests.

image

image

image

image

image

image

image

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

PR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

  1. Login as a user
  2. Create a new project
  3. Go to the project show page, click Settings from the sidebar, and then click Bot Accounts
  4. You shouldn't see any bot accounts
  5. Create a new bot account by clicking the New bot account button
  6. Fill in the token name, select an access level, and select atleast 1 scope, and click submit
  7. You should now see a table with the bot account listed
  8. In the Active Tokens column you should see a count of 1. Click the 1
  9. The modal that pops up should list the personal access token for the bot account
  10. Close the modal
  11. In the actions column within the table for the bot account, click the ellipsis, and then Generate new token
  12. Fill in the token name, and select atleast 1 scope, and click submit
  13. The table should update and in the Active Tokens column you should see a count of 2 for the bot account
  14. Click the 2 in the Active Tokens column
  15. In the modal you should now see 2 personal access tokens listed for the bot account
  16. Click Revoke and thenConfirm for either of the tokens
  17. The token should be removed from the table in the modal
  18. Add a user to the project with < Maintainer role
  19. Sign out and sign in as the user from step 18
  20. They should not be able to access the bot accounts page (either through url or through the ui from the settings menu for the project
github-actions[bot] commented 5 months ago

Simplecov Report

Covered Threshold
91.86% 90%