Class: FaradayMiddleware::AwsSigV4
- Inherits:
-
Object
- Object
- FaradayMiddleware::AwsSigV4
- Defined in:
- lib/fluent/plugin/out_aws-elasticsearch-service.rb
Overview
monkey patch
Instance Method Summary collapse
-
#initialize(app, options = nil) ⇒ AwsSigV4
constructor
A new instance of AwsSigV4.
- #initialize_origin_from_aws_elasticsearch_service_output ⇒ Object
Constructor Details
#initialize(app, options = nil) ⇒ AwsSigV4
Returns a new instance of AwsSigV4.
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
# File 'lib/fluent/plugin/out_aws-elasticsearch-service.rb', line 185 def initialize(app, = nil) super(app) credentials = .fetch(:credentials) service_name = .fetch(:service_name) region = .fetch(:region) @signer = begin if credentials.is_a?(Proc) signer = lambda do Aws::Sigv4::Signer.new(service: service_name, region: region, credentials: credentials.call) end def signer.sign_request(req) self.call.sign_request(req) end signer else Aws::Sigv4::Signer.new(service: service_name, region: region, credentials: credentials) end end @net_http = app.is_a?(Faraday::Adapter::NetHttp) end |
Instance Method Details
#initialize_origin_from_aws_elasticsearch_service_output ⇒ Object
183 |
# File 'lib/fluent/plugin/out_aws-elasticsearch-service.rb', line 183 alias :initialize_origin_from_aws_elasticsearch_service_output :initialize |