Skip to content

Add `revocation_source` to PAT revocation audit, and add test coverage

Nick Malcolm requested to merge 460779-token-revocation-test into master

What does this MR do and why?

I'm working on Create an API endpoint for revoking a token wit... (#460779) and noticed that part of the code I want to change lacks test coverage. This MR adds those specs, so that my future MR can be more concise.

It also makes a small change: it adds the revocation source to the audit context. This way, in our audit we can determine whether the PAT was revoked by an API call or via GitLab's automated Secret Detection Service

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Related to #460779

Merge request reports