Add GET /personal_access_tokens/self endpoint to view its details
What does this MR do and why?
Recently there has been added a new endpoint to delete a token provided in the header of the request https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/personal_access_tokens/self_revocation.rb
Similarly, this MR adds GET /personal_access_token/self
to view provided token details.
It's particularly useful in ~"group::import" which can be used in GitLab Migration feature, where we need to check and see provided token scopes. Such endpoint allows us to bounce off some of the import attempts early, without failing mid migration (if provided token doesn't have sufficient scope).
Mentions #373999 (closed)
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
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.