Repository navigation
fix(core): correct Stripe, Discord and Autumn webhook setup prompts #5123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@trigger.dev/core": patch | ||
| --- | ||
|
|
||
| Webhook setup prompts now match each provider's current setup. Stripe webhooks can be set up from the Dashboard by revealing the signing secret there, Discord endpoints verify on the first try because the public key is stored before the Endpoint URL is saved, and Autumn webhooks can be added self-serve without contacting support. |
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -88,6 +88,25 @@ describe("renderWebhookSetupPrompt", () => { | |||||||||||
| expect(prompt).toContain("pass `previousSecretTtlSeconds`"); | ||||||||||||
| }); | ||||||||||||
|
|
||||||||||||
| it("stores an asymmetric source's public key before registering the URL", () => { | ||||||||||||
| const discord = renderWebhookSetupPrompt( | ||||||||||||
|
Comment on lines
+91
to
+92
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Missing regression note for new test The new unit test has no required
Suggested change
Was this helpful? React with 👍 or 👎 to provide feedback. |
||||||||||||
| endpoint({ | ||||||||||||
| source: "discord", | ||||||||||||
| setupPrompt: webhookSetupPrompts.discord ?? null, | ||||||||||||
| verifierArtifact: { kind: "preset", preset: "discord", config: discordVerifierConfig() }, | ||||||||||||
| }), | ||||||||||||
| context | ||||||||||||
| ); | ||||||||||||
| expect(discord).toMatch( | ||||||||||||
| /1\. discord signs deliveries with a key pair\..*before registering the URL\./ | ||||||||||||
| ); | ||||||||||||
| expect(discord).toContain("2. Register the webhook URL with discord"); | ||||||||||||
|
Comment on lines
+100
to
+103
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Key-order test misses key storage If Learn moreThe test claims to guard key-first setup, but its regex does not inspect the part of step one that tells the agent to call Example: Change secretStep to return Recommended fix: Assert that step one contains Was this helpful? React with 👍 or 👎 to provide feedback. |
||||||||||||
|
|
||||||||||||
| const stripe = renderWebhookSetupPrompt(endpoint(), context); | ||||||||||||
| expect(stripe).toContain("1. Register the webhook URL with stripe"); | ||||||||||||
| expect(stripe).toContain("2. stripe issues the signing secret"); | ||||||||||||
| }); | ||||||||||||
|
|
||||||||||||
| it("asks which events to send when nothing subscribes yet", () => { | ||||||||||||
| const prompt = renderWebhookSetupPrompt(endpoint({ routingTargets: [] }), context); | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Custom public-key setup blocked by ordering
When a custom provider reveals its public key upon webhook creation,
firstStepdemands the key before URL registration. Users cannot complete the setup steps in order.Learn more
The SDK accepts arbitrary asymmetric verifier configs through webhooks.custom, and callers can supply provider-specific setup instructions. Some providers disclose the public key only when their webhook is created with a destination URL. For these providers, forcing key storage before URL registration makes the prompt impossible to follow, while the former URL-first order allowed setup. The Discord preset specifically needs the opposite order because it checks a signed PING when the URL is saved.
Example: A caller uses
webhooks.customfor a provider that returns its public key after creating a webhook withhttps://example.test/ingest. The prompt asks for the key in step one, but the user cannot retrieve it until completing step two.Recommended fix: Restrict key-first ordering to providers or artifacts that require pre-registration verification, such as Discord, or allow the source-specific setup instructions to select the ordering. Keep URL-first ordering when the key is available only after creation.
Was this helpful? React with 👍 or 👎 to provide feedback.