Commit 5becbe24 authored by Timothy Andrew's avatar Timothy Andrew

Rename the `token_has_scope?` method.

`valid_api_token?` is a better name. Scopes are just (potentially) one facet of
a "valid" token.
parent b303948f
...@@ -111,14 +111,14 @@ module Gitlab ...@@ -111,14 +111,14 @@ module Gitlab
end end
def valid_oauth_token?(token) def valid_oauth_token?(token)
token && token.accessible? && token_has_scope?(token) token && token.accessible? && valid_api_token?(token)
end end
def valid_personal_access_token?(token, user) def valid_personal_access_token?(token, user)
token && token.user == user && token_has_scope?(token) token && token.user == user && valid_api_token?(token)
end end
def token_has_scope?(token) def valid_api_token?(token)
AccessTokenValidationService.new(token).include_any_scope?(['api']) AccessTokenValidationService.new(token).include_any_scope?(['api'])
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment