Sha256: 710c781889aa570415b626deb9de42632c032bf8169f8e16caef627f61bb3042

Contents?: true

Size: 546 Bytes

Versions: 3

Compression:

Stored size: 546 Bytes

Contents

require "webmachine"
require "pact_broker/api/resources/authentication"

module PactBroker
  module Diagnostic
    module Resources
      class BaseResource < Webmachine::Resource

        include PactBroker::Api::Resources::Authentication

        def is_authorized?(authorization_header)
          authenticated?(self, authorization_header)
        end

        def forbidden?
          return false if PactBroker.configuration.authorize.nil?
          !PactBroker.configuration.authorize.call(self, {})
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pact_broker-2.82.0 lib/pact_broker/diagnostic/resources/base_resource.rb
pact_broker-2.81.0 lib/pact_broker/diagnostic/resources/base_resource.rb
pact_broker-2.80.0 lib/pact_broker/diagnostic/resources/base_resource.rb