New feature-flag and pagination logic for personal access token
What does this MR do and why?
Issue #367837. As per Issue
- We Introduced new Feature-flag with name
access_token_pagination
- We Introduced pagination logic in Personal Access Token controller behind the feature flag
Screenshots or screen recordings
How to set up and validate locally
To check the pagination is working properly. Please follow the steps
- Enable the feature-flag
access_token_pagination
from rails console
bin/rails console
Feature.enable(:access_token_pagination)
- Generate 1000 personal access tokens for the root user (user_id: 1):
gdk psql
DO $$
BEGIN
FOR X IN 1..1000 LOOP
INSERT INTO "personal_access_tokens" (name, created_at, updated_at, user_id) VALUES (X, '2022-06-02', '2022-06-02', 1);
END LOOP;
END;
$$;
- Access the api end-point for personal access tokens with page parameter
http://localhost:3000/-/profile/personal_access_tokens.json?page=2
You should be able to view data in json format
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.
Edited by Smriti Garg