summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2016-12-05 22:58:19 +0530
committerTimothy Andrew <mail@timothyandrew.net>2016-12-16 16:29:32 +0530
commit5becbe2495850923604c71b4c807666ea94819b3 (patch)
tree1e34fdb5d9e1ce86fc175193ec115b1e2d19741f /lib
parentb303948ff549ce57d3b6985c2c366dfcdc5a2ca3 (diff)
downloadgitlab-ce-5becbe2495850923604c71b4c807666ea94819b3.tar.gz
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')
-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