Repository navigation
feat(webhook-endpoints): Add signing_keys to webhook endpoint responses - #440
Merged
Merged
Conversation
## 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
approved these changes
Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Webhook endpoints can now sign payloads with the Standard Webhooks scheme. The API accepts
standard_webhooksas asignature_algovalue. It also returns asigning_keyslist on the endpoint, with thewhsec_...secrets a consumer needs to verify deliveries. Python client users cannot read these keys today, because the response model drops the field.Description
WebhookEndpointResponsenow has an optionalsigning_keyslist. Each item is a newWebhookEndpointSigningKeyResponsewithlago_id,secret_keyandcreated_at. The order of the API is kept. Both response models are exported fromlago_python_client.models.The field is optional on purpose. An endpoint using
jwtorhmacreturns an empty list. A response from a read-only API key, a list call or a destroy call has nosigning_keys, and the field is thenNone. Existing responses still parse.signature_algowas already a free string, so creating or updating an endpoint withstandard_webhooksneeded 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.jsonis 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
signing_keys. Confidence: high.signing_keysisOptional[List[...]], since read-only keys get no field. The item fields are required strings. Confidence: high.signature_algostays a freeOptional[str]and no enum is added. Confidence: high.The OpenAPI schema and the verification documentation are handled in their own repositories.
Fixes BIL-1020