Skip to content

Event type information in streaming audit event for deploy token

Harsimar Sandhu requested to merge 363087-deploy-token-event-type-info into master

What does this MR do and why?

Add event type information in streaming audit event while creation and revoking deploy token

event type names are as follow:

action event type
creation deploy_token_created
revoke deploy_token_revoked
delete deploy_token_destroyed
creation failed deploy_token_creation_failed

How to set up and validate locally

  1. Create a deploy token from Project -> Settings -> Repository.
  2. Check streamed audit event contains correct event type information both in payload and headers.
  3. Check audit event is saved in database and is visible at {{base url}}/admin/audit_logs.
  4. Revoke a deploy token from UI.
  5. Repeat step 2 and 3.
  6. Create Deploy token using API https://docs.gitlab.com/ee/api/deploy_tokens.html#create-a-project-deploy-token
  7. Repeat step 2 and 3
  8. Delete Deploy token using API https://docs.gitlab.com/ee/api/deploy_tokens.html#delete-a-project-deploy-token
  9. Repeat step 2 and 3
  10. Try to Create Deploy token using API https://docs.gitlab.com/ee/api/deploy_tokens.html#create-a-project-deploy-token with empty scopes so that it throws error
  11. Repeat step 2 and 3

MR acceptance checklist

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

Related to #363087 (closed)

Edited by Harsimar Sandhu

Merge request reports