Stop storing personal access tokens in Redis -1
What does this MR do and why?
This is part 1 of a rollout to display the newly created personal access token without the need of reloading the page. This prevents the need of storing the new access token in Redis (gitlab-org/gitlab#325157). In addition, it makes the page more dynamic and responsive.
Currently, this change only affects the personal access token page.
Other type of tokens are not affected by this change:
Screenshots or screen recordings
The new UI has no differences from the previous UI, except for:
- the new token is displayed with the InputCopyToggleVisibility component
- the forms errors are presented in a different place and with a dismissible GlAlert component
State | Before | After | Differences |
---|---|---|---|
Success | The access token table doesn't update in this MR (see below about part 2) | ||
Error | The error is dismissible and it is displayed at different position than before. The new location is the same as where the new token should appear. |
How to set up and validate locally
- The new feature is behind a
⛳ ️. Runbin/rails console
and set up the flag:Feature.enable(:access_token_ajax)
- To display the form error go to the personal access tokens page enter a name for your token and press
Create a personal access token
- To display the new token within the
InputCopyToggleVisibility
component, do the same as above but also check one or more scopes.
Update access token table
When a new token is created the access token table is not updated. In part 2, I replace HAML access token table by a Vue component. The table is updated via AJAX so it reflects the newly generated tokens. I split this task into two MRs to make it easier to review.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.