Add lastUsedIps field to PersonalAccessToken GraphQL type

What does this MR do and why?

References

[BE] New GraphQL query to fetch list of all cre... (#572948).

Screenshots or screen recordings

Screenshot_2025-12-11_at_11.04.38_AM

How to set up and validate locally

  1. Login with any user
  2. In Rails console create personal access tokens for the user with last_used_ips
    $ rails c
    > user = User.find(<user_id>)
    > FactoryBot.create(:personal_access_token, :with_last_used_ips, user: user)
  3. Go to http://localhost:3000/-/graphql-explorer and run the following query
    query {
      user(id: "gid://gitlab/User/<user_id>") {
        personalAccessTokens {
          nodes {
            name
            lastUsedIps
          }
        }
      }
    }
  4. Verify that lastUsedIps field has values

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

Merge request reports

Loading