Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
42a3f913
Commit
42a3f913
authored
Aug 02, 2021
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/security/gitlab@13-12-stable-ee
parent
f4fbe9d6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
28 deletions
+1
-28
config/initializers/omniauth.rb
config/initializers/omniauth.rb
+1
-3
lib/gitlab/omniauth_logging/json_formatter.rb
lib/gitlab/omniauth_logging/json_formatter.rb
+0
-13
spec/lib/gitlab/omniauth_logging/json_formatter_spec.rb
spec/lib/gitlab/omniauth_logging/json_formatter_spec.rb
+0
-12
No files found.
config/initializers/omniauth.rb
View file @
42a3f913
...
@@ -19,6 +19,4 @@ OmniAuth.config.before_request_phase do |env|
...
@@ -19,6 +19,4 @@ OmniAuth.config.before_request_phase do |env|
Gitlab
::
RequestForgeryProtection
.
call
(
env
)
Gitlab
::
RequestForgeryProtection
.
call
(
env
)
end
end
# Use json formatter
OmniAuth
.
config
.
logger
=
Gitlab
::
AppLogger
OmniAuth
.
config
.
logger
.
formatter
=
Gitlab
::
OmniauthLogging
::
JSONFormatter
.
new
OmniAuth
.
config
.
logger
.
level
=
Logger
::
ERROR
if
Rails
.
env
.
production?
lib/gitlab/omniauth_logging/json_formatter.rb
deleted
100644 → 0
View file @
f4fbe9d6
# frozen_string_literal: true
require
'json'
module
Gitlab
module
OmniauthLogging
class
JSONFormatter
def
call
(
severity
,
datetime
,
progname
,
msg
)
{
severity:
severity
,
timestamp:
datetime
.
utc
.
iso8601
(
3
),
pid:
$$
,
progname:
progname
,
message:
msg
}.
to_json
<<
"
\n
"
end
end
end
end
spec/lib/gitlab/omniauth_logging/json_formatter_spec.rb
deleted
100644 → 0
View file @
f4fbe9d6
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Gitlab
::
OmniauthLogging
::
JSONFormatter
do
it
"generates log in json format"
do
Timecop
.
freeze
(
Time
.
utc
(
2019
,
12
,
04
,
9
,
10
,
11
,
123456
))
do
expect
(
subject
.
call
(
:info
,
Time
.
now
,
'omniauth'
,
'log message'
))
.
to
eq
%Q({"severity":"info","timestamp":"2019-12-04T09:10:11.123Z","pid":
#{
Process
.
pid
}
,"progname":"omniauth","message":"log message"}
\n
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment