class Aws::Plugins::BearerAuthorization

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

Public Instance Methods

add_handlers(handlers, cfg) click to toggle source
# File lib/aws-sdk-core/plugins/bearer_authorization.rb, line 36
def add_handlers(handlers, cfg)
  bearer_operations =
    if cfg.api.metadata['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