summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFrancisco Lopez <fjlopez@gitlab.com>2017-11-07 16:13:00 +0100
committerFrancisco Lopez <fjlopez@gitlab.com>2017-11-17 10:00:48 +0100
commit470b5dc32633cd4ec873e655ac6a70011c835e17 (patch)
tree7cf6a5df4e76b9ff00d323390cd41260aabdb9a3 /lib
parentc491b9505ad9992b1e939c9ba858db9d4f8cc090 (diff)
downloadgitlab-ce-470b5dc32633cd4ec873e655ac6a70011c835e17.tar.gz
Updated refactor and pushing to see if test fails
Diffstat (limited to 'lib')
-rw-r--r--lib/api/api_guard.rb2
-rw-r--r--lib/gitlab/auth/user_auth_finders.rb34
2 files changed, 18 insertions, 18 deletions
diff --git a/lib/api/api_guard.rb b/lib/api/api_guard.rb
index 0a93e71858e..66ad2b77f75 100644
--- a/lib/api/api_guard.rb
+++ b/lib/api/api_guard.rb
@@ -72,8 +72,6 @@ module API
end
end
- private
-
def raise_unauthorized_error!
raise UnauthorizedError
end
diff --git a/lib/gitlab/auth/user_auth_finders.rb b/lib/gitlab/auth/user_auth_finders.rb
index 2f4aeff14ac..d1f5bf84873 100644
--- a/lib/gitlab/auth/user_auth_finders.rb
+++ b/lib/gitlab/auth/user_auth_finders.rb
@@ -19,22 +19,6 @@ module Gitlab
user
end
- def private_token
- request.params[:private_token].presence ||
- request.headers['PRIVATE-TOKEN'].presence
- end
-
- def find_user_by_authentication_token(token_string)
- User.find_by_authentication_token(token_string)
- end
-
- def find_user_by_personal_access_token(token_string)
- access_token = PersonalAccessToken.find_by_token(token_string)
- return unless access_token
-
- find_user_by_access_token(access_token)
- end
-
def find_user_by_rss_token
return unless request.path.ends_with?('atom') || request.format.atom?
@@ -55,6 +39,24 @@ module Gitlab
find_user_by_access_token(access_token)
end
+ private
+
+ def private_token
+ request.params[:private_token].presence ||
+ request.headers['PRIVATE-TOKEN'].presence
+ end
+
+ def find_user_by_authentication_token(token_string)
+ User.find_by_authentication_token(token_string)
+ end
+
+ def find_user_by_personal_access_token(token_string)
+ access_token = PersonalAccessToken.find_by_token(token_string)
+ return unless access_token
+
+ find_user_by_access_token(access_token)
+ end
+
def find_oauth_access_token
return @oauth_access_token if defined?(@oauth_access_token)