Class: AwsV4Signer
- Inherits:
-
Faraday::Middleware
- Object
- Faraday::Middleware
- AwsV4Signer
- Defined in:
- lib/logstash/outputs/amazon_es/aws_v4_signer_impl.rb
Defined Under Namespace
Classes: Request
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = nil) ⇒ AwsV4Signer
constructor
A new instance of AwsV4Signer.
- #signer ⇒ Object
Constructor Details
#initialize(app, options = nil) ⇒ AwsV4Signer
Returns a new instance of AwsV4Signer.
39 40 41 42 43 |
# File 'lib/logstash/outputs/amazon_es/aws_v4_signer_impl.rb', line 39 def initialize(app, = nil) super(app) @options = @net_http = app.is_a?(Faraday::Adapter::NetHttp) end |
Instance Method Details
#call(env) ⇒ Object
45 46 47 48 49 50 |
# File 'lib/logstash/outputs/amazon_es/aws_v4_signer_impl.rb', line 45 def call(env) normalize_for_net_http!(env) req = Request.new(env) signer().sign(req) @app.call(env) end |
#signer ⇒ Object
32 33 34 35 36 37 |
# File 'lib/logstash/outputs/amazon_es/aws_v4_signer_impl.rb', line 32 def signer credentials = @options.fetch(:credentials) service_name = @options.fetch(:service_name) region = @options.fetch(:region) Aws::Signers::V4.new(credentials, service_name, region) end |