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:
authorFrancisco Lopez <fjlopez@gitlab.com>2017-11-17 12:09:56 +0300
committerFrancisco Lopez <fjlopez@gitlab.com>2017-11-17 12:09:56 +0300
commit7f0317917a6684189b1637ea73f90d258e8a72b6 (patch)
tree0284bebb66f663be80933d6b0d41e2b35f0c0e7c /lib/api/api_guard.rb
parentb810f479d55b535b31a723975926762b5ef42cbe (diff)
Changes after rebase
Diffstat (limited to 'lib/api/api_guard.rb')
-rw-r--r--lib/api/api_guard.rb21
1 files changed, 1 insertions, 20 deletions
diff --git a/lib/api/api_guard.rb b/lib/api/api_guard.rb
index 1953a613f1d..9aeebc34525 100644
--- a/lib/api/api_guard.rb
+++ b/lib/api/api_guard.rb
@@ -39,7 +39,7 @@ module API
# Helper Methods for Grape Endpoint
module HelperMethods
- include Gitlab::Utils::StrongMemoize
+ include Gitlab::Auth::UserAuthFinders
def find_current_user!
user = find_user_from_access_token || find_user_from_warden
@@ -50,25 +50,6 @@ module API
user
end
- def access_token
- strong_memoize(:access_token) do
- find_oauth_access_token || find_personal_access_token
- end
- end
-
- def validate_access_token!(scopes: [])
- return unless access_token
-
- case AccessTokenValidationService.new(access_token, request: request).validate(scopes: scopes)
- when AccessTokenValidationService::INSUFFICIENT_SCOPE
- raise InsufficientScopeError.new(scopes)
- when AccessTokenValidationService::EXPIRED
- raise ExpiredError
- when AccessTokenValidationService::REVOKED
- raise RevokedError
- end
- end
-
private
# An array of scopes that were registered (using `allow_access_with_scope`)