-
Notifications
You must be signed in to change notification settings - Fork 560
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
Enforce JSON-RPC response size limits #2201
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2201 +/- ##
=======================================
Coverage 96.58% 96.58%
=======================================
Files 332 332
Lines 7556 7564 +8
Branches 1170 1171 +1
=======================================
+ Hits 7298 7306 +8
Misses 258 258 ☔ View full report in Codecov by Sentry. |
* @param response - The response. | ||
* @returns True if the response is valid, otherwise false. | ||
*/ | ||
export function isValidResponse(response: Record<string, unknown>) { |
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.
You have a test for this function, but codecov is saying these lines are uncovered? 🤔
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.
Yeah, utils.ts
has better coverage in the browser tests and therefore that is chosen when merging the two coverage reports. Not much we can do about this right now 🤷♂️
Co-authored-by: Maarten Zuidhoorn <[email protected]>
02f241e
to
e835981
Compare
Enforces a size limit on JSON-RPC responses from Snaps, throwing an error if the object is larger than 64 MB.
64 MB was chosen because it seems to be the limit set by Chrome for postMessage between the extension and dapps: https://source.chromium.org/chromium/chromium/src/+/main:extensions/renderer/api/messaging/messaging_util.cc;l=65?q=%22Message%20length%20exceeded%20maximum%20allowed%20length%22&ss=chromium