Add expires_before arg and count support to user personal access tokens GraphQL endpoint
What does this MR do and why?
- Add
expires_beforeargument touser { personalAccessTokens }GraphQL field to enable filtering for tokens that expire before a specified date - Support
user { personalAccessTokens { count } }GraphQL query
References
[BE] Get PAT statistics from GraphQL (#581649).
Screenshots or screen recordings
How to set up and validate locally
- Login with any user
- Create a personal access token for the user
- Go to http://localhost:3000/-/graphql-explorer and run the following query
query { user(id: "gid://gitlab/User/<user_id>") { personalAccessTokens(state: ACTIVE, expiresBefore: "2099-12-31") { count } } } - Verify that the query succeeds and
countfield is present
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Eugie Limpin
