Sha256: 501d9703e1527354ff253fae83d2543929d1a4a10e89962ac8665a2bfd988073

Contents?: true

Size: 448 Bytes

Versions: 2

Compression:

Stored size: 448 Bytes

Contents

# frozen_string_literal: true

# Request middleware that performs HMAC request signing
class Ey::Hmac::Rack
  attr_reader :key_id, :key_secret, :options

  def initialize(app, key_id, key_secret, options = {})
    @app = app
    @key_id = key_id
    @key_secret = key_secret
    @options = options
  end

  def call(env)
    Ey::Hmac.sign!(env, key_id, key_secret, { adapter: Ey::Hmac::Adapter::Rack }.merge(options))

    @app.call(env)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ey-hmac-2.4.0 lib/ey-hmac/rack.rb
ey-hmac-2.3.1 lib/ey-hmac/rack.rb