Sha256: d6a5a397c27d6a07b5d198313c6afc7b0b15c26f092fd5b310b95218833ed5af

Contents?: true

Size: 355 Bytes

Versions: 1

Compression:

Stored size: 355 Bytes

Contents

class Rack::Attack
  safelist('allow flow webhooks') do |req|
    request_signature = req.env['HTTP_X_FLOW_SIGNATURE']

    next false unless request_signature.present?

    body = req.body.read
    req.body.rewind

    Workarea::FlowIo::WebhookRequestSignature.valid?(
      request_signature: request_signature,
      request_body: body
    )
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
workarea-flow_io-1.2.1 config/initializers/rack_attack.rb