Add ability to track unique uses of API endpoints
What does this MR do?
- Adds the ability to track unique uses of the audit events API.
- Adds the ability to do this with any single API or subset of APIs too.
Another version of this MR was reverted from staging after causing this issue.. This issue has been resolved by using the current user's ID as the unique key instead of a randomly generated UUID that depends on the use of sessions.
This caused a problem whereby sometimes the context
session was nil
and this caused an error to be thrown. It is not currently known why context.session
is nil
in production but not in development (it is not reproducable using GDK).
Original MR | !39616 (merged) |
Revert MR | !40921 (merged) |
Issue Raised from sentry errors | #243680 (closed) |
Sentry errors | https://sentry.gitlab.net/gitlab/staginggitlabcom/issues/1796070/?referrer=gitlab_integration |
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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
Mentions #233786 (closed)
Edited by Max Woolf