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:
authorTimothy Andrew <mail@timothyandrew.net>2016-12-05 20:28:19 +0300
committerTimothy Andrew <mail@timothyandrew.net>2016-12-16 13:59:32 +0300
commit5becbe2495850923604c71b4c807666ea94819b3 (patch)
tree1e34fdb5d9e1ce86fc175193ec115b1e2d19741f /lib/gitlab
parentb303948ff549ce57d3b6985c2c366dfcdc5a2ca3 (diff)
Rename the `token_has_scope?` method.
`valid_api_token?` is a better name. Scopes are just (potentially) one facet of a "valid" token.
Diffstat (limited to 'lib/gitlab')
-rw-r--r--lib/gitlab/auth.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/auth.rb b/lib/gitlab/auth.rb
index 2879a4d2f5d..8dda65c71ef 100644
--- a/lib/gitlab/auth.rb
+++ b/lib/gitlab/auth.rb
@@ -111,14 +111,14 @@ module Gitlab
end
def valid_oauth_token?(token)
- token && token.accessible? && token_has_scope?(token)
+ token && token.accessible? && valid_api_token?(token)
end
def valid_personal_access_token?(token, user)
- token && token.user == user && token_has_scope?(token)
+ token && token.user == user && valid_api_token?(token)
end
- def token_has_scope?(token)
+ def valid_api_token?(token)
AccessTokenValidationService.new(token).include_any_scope?(['api'])
end