Sha256: fe55109cf9cbf186b87eea0cb977b87fc433a8a7c39124da5992df6f7d9bff06
Contents?: true
Size: 676 Bytes
Versions: 8
Compression:
Stored size: 676 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 unless PactBroker.configuration.authorization_configured? !PactBroker.configuration.authorize.call(self, {}) end def base_url request.env["pactbroker.base_url"] || request.base_uri.to_s.chomp("/") end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems