Class: Worldline::Connect::SDK::Webhooks::SignatureValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/worldline/connect/sdk/webhooks/signature_validator.rb

Overview

Validator for webhooks signatures. Thread-safe.

Instance Method Summary collapse

Constructor Details

#initialize(secret_key_store) ⇒ SignatureValidator

Returns a new instance of SignatureValidator.

Raises:

  • (ArgumentError)


12
13
14
15
# File 'lib/worldline/connect/sdk/webhooks/signature_validator.rb', line 12

def initialize(secret_key_store)
  raise ArgumentError if secret_key_store.nil?
  @secret_key_store = secret_key_store
end

Instance Method Details

#validate(body, request_headers) ⇒ Object

Validates incoming request using request headers

Parameters:



21
22
23
# File 'lib/worldline/connect/sdk/webhooks/signature_validator.rb', line 21

def validate(body, request_headers)
  validate_body(body, request_headers)
end