Class: OpenLoam::WebhookEndpoint

Inherits:
TenantRecord
  • Object
show all
Defined in:
app/models/open_loam/webhook_endpoint.rb

Overview

Where one tenant wants its domain events delivered. event_pattern uses the same rule as OpenLoam::Events.subscribe — a trailing dot is a domain prefix ("rental."), anything else is an exact event name.

The secret signs every delivery (X-OpenLoam-Signature), so a receiver can tell a real call from a forged one.

Instance Method Summary collapse

Instance Method Details

#matches?(event_name) ⇒ Boolean

One matcher, shared with the event bus, so "rental." means the same thing to a subscriber and to a webhook.

Returns:

  • (Boolean)


27
28
29
# File 'app/models/open_loam/webhook_endpoint.rb', line 27

def matches?(event_name)
  OpenLoam::Events.pattern_matches?(event_pattern, event_name)
end