-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Security Provider cleanup #19694
Security Provider cleanup #19694
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Codecov Report
@@ Coverage Diff @@
## develop #19694 +/- ##
===========================================
- Coverage 70.79% 70.79% -0.00%
===========================================
Files 988 989 +1
Lines 38366 38350 -16
Branches 10042 10022 -20
===========================================
- Hits 27161 27149 -12
+ Misses 11205 11201 -4
|
Builds ready [b5143b4]
Page Load Metrics (1924 ± 102 ms)
Bundle size diffs
|
- util fn returns true if response is not verified and flagged
and support undefined param
- no logic changes
Builds ready [511c077]
Page Load Metrics (1651 ± 57 ms)
Bundle size diffs
|
SECURITY_PROVIDER_MESSAGE_SEVERITIES.NOT_MALICIOUS) || | ||
(txData?.securityProviderResponse && | ||
Object.keys(txData.securityProviderResponse).length === 0) ? ( | ||
{isSuspiciousResponse(txData?.securityProviderResponse) && ( |
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.
🙌🏿
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.
Looks good to me
<SecurityProviderBannerMessage | ||
securityProviderResponse={txData.securityProviderResponse} | ||
/> | ||
) : null} | ||
)} |
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.
Another approach could be moving this condition isSuspiciousResponse(txData?.securityProviderResponse)
inside SecurityProviderBannerMessage
component.
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.
I like this suggestion. We can apply it to the new security provider code
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.
Nice cleanup 👍
Explanation
no logic updates. just refactoring the OpenSea security provider logic.
The OpenSea security provider is planned to be deprecated and replaced. Cleaning the code a little will help us implement the new security provider and potentially help us maintain both as we transition.
isSuspiciousSecurityProviderResponse
SECURITY_PROVIDER_MESSAGE_SEVERITIES
constant to a newshared/constants
fileSECURITY_PROVIDER_MESSAGE_SEVERITIES
->SECURITY_PROVIDER_MESSAGE_SEVERITY
Affected Components:
--
Fixes: #19741
Relates to: /~https://github.com/MetaMask/MetaMask-planning/issues/558
Relates to: #17662
Screenshots/Screencaps
Before
After
Manual Testing Steps
Pre-merge author checklist
Pre-merge reviewer checklist
If further QA is required (e.g. new feature, complex testing steps, large refactor), add the
Extension QA Board
label.In this case, a QA Engineer approval will be be required.