-
Notifications
You must be signed in to change notification settings - Fork 2.7k
fix(apps/web): removed deprecated zod params. #2814
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
Open
zhyd1997
wants to merge
8
commits into
dubinc:main
Choose a base branch
from
zhyd1997:fix/issue-2456-1757130654
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+6
−10
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
47da64c
fix(apps/web): removed deprecated zod params.
zhyd1997 67db4e6
refactor(apps/web): remove `workspaceId` from partner profile analyti…
zhyd1997 74acf31
refactor(apps/web): remove unused fields from payout schemas
zhyd1997 ad62001
fix(apps/web): address TypeScript errors in analytics route handling
zhyd1997 c6d0a97
refactor(apps/web): remove unused `id` field from bulk update links s…
zhyd1997 4ee07ca
fix(apps/web): add TypeScript error suppression for HMAC signature ge…
zhyd1997 2b00c3b
refactor(apps/web): remove unused `groupBy` field from partner events…
zhyd1997 539b3b0
refactor(apps/web): remove unused `projectId` field from create partn…
zhyd1997 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ export const POST = async (req: Request) => { | |
// Need to base64 decode the secret | ||
const secretBytes = Buffer.from(secret.split("_")[1], "base64"); | ||
const signature = crypto | ||
// @ts-expect-error FIXME | ||
.createHmac("sha256", secretBytes) | ||
.update(signedContent) | ||
.digest("base64"); | ||
Comment on lines
+23
to
26
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. 🛠️ Refactor suggestion Remove ts-expect-error; use Node crypto explicitly and mark runtime. TypeScript is likely resolving
-import crypto from "crypto";
+import { createHmac, timingSafeEqual } from "node:crypto";
+export const runtime = "nodejs";
...
- const signature = crypto
- // @ts-expect-error FIXME
- .createHmac("sha256", secretBytes)
+ const signature = createHmac("sha256", secretBytes)
.update(signedContent)
.digest("base64"); Also applies to: 2-2 🤖 Prompt for AI Agents
|
||
|
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
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
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
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
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
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
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.
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.
🛠️ Refactor suggestion
Harden secret decoding; current split can throw.
secret.split("_")[1]
can beundefined
if the format changes, causing a 500. Validate before decoding.📝 Committable suggestion
🤖 Prompt for AI Agents