diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2016-12-05 22:58:19 +0530 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2016-12-16 16:29:32 +0530 |
commit | 5becbe2495850923604c71b4c807666ea94819b3 (patch) | |
tree | 1e34fdb5d9e1ce86fc175193ec115b1e2d19741f /lib | |
parent | b303948ff549ce57d3b6985c2c366dfcdc5a2ca3 (diff) | |
download | gitlab-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.rb | 6 |
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 |