Sha256: d42aefe1eadb98ebca6ab7d055e2a5af40160a8c1c7b781e1f06c8b60d31f06b
Contents?: true
Size: 1.22 KB
Versions: 30
Compression:
Stored size: 1.22 KB
Contents
module Aws module Plugins # Makes it possible to conditional sign {Aws::CloudSearchDomain::Client} # requests. When credentials are configured, requests are signed. # When they are omitted, the request is sent anonymously. # # @seahorse.client.option [String] :sigv4_region Only needed when sending # authenticated/signed requests to a Cloud Search domain and the # endpoint does not contain the region name. # class CSDConditionalSigning < Seahorse::Client::Plugin # Adding region as an option to avoid an issue when `Aws.config[:region]` # is populated and the global configuration plugin merges options onto # this client. option(:region) option(:sigv4_region) do |cfg| # extract the region name from the cloud search domain endpoint if cfg.endpoint cfg.endpoint.to_s.split('.')[1] else raise ArgumentError, 'missing required option :endpoint' end end def after_initialize(client) # disable request singing when credentials are not set if client.config.credentials.nil? or !client.config.credentials.set? client.config.signature_version = nil end end end end end
Version data entries
30 entries across 30 versions & 1 rubygems