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:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-07-23 16:13:11 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-07-23 16:13:11 +0300
commit68547bc0e0e3f85e8ac07c6f81c316e1f4456758 (patch)
tree2d7b038b56e238ae68354afecf092cb09bf8e473 /lib/gitlab/auth
parent1a39d24d2034ce0d87cd5df630f1226d0beb7dd2 (diff)
Track blocked users and two factor authentications
Diffstat (limited to 'lib/gitlab/auth')
-rw-r--r--lib/gitlab/auth/activity.rb16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/gitlab/auth/activity.rb b/lib/gitlab/auth/activity.rb
index 2ff5821ba07..55d682deacb 100644
--- a/lib/gitlab/auth/activity.rb
+++ b/lib/gitlab/auth/activity.rb
@@ -11,8 +11,9 @@ module Gitlab
user_unauthenticated: 'Counter of total authentication failures',
user_not_found: 'Counter of total failed log-ins when user is unknown',
user_password_invalid: 'Counter of failed log-ins with invalid password',
- user_session_fetched: 'Counter of total sessions fetched',
user_session_override: 'Counter of manual log-ins and sessions overrides',
+ user_two_factor_authenticated: 'Counter of two factor authentications',
+ user_blocked: 'Counter of total sign in attempts when user is blocked',
user_signed_out: 'Counter of total user sign out events'
}.freeze
@@ -31,19 +32,22 @@ module Gitlab
self.class.user_password_invalid_counter.increment
end
- # case blocked user
+ if @user.present? && @user.blocked?
+ self.class.user_blocked_counter.increment
+ end
end
def user_authenticated!
self.class.user_authenticated_counter.increment
end
- def user_session_fetched!
- self.class.user_session_fetched_counter.increment
- end
-
def user_session_override!
+ self.class.user_authenticated_counter.increment
self.class.user_session_override_counter.increment
+
+ if @opts[:message] == :two_factor_authenticated
+ self.class.user_two_factor_authenticated_counter.increment
+ end
end
def user_signed_out!