StarlingBank.Webhooks (StarlingBank v1.0.0)

Copy Markdown View Source

Webhook management — register, list, and delete feed-item webhook subscriptions to receive real-time push notifications instead of polling, plus signature verification for incoming webhook payloads.

Note: webhook subscriptions are typically managed from the Starling developer portal UI; the management endpoints below are exposed for completeness where available.

Summary

Functions

Lists webhook subscriptions configured for the OAuth client.

Verifies an incoming webhook payload's HMAC-SHA512 signature against the configured webhook secret, using constant-time comparison.

Functions

list(client \\ nil)

@spec list(StarlingBank.Client.t() | keyword() | nil) ::
  {:ok, map()} | {:error, StarlingBank.Error.t()}

Lists webhook subscriptions configured for the OAuth client.

verify_signature(raw_body, signature_header, webhook_secret)

@spec verify_signature(binary(), String.t(), String.t()) :: boolean()

Verifies an incoming webhook payload's HMAC-SHA512 signature against the configured webhook secret, using constant-time comparison.

StarlingBank.Webhooks.verify_signature(raw_body, signature_header, secret)