Add use_pat event

What does this MR do and why?

This MR adds a new use_pat event for the use case described here

References

#580477

How to validate

  1. Create a PAT on http://127.0.0.1:3000)/-/user_settings/personal_access_tokens, make sure to copy the token!

  2. Enable the feature flag

# rails c
Feature.enable(:track_api_request_from_personal_access_token, PersonalAccessToken.last.user)
  1. Run internal events monitor
rails runner scripts/internal_events/monitor.rb use_pat
  1. Send a request with your token
curl --header "Private-Token: <your-token>" "https://gitlab.example.com/api/v4/user"

You should see an event appear in the monitor:

image

Edited by Matthew MacRae-Bovell

Merge request reports

Loading