ebf98f27c4
Enables frozen string for the following: * lib/gitlab/fogbugz_import/**/*.rb * lib/gitlab/gfm/**/*.rb * lib/gitlab/git/**/*.rb * lib/gitlab/gitaly_client/**/*.rb * lib/gitlab/gitlab_import/**/*.rb * lib/gitlab/google_code_import/**/*.rb * lib/gitlab/gpg/**/*.rb * lib/gitlab/grape_logging/**/*.rb * lib/gitlab/graphql/**/*.rb * lib/gitlab/graphs/**/*.rb * lib/gitlab/hashed_storage/**/*.rb * lib/gitlab/health_checks/**/*.rb Partially address gitlab-org/gitlab-ce#47424.
20 lines
563 B
Ruby
20 lines
563 B
Ruby
# frozen_string_literal: true
|
|
|
|
# This grape_logging module (https://github.com/aserafin/grape_logging) makes it
|
|
# possible to log the user who performed the Grape API action by retrieving
|
|
# the user context from the request environment.
|
|
module Gitlab
|
|
module GrapeLogging
|
|
module Loggers
|
|
class UserLogger < ::GrapeLogging::Loggers::Base
|
|
def parameters(request, _)
|
|
params = request.env[::API::Helpers::API_USER_ENV]
|
|
|
|
return {} unless params
|
|
|
|
params.slice(:user_id, :username)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|