Add backend pagination support for the inactive token table
What does this MR do and why?
Implement support for the backend paginated data for the inactive access token table.
References
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
No changes
How to set up and validate locally
This MR depends on the following backend:
curl https://gitlab.com/gitlab-org/gitlab/-/merge_requests/173867.patch | git apply
The inactive access token table appears in:
-
Group access token page, for example:
/groups/flightjs/-/settings/access_tokens
-
Project access token page, for example:
/flightjs/Flight/-/settings/access_tokens
-
Create project/group access token.
- https://docs.gitlab.com/ee/user/project/settings/project_access_tokens.html#create-a-project-access-token
- https://docs.gitlab.com/ee/user/group/settings/group_access_tokens.html#create-a-group-access-token-using-ui
- From Rails console, generate inactive access tokens based on the access token created in the step 4.
bot_user = User.project_bot.last
(1..200).each do |n|
bot_user.personal_access_tokens.create!(name: "Inactive Token #{n}", created_at: 10.days.ago, updated_at: 5.days.ago, expires_at: 3.days.ago, scopes: bot_user.personal_access_tokens.first.scopes)
end
(201..500).each do |n|
bot_user.personal_access_tokens.create!(name: "Inactive Token #{n}", created_at: 10.days.ago, updated_at: 5.days.ago, revoked: true, expires_at: 30.days.since, scopes: bot_user.personal_access_tokens.first.scopes)
end
- Enable the
retain_resource_access_token_user_after_revoke
feature flag:/rails/features
- Go to
/groups/flightjs/-/settings/access_tokens
and play with the pagination
Edited by Eduardo Sanz García