fix(webhooks): authorize credential references on webhook upsert - #7800
Open
waleedlatif1 wants to merge 4 commits into
Open
fix(webhooks): authorize credential references on webhook upsert#7800waleedlatif1 wants to merge 4 commits into
waleedlatif1 wants to merge 4 commits into
Conversation
POST /api/webhooks persisted client-supplied providerConfig verbatim, while subscription handlers and pollers resolve providerConfig.credentialId by id alone and mint tokens as the credential's owner. Authorize credentialId for the acting user within the workflow's workspace before subscribing or saving, require it to be a literal id, and never accept a client-supplied userId, which the polling token resolver falls back to.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
|
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
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.
Summary
POST /api/webhookssaved client-suppliedproviderConfigverbatim; subscription handlers and pollers resolveproviderConfig.credentialIdby id alone and mint tokens as the credential's ownercredentialIdfor the acting user within the workflow's workspace (authorizeCredentialUseForAuth) before any external subscription is created or the row is saved — 403 otherwisecredentialIdto be a literal id (400), since the row stores the unresolved text rather than the env-resolved valueproviderConfig.userId, which the polling token resolver falls back to; re-saves keep the server-set valuelib/webhooks/deploy.ts) already validates credentials and is unchangedType of Change
Testing
userId, re-save keeps stored credential/userId— the four refusal/preservation tests fail against the previous routelib/webhooks+ route suites passing, type-check,bun run lint,check:audits(46), block registry, docs manifestChecklist