diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2016-12-05 20:28:19 +0300 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2016-12-16 13:59:32 +0300 |
commit | 5becbe2495850923604c71b4c807666ea94819b3 (patch) | |
tree | 1e34fdb5d9e1ce86fc175193ec115b1e2d19741f | |
parent | b303948ff549ce57d3b6985c2c366dfcdc5a2ca3 (diff) |
Rename the `token_has_scope?` method.
`valid_api_token?` is a better name. Scopes are just (potentially) one facet of
a "valid" token.
-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 |