summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Lopez <fjlopez@gitlab.com>2017-11-17 13:33:21 +0100
committerFrancisco Lopez <fjlopez@gitlab.com>2017-11-17 13:33:21 +0100
commit4188c10c07d7b9bfaee5046ecfcc88cf8cca456b (patch)
treefce91b81fe42eb741fd3087e97a0449ba5efdcbe
parent7f0317917a6684189b1637ea73f90d258e8a72b6 (diff)
downloadgitlab-ce-mk-add-user-rate-limits.tar.gz
Renaming AuthenticationException to AuthenticationErrormk-add-user-rate-limits
-rw-r--r--lib/gitlab/auth/request_authenticator.rb2
-rw-r--r--lib/gitlab/auth/user_auth_finders.rb16
-rw-r--r--spec/lib/gitlab/auth/request_authenticator_spec.rb2
3 files changed, 10 insertions, 10 deletions
diff --git a/lib/gitlab/auth/request_authenticator.rb b/lib/gitlab/auth/request_authenticator.rb
index 4322fb83cdf..46ec040ce92 100644
--- a/lib/gitlab/auth/request_authenticator.rb
+++ b/lib/gitlab/auth/request_authenticator.rb
@@ -17,7 +17,7 @@ module Gitlab
def find_sessionless_user
find_user_from_access_token || find_user_from_rss_token
- rescue Gitlab::Auth::AuthenticationException
+ rescue Gitlab::Auth::AuthenticationError
nil
end
end
diff --git a/lib/gitlab/auth/user_auth_finders.rb b/lib/gitlab/auth/user_auth_finders.rb
index cd497fe1cdb..b4114a3ac96 100644
--- a/lib/gitlab/auth/user_auth_finders.rb
+++ b/lib/gitlab/auth/user_auth_finders.rb
@@ -4,14 +4,14 @@ module Gitlab
# Exceptions
#
- AuthenticationException = Class.new(StandardError)
- MissingTokenError = Class.new(AuthenticationException)
- TokenNotFoundError = Class.new(AuthenticationException)
- ExpiredError = Class.new(AuthenticationException)
- RevokedError = Class.new(AuthenticationException)
- UnauthorizedError = Class.new(AuthenticationException)
-
- class InsufficientScopeError < AuthenticationException
+ AuthenticationError = Class.new(StandardError)
+ MissingTokenError = Class.new(AuthenticationError)
+ TokenNotFoundError = Class.new(AuthenticationError)
+ ExpiredError = Class.new(AuthenticationError)
+ RevokedError = Class.new(AuthenticationError)
+ UnauthorizedError = Class.new(AuthenticationError)
+
+ class InsufficientScopeError < AuthenticationError
attr_reader :scopes
def initialize(scopes)
@scopes = scopes.map { |s| s.try(:name) || s }
diff --git a/spec/lib/gitlab/auth/request_authenticator_spec.rb b/spec/lib/gitlab/auth/request_authenticator_spec.rb
index b7348f5cd78..ffcd90b9fcb 100644
--- a/spec/lib/gitlab/auth/request_authenticator_spec.rb
+++ b/spec/lib/gitlab/auth/request_authenticator_spec.rb
@@ -58,7 +58,7 @@ describe Gitlab::Auth::RequestAuthenticator do
expect(subject.find_sessionless_user).to be_blank
end
- it 'rescue API::APIGuard::AuthenticationException exceptions' do
+ it 'rescue Gitlab::Auth::AuthenticationError exceptions' do
allow_any_instance_of(described_class).to receive(:find_user_from_access_token).and_raise(Gitlab::Auth::UnauthorizedError)
expect(subject.find_sessionless_user).to be_blank