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:
authorImre Farkas <ifarkas@gitlab.com>2018-11-24 15:39:16 +0300
committerImre Farkas <ifarkas@gitlab.com>2018-11-29 11:37:16 +0300
commitbd3a4840329160a64c0cac25ed6c1d3b22f5bdb4 (patch)
tree66749539b5aa0544c156374de84671f54dcaa080 /lib/gitlab/auth
parentc07183f0d3ce24e8cfcb93e71ae950d7067a8ce1 (diff)
Add config to disable impersonation
Adds gitlab.impersonation_enabled config option defaulting to true to keep the current default behaviour. Only the act of impersonation is modified, impersonation token management is not affected.
Diffstat (limited to 'lib/gitlab/auth')
-rw-r--r--lib/gitlab/auth/user_auth_finders.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/gitlab/auth/user_auth_finders.rb b/lib/gitlab/auth/user_auth_finders.rb
index adba9084845..a5efe33bdc6 100644
--- a/lib/gitlab/auth/user_auth_finders.rb
+++ b/lib/gitlab/auth/user_auth_finders.rb
@@ -7,6 +7,7 @@ module Gitlab
TokenNotFoundError = Class.new(AuthenticationError)
ExpiredError = Class.new(AuthenticationError)
RevokedError = Class.new(AuthenticationError)
+ ImpersonationDisabled = Class.new(AuthenticationError)
UnauthorizedError = Class.new(AuthenticationError)
class InsufficientScopeError < AuthenticationError
@@ -67,6 +68,8 @@ module Gitlab
raise ExpiredError
when AccessTokenValidationService::REVOKED
raise RevokedError
+ when AccessTokenValidationService::IMPERSONATION_DISABLED
+ raise ImpersonationDisabled
end
end