Skip to content

feat(webhook-endpoints): Add signing_keys to webhook endpoint responses - #440

Merged
groyoh merged 1 commit into
mainfrom
feat/bil-1020-standard-webhooks-signing-keys
Nov 17, 2026
Merged

groyoh merged 1 commit into
mainfrom
feat/bil-1020-standard-webhooks-signing-keys

Conversation

@lago-claude-ai-agent

@lago-claude-ai-agent lago-claude-ai-agent Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Context

Webhook endpoints can now sign payloads with the Standard Webhooks scheme. The API accepts standard_webhooks as a signature_algo value. It also returns a signing_keys list on the endpoint, with the whsec_... secrets a consumer needs to verify deliveries. Python client users cannot read these keys today, because the response model drops the field.

Description

WebhookEndpointResponse now has an optional signing_keys list. Each item is a new WebhookEndpointSigningKeyResponse with lago_id, secret_key and created_at. The order of the API is kept. Both response models are exported from lago_python_client.models.

The field is optional on purpose. An endpoint using jwt or hmac returns an empty list. A response from a read-only API key, a list call or a destroy call has no signing_keys, and the field is then None. Existing responses still parse.

signature_algo was already a free string, so creating or updating an endpoint with standard_webhooks needed no code change. A test now checks that the value is sent in the request body.

Tests and fixtures cover find, create, update and list. The fixture tests/fixtures/webhook_endpoint_index_standard_webhooks.json is outside the planned files. It was added so the list call is tested with both a signing key endpoint and an empty one.

Agent decisions

  • No verification helper: customers verify Standard Webhooks messages with the official Standard Webhooks libraries and the signing key from signing_keys. Confidence: high.
  • signing_keys is Optional[List[...]], since read-only keys get no field. The item fields are required strings. Confidence: high.
  • signature_algo stays a free Optional[str] and no enum is added. Confidence: high.

The OpenAPI schema and the verification documentation are handled in their own repositories.

Fixes BIL-1020

## Context

Webhook endpoints can now sign payloads with the Standard Webhooks scheme. The v1 API accepts `standard_webhooks` as a `signature_algo` value. It also returns a `signing_keys` list on the endpoint, with the `whsec_...` secrets a consumer needs to verify deliveries. Python client users cannot read these keys today, because the response model drops the field.

## Description

`WebhookEndpointResponse` now has an optional `signing_keys` list. Each item is a new `WebhookEndpointSigningKeyResponse` with `lago_id`, `secret_key` and `created_at`. The order of the API is kept. Both response models are exported from `lago_python_client.models`.

The field is optional on purpose. An endpoint using `jwt` or `hmac` returns an empty list. A response from a read-only API key, a list call or a destroy call has no `signing_keys`, and the field is then `None`. Existing responses still parse.

`signature_algo` was already a free string, so creating or updating an endpoint with `standard_webhooks` needed no code change. A test now checks that the value is sent in the request body.

Tests and fixtures cover find, create, update and list. The fixture `tests/fixtures/webhook_endpoint_index_standard_webhooks.json` is outside the planned files. It was added so the list call is tested with both a signing key endpoint and an empty one.

## Agent decisions

- No verification helper and no README section. The ticket asks for helpers only in clients that already have one for `jwt` or `hmac`, and this client has none (`webhooks.public_key()` only fetches and decodes the RSA key). A README pointer to the `standardwebhooks` library could still be added later. Confidence: high.
- The ticket also asks for v2 webhook endpoints with `expands[]=signing_keys`. This change covers v1 only, because the client sends every request to `api/v1/` and has no v2 support to extend. Confidence: high.
- `signing_keys` is `Optional[List[...]]`, since read-only keys get no field. The item fields are required strings. Confidence: high.
- `signature_algo` stays a free `Optional[str]` and no enum is added. Confidence: high.

The OpenAPI schema and the verification documentation are handled in their own repositories.

Fixes BIL-1020

Signed-off-by: lago-claude-ai-agent[bot] <297187938+lago-claude-ai-agent[bot]@users.noreply.github.com>
@groyoh
groyoh marked this pull request as ready for review November 16, 2026 17:33
@groyoh
groyoh merged commit c4c81da into main Nov 17, 2026
7 checks passed
@groyoh
groyoh deleted the feat/bil-1020-standard-webhooks-signing-keys branch November 17, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant