Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/grape_logging/loggers/token_logger.rb')
-rw-r--r--lib/gitlab/grape_logging/loggers/token_logger.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/gitlab/grape_logging/loggers/token_logger.rb b/lib/gitlab/grape_logging/loggers/token_logger.rb
new file mode 100644
index 00000000000..a7c1b42ec96
--- /dev/null
+++ b/lib/gitlab/grape_logging/loggers/token_logger.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+module Gitlab
+ module GrapeLogging
+ module Loggers
+ class TokenLogger < ::GrapeLogging::Loggers::Base
+ def parameters(request, _)
+ params = request.env[::API::Helpers::API_TOKEN_ENV]
+
+ return {} unless params
+
+ params.slice(:token_type, :token_id)
+ end
+ end
+ end
+ end
+end