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.
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
# File 'lib/fluent/plugin/out_aws-elasticsearch-service.rb', line 208 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
206 |
# File 'lib/fluent/plugin/out_aws-elasticsearch-service.rb', line 206 alias :initialize_origin_from_aws_elasticsearch_service_output :initialize |