Commit 4188c10c authored by Francisco Lopez's avatar Francisco Lopez

Renaming AuthenticationException to AuthenticationError

parent 7f031791
......@@ -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
......
......@@ -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 }
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment