Exception: Mercadopago::Webhook::InvalidWebhookSignatureError
- Inherits:
-
StandardError
- Object
- StandardError
- Mercadopago::Webhook::InvalidWebhookSignatureError
- Defined in:
- lib/mercadopago/webhook/validator.rb
Overview
Error raised by Validator.validate when a webhook signature cannot be confirmed as originating from MercadoPago. Carries enough context for structured logging without exposing internal details in the HTTP response body.
Instance Attribute Summary collapse
-
#reason ⇒ Symbol
readonly
One of the SignatureFailureReason constants.
-
#request_id ⇒ String?
readonly
X-request-id header value, when available.
-
#timestamp ⇒ String?
readonly
tsvalue extracted from the signature header.
Instance Method Summary collapse
-
#initialize(reason, request_id: nil, timestamp: nil) ⇒ InvalidWebhookSignatureError
constructor
A new instance of InvalidWebhookSignatureError.
Constructor Details
#initialize(reason, request_id: nil, timestamp: nil) ⇒ InvalidWebhookSignatureError
Returns a new instance of InvalidWebhookSignatureError.
57 58 59 60 61 62 |
# File 'lib/mercadopago/webhook/validator.rb', line 57 def initialize(reason, request_id: nil, timestamp: nil) super("Invalid webhook signature: #{reason}") @reason = reason @request_id = request_id @timestamp = end |
Instance Attribute Details
#reason ⇒ Symbol (readonly)
Returns one of the SignatureFailureReason constants.
48 49 50 |
# File 'lib/mercadopago/webhook/validator.rb', line 48 def reason @reason end |
#request_id ⇒ String? (readonly)
Returns x-request-id header value, when available.
50 51 52 |
# File 'lib/mercadopago/webhook/validator.rb', line 50 def request_id @request_id end |
#timestamp ⇒ String? (readonly)
Returns ts value extracted from the signature header.
52 53 54 |
# File 'lib/mercadopago/webhook/validator.rb', line 52 def @timestamp end |