• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sgerrand / ex_granola / 33894672907
100%

Build:
DEFAULT BRANCH: main
Ran 04 Sep 2026 04:21PM UTC
Jobs 1
Files 8
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

04 Sep 2026 04:21PM UTC coverage: 96.094% (-3.9%) from 100.0%
33894672907

push

github

web-flow
feat: support the Granola Webhooks API (#33)

* feat: add Granola.Folders

Lists folders via GET /v1/folders with cursor pagination, plus a lazy
stream/1. Folder IDs are needed to scope webhook endpoints with :folder_ids.

* feat: verify and parse incoming webhook deliveries

Granola.Webhooks.verify_and_parse/4 checks a delivery signature and decodes
the payload into a Granola.Webhooks.Event struct.

Signature verification follows Standard Webhooks: HMAC-SHA256 over
"{webhook-id}.{webhook-timestamp}.{raw body}", keyed with the base64-decoded
signing secret. Comparison is constant time, and timestamps outside a
configurable window (300s by default) are rejected to block replays.

Payloads are decoded with string keys so a remote delivery cannot create
atoms in the node. Unrecognised event types are kept as strings rather than
raising, so a new Granola event type does not break existing handlers.

Adds jason as an explicit dependency. It was already present via req, but
the webhook payload decoder uses it directly.

* feat: manage webhook endpoints

Granola.WebhookEndpoints wraps the /v1/webhook-endpoints resource with
create/2, list/1, update/3 and delete/2.

create/2 accepts a 201, and returns the signing_secret that Granola only
sends once. update/3 sends a PATCH carrying just the fields given, so
folder_ids: [] clears a folder filter while omitting the key leaves it
alone.

* docs: cover folders and webhooks

README gains sections on listing folders, registering an endpoint, handling
a delivery and managing endpoints, including the three things a handler has
to get right: verify the raw body, reply within 15 seconds, and dedupe on
event_id.

CLAUDE.md records the new modules, the OpenAPI spec URL, and the delivery
signing scheme.

* fix: reject signing secrets that decode to an empty key

Base.decode64("") returns {:ok, ""}, so a signing secret of "" or a bare
"whsec_" was accepted and used as a zero-length HMAC key. HMAC takes such a
key without co... (continued)

96 of 101 new or added lines in 5 files covered. (95.05%)

123 of 128 relevant lines covered (96.09%)

20.31 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
91.49
lib/granola/webhooks/signature.ex
1
83.33
lib/granola/webhooks.ex
Jobs
ID Job ID Ran Files Coverage
1 33894672907.1 04 Sep 2026 04:21PM UTC 8
96.09
GitHub Action Run
Source Files on build 33894672907
  • Tree
  • List 8
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #33894672907
  • bee50a73 on github
  • Prev Build on main (#33779448846)
  • Next Build on main (#34115182425)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc