Skip to content

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:

  1. Group access token page, for example: /groups/flightjs/-/settings/access_tokens

  2. Project access token page, for example: /flightjs/Flight/-/settings/access_tokens

  3. Create project/group access token.

  1. 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
  1. Enable the retain_resource_access_token_user_after_revoke feature flag: /rails/features
  2. Go to /groups/flightjs/-/settings/access_tokens and play with the pagination
Edited by Eduardo Sanz García

Merge request reports

Loading