Skip to content

Add Email to Audit Event APIs

Michael Becker requested to merge feat/386322 into master

What does this MR do and why?

We have been requested by users to add email and sso ID to the audit event details (#386322 (closed) )

This commit adds the email to the group, project, and user APIs via modifying the model's formatted_details method

This method is used in the Grape presenter here

Screenshots or screen recordings

api response
image

How to set up and validate locally

  1. make sure you have an EE enabled local gitlab instance
  2. create a personal access token on an admin account to use with the API calls
  3. save token in terminal variable
TOKEN=glpat-blahblahblah
  1. I used the following bash 1-liners to fetch the affected APIs
curl --header "PRIVATE-TOKEN: $TOKEN" -X GET -H "Content-Type: application/json" -H "Accept: application/json, text/plain, */*" "localhost:3000/api/v4/groups/70/audit_events?per_page=100&page=1" | json_pp
curl --header "PRIVATE-TOKEN: $TOKEN" -X GET -H "Content-Type: application/json" -H "Accept: application/json, text/plain, */*" "localhost:3000/api/v4/projects/19/audit_events?per_page=100&page=1" | json_pp
curl --header "PRIVATE-TOKEN: $TOKEN" -X GET -H "Content-Type: application/json" -H "Accept: application/json, text/plain, */*" "localhost:3000/api/v4/audit_events?per_page=100&page=1" | json_pp
  1. you should see author email in the responses

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Michael Becker

Merge request reports

Loading