Sha256: aa166eead5d20fd81f90182666081dc9293e916b95805e3a77752bbaeea4c4ae
Contents?: true
Size: 1.06 KB
Versions: 9
Compression:
Stored size: 1.06 KB
Contents
require 'doorkeeper/validations' require 'doorkeeper/oauth/scopes' require 'doorkeeper/oauth/helpers/scope_checker' module Doorkeeper module OAuth class ClientCredentialsRequest < BaseRequest class Validation include Validations include OAuth::Helpers validate :client, error: :invalid_client validate :scopes, error: :invalid_scope def initialize(server, request) @server, @request, @client = server, request, request.client validate end private def validate_client @client.present? end def validate_scopes return true unless @request.scopes.present? application_scopes = if @client.present? @client.application.scopes else '' end ScopeChecker.valid?( @request.scopes.to_s, @server.scopes, application_scopes ) end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems