Sha256: dcfed4c9e91a9effb931f73c6fc178a97d1975afb6ac6c045b881735e860e8c1

Contents?: true

Size: 745 Bytes

Versions: 19

Compression:

Stored size: 745 Bytes

Contents

# frozen_string_literal: true

module Doorkeeper
  module OAuth
    class ClientCredentialsRequest < BaseRequest
      attr_reader :client, :original_scopes, :response

      alias error_response response

      delegate :error, to: :issuer

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

      def access_token
        issuer.token
      end

      def issuer
        @issuer ||= ClientCredentials::Issuer.new(
          server,
          ClientCredentials::Validator.new(server, self),
        )
      end

      private

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

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
doorkeeper-5.6.6 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-5.6.5 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-5.6.4 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-5.6.3 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-5.6.2 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-5.6.1 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-5.6.0 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-5.6.0.rc2 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-5.6.0.rc1 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-5.5.4 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-5.5.3 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-5.5.2 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-5.5.1 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-5.5.0 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-5.5.0.rc2 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-5.5.0.rc1 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-5.4.0 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-5.4.0.rc2 lib/doorkeeper/oauth/client_credentials_request.rb
doorkeeper-5.4.0.rc1 lib/doorkeeper/oauth/client_credentials_request.rb