Sha256: e0c9e84c5859412d920f4478f648e021c5355cbc30e4650ecb45e38c7f930763

Contents?: true

Size: 897 Bytes

Versions: 23

Compression:

Stored size: 897 Bytes

Contents

require 'doorkeeper/oauth/client_credentials/creator'
require 'doorkeeper/oauth/client_credentials/issuer'
require 'doorkeeper/oauth/client_credentials/validation'

module Doorkeeper
  module OAuth
    class ClientCredentialsRequest
      include Validations
      include OAuth::RequestConcern

      attr_accessor :issuer, :server, :client, :original_scopes
      attr_reader :response
      alias :error_response :response

      delegate :error, to: :issuer

      def issuer
        @issuer ||= Issuer.new(server, Validation.new(server, self))
      end

      def initialize(server, client, parameters = {})
        @client, @server = client, server
        @response        = nil
        @original_scopes = parameters[:scope]
      end

      def access_token
        issuer.token
      end

      private

      def valid?
        issuer.create(client, scopes)
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
doorkeeper-4.0.0.rc2 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-4.0.0.rc1 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-3.1.0 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-3.0.1 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-2.2.2 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-3.0.0 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-3.0.0.rc2 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-3.0.0.rc1 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-2.2.1 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-2.2.0 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-2.1.4 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-1.4.2 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-2.1.3 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-2.1.2 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-2.1.1 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-2.1.0 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-2.0.1 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-1.4.1 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-2.0.0 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-2.0.0.rc3 lib/doorkeeper/oauth/client_credentials_request.rb