Class: Aws::Plugins::BearerAuthorization Private

Inherits:
Seahorse::Client::Plugin show all
Defined in:
lib/aws-sdk-core/plugins/bearer_authorization.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Deprecated - does not look at new traits like ‘auth` and `unsignedPayload` Necessary to exist after endpoints 2.0 for old service clients + new core

Defined Under Namespace

Classes: Handler

Instance Method Summary collapse

Methods inherited from Seahorse::Client::Plugin

#add_options, #after_initialize, after_initialize, after_initialize_hooks, before_initialize, #before_initialize, before_initialize_hooks, handlers, literal, option, options

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response, #handler_for, #new_handler

Instance Method Details

#add_handlers(handlers, cfg) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/aws-sdk-core/plugins/bearer_authorization.rb', line 36

def add_handlers(handlers, cfg)
  bearer_operations =
    if cfg.api.['signatureVersion'] == 'bearer'
      # select operations where authtype is either not set or is bearer
      cfg.api.operation_names.select do |o|
        !cfg.api.operation(o)['authtype'] || cfg.api.operation(o)['authtype'] == 'bearer'
      end
    else # service is not bearer auth
      # select only operations where authtype is explicitly bearer
      cfg.api.operation_names.select do |o|
        cfg.api.operation(o)['authtype'] == 'bearer'
      end
    end
  handlers.add(Handler, step: :sign, operations: bearer_operations)
end