Module: Ckeditor::Webhook
- Defined in:
- lib/ckeditor/webhook.rb,
lib/ckeditor/webhook/event.rb,
lib/ckeditor/webhook/version.rb
Defined Under Namespace
Classes: Error, Event, InvalidPayload, SignatureVerificationError
Constant Summary collapse
- VERSION =
"0.3.0"
Class Method Summary collapse
-
.construct_event(secret:, payload:, signature:, timestamp:, url:, method: "POST") ⇒ Event
Returns an Event if the webhook signature is valid.
Class Method Details
.construct_event(secret:, payload:, signature:, timestamp:, url:, method: "POST") ⇒ Event
Returns an Event if the webhook signature is valid.
28 29 30 31 32 33 34 |
# File 'lib/ckeditor/webhook.rb', line 28 def construct_event(secret:, payload:, signature:, timestamp:, url:, method: "POST") event = (method: method, url: url, timestamp: , payload: payload) raise SignatureVerificationError if signature != (message: event, secret: secret) Event.new(parse_payload(payload)) end |