Skip to content

Project access token audit events- Log token id instead of user id

What does this MR do?

In project access token audit events, log token_id instead of user_id.

Previously, Audit Events log would say "Created project access token with id: 123", but when I tried using the API to delete token 123, it'd return a 404. The API endpoint relies on token_id (not user_id) to find the token, so I was looking for token 123 instead of user 123, which did not exist. This can be confusing for the user, who has just been told they created a token with id 123 but now cannot perform any actions on it.

Now the message will read "Created project access token with token_id: 999", and using the API to delete token 999 will delete the correct token.

Related to: !51660 (merged), !52139 (merged)

image

Before: new-token creation message shows the token user id: 173.

After: testtest creation message shows token id: 66 and specifies that it's the token_id.

Screenshots (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #299943 (closed)

Edited by Serena Fang

Merge request reports