module Rack::OAuth2

Constants

VERSION

Public Class Methods

debug() { || ... } click to toggle source
# File lib/rack/oauth2.rb, line 33
def self.debug(&block)
  original = self.debugging?
  self.debugging = true
  yield
ensure
  self.debugging = original
end
debug!() click to toggle source
# File lib/rack/oauth2.rb, line 30
def self.debug!
  self.debugging = true
end
debugging=(boolean) click to toggle source
# File lib/rack/oauth2.rb, line 27
def self.debugging=(boolean)
  @@debugging = boolean
end
debugging?() click to toggle source
# File lib/rack/oauth2.rb, line 24
def self.debugging?
  @@debugging
end
http_client(agent_name = "Rack::OAuth2 ( click to toggle source
# File lib/rack/oauth2.rb, line 42
def self.http_client(agent_name = "Rack::OAuth2 (#{VERSION})", &local_http_config)
  _http_client_ = HTTPClient.new(
    agent_name: agent_name
  )

  # NOTE: httpclient gem seems stopped maintaining root certtificate set, use OS default.
  _http_client_.ssl_config.clear_cert_store
  _http_client_.ssl_config.cert_store.set_default_paths

  http_config.try(:call, _http_client_)
  local_http_config.try(:call, _http_client_) unless local_http_config.nil?
  _http_client_.request_filter << Debugger::RequestFilter.new if debugging?
  _http_client_
end
http_config(&block) click to toggle source
# File lib/rack/oauth2.rb, line 57
def self.http_config(&block)
  @@http_config ||= block
end
logger() click to toggle source
# File lib/rack/oauth2.rb, line 15
def self.logger
  @@logger
end
logger=(logger) click to toggle source
# File lib/rack/oauth2.rb, line 18
def self.logger=(logger)
  @@logger = logger
end
reset_http_config!() click to toggle source
# File lib/rack/oauth2.rb, line 61
def self.reset_http_config!
  @@http_config = nil
end