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
6a5887cb
Commit
6a5887cb
authored
May 14, 2018
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port of 46361-does-not-log-failed-sign-in-attempts-when-the-database-is-in-read-only-mode to EE
parent
70e8f831
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
20 deletions
+0
-20
ee/app/models/ee/user.rb
ee/app/models/ee/user.rb
+0
-6
ee/spec/models/ee/user_spec.rb
ee/spec/models/ee/user_spec.rb
+0
-14
No files found.
ee/app/models/ee/user.rb
View file @
6a5887cb
...
...
@@ -5,7 +5,6 @@ module EE
# and be prepended in the `User` model
module
User
extend
ActiveSupport
::
Concern
extend
::
Gitlab
::
Utils
::
Override
include
AuditorUserHelper
included
do
...
...
@@ -92,10 +91,5 @@ module EE
def
email_opted_in_source
email_opted_in_source_id
==
EMAIL_OPT_IN_SOURCE_ID_GITLAB_COM
?
'GitLab.com'
:
''
end
override
:increment_failed_attempts!
def
increment_failed_attempts!
super
if
::
Gitlab
::
Database
.
read_write?
end
end
end
ee/spec/models/ee/user_spec.rb
View file @
6a5887cb
...
...
@@ -137,18 +137,4 @@ describe EE::User do
end
end
end
describe
'#increment_failed_attempts!'
do
subject
(
:user
)
{
create
(
:user
,
failed_attempts:
0
)
}
it
'logs failed sign-in attempts'
do
expect
{
user
.
increment_failed_attempts!
}.
to
change
(
user
,
:failed_attempts
).
from
(
0
).
to
(
1
)
end
it
'does not log failed sign-in attempts when in a GitLab read-only instance'
do
allow
(
Gitlab
::
Database
).
to
receive
(
:read_only?
)
{
true
}
expect
{
user
.
increment_failed_attempts!
}.
not_to
change
(
user
,
:failed_attempts
)
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