Class: Axn::Webhooks::Request::ParamsResult

Inherits:
Data
  • Object
show all
Defined in:
lib/axn/webhooks/request.rb

Overview

params reflects the request's PRIMARY param source — never a query+form merge, because url (below) already carries the query string. Merging both would double-count query params for URL-signing verifiers (e.g. Twilio's RequestValidator does validate(req.url, req.params, signature), which HMACs the query string once via the url and would HMAC it a second time via params if it were also merged in).

  • form-urlencoded body on a request that carries one (Twilio's SMS/voice POST) -> params = form fields only; the query (if any) is still reachable via url.
  • multipart/form-data body -> same, parsed by Rack (Dropbox Sign posts the whole event as a single json field, and its verifier reads that field twice: Content-MD5 over it, then JSON.parse of it).
  • everything else (GET/HEAD query, JSON POST, etc.) -> params = query string (e.g. the Nylas/Meta GET challenge, read via req.params["challenge"]). GET/HEAD never carry a body, so even a form-urlencoded default Content-Type header on a GET (common on challenge requests) must not shadow the query string with an empty-body parse. Parsed params plus whatever failure produced them, so the caller decides when the failure matters. value is always a Hash.

Instance Attribute Summary collapse

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error

Returns:

  • (Object)

    the current value of error



142
143
144
# File 'lib/axn/webhooks/request.rb', line 142

def error
  @error
end

#valueObject (readonly)

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



142
143
144
# File 'lib/axn/webhooks/request.rb', line 142

def value
  @value
end