-
Notifications
You must be signed in to change notification settings - Fork 674
Description
In GitLab 15.0 they added the ability to delete a Personal Access Token (PAT) by value. Previously could only delete a PAT by the ID. But if you have a lot of PATs and want to delete one with a specific value it was difficult, unless you had maintained a document mapping PAT values to IDs.
New API:
https://docs.gitlab.com/ee/api/personal_access_tokens.html#using-a-request-header
Release notes: https://about.gitlab.com/releases/2022/05/22/gitlab-15-0-released/
In previous versions of GitLab, personal access tokens could be deleted only by the ID. Because none of the endpoints return an ID from a given value, you couldn’t delete a personal access token if you only had the token value. (This isn't technically true)
You can also now use the personal_access_tokens/self endpoint to revoke a PAT with a single request. The endpoint revokes the PAT used to make the request, making it easy to quickly revoke PATs in case of a leak.