Module: HTTPX::Plugins::OAuth

Defined in:
lib/httpx/plugins/oauth.rb

Overview

This plugin adds support for managing an OAuth Session associated with the given session.

The scope of OAuth support is limited to the ‘client_crendentials` and `refresh_token` grants.

gitlab.com/os85/httpx/wikis/OAuth

Defined Under Namespace

Modules: InstanceMethods, OAuthRetries, OptionsMethods Classes: OAuthSession

Constant Summary collapse

SUPPORTED_GRANT_TYPES =
%w[client_credentials refresh_token].freeze
SUPPORTED_AUTH_METHODS =
%w[client_secret_basic client_secret_post].freeze

Class Method Summary collapse

Class Method Details

.extra_options(options) ⇒ Object



25
26
27
# File 'lib/httpx/plugins/oauth.rb', line 25

def extra_options(options)
  options.merge(auth_header_type: "Bearer")
end

.load_dependencies(klass) ⇒ Object



14
15
16
17
# File 'lib/httpx/plugins/oauth.rb', line 14

def load_dependencies(klass)
  require_relative "auth/basic"
  klass.plugin(:auth)
end

.subpluginsObject



19
20
21
22
23
# File 'lib/httpx/plugins/oauth.rb', line 19

def subplugins
  {
    retries: OAuthRetries,
  }
end