wallet
wallet copied to clipboard
feat(OFAC compliance): Block Sanctioned Countries (RET-343)
Description
Blocks 4 sanctioned countries
Cuba: CU Iran: IR North Korea: KP Syria: SY

Other changes
N/A
Tested
With iOS emulator
How others should test
With iOS emulator
Related issues
- https://linear.app/valora/issue/RET-343/block-sanctioned-countries-for-ofac-compliance-346
Backwards compatibility
Yes
RET-343 Block Sanctioned Countries for OFAC compliance #346
Description
Block Cuba, Iran, North Korea, and Syria IP's from using the Wallet. Blocking the cloud functions from working on these IP's seems sufficient to disable the wallet.
First step:
- create a new full-screen screen in the app (repurpose the design for generic app errors)
- for users in the above geo's, display this screen
- should say something like "sorry, Valora is not support in your location"
- use the user location cloud function to determine geo
Next steps (not in scope for this ticket)
Some options include:
- Setting up Cloudflare with Google Cloud Platform in front of our Google Cloud Resources.
- Will require an enterprise account with Cloudflare.
- * Setting up Cloud Load Balancing and Google Cloud Armor for Google Cloud Resources.
- Work through the Load balancer decision tree and try the selected load balancer for free, before contacting sales.
- Google Cloud Armor has the desired IP-based and geo-based access control.
Codecov Report
Merging #2793 (d310736) into main (568ef28) will increase coverage by
0.00%
. The diff coverage is88.88%
.
:exclamation: Current head d310736 differs from pull request most recent head 807ebd8. Consider uploading reports for the commit 807ebd8 to get more accurate results
@@ Coverage Diff @@
## main #2793 +/- ##
=======================================
Coverage 79.84% 79.85%
=======================================
Files 608 608
Lines 22017 22022 +5
Branches 4010 4012 +2
=======================================
+ Hits 17580 17586 +6
+ Misses 4386 4385 -1
Partials 51 51
Impacted Files | Coverage Δ | |
---|---|---|
src/home/CashInBottomSheet.tsx | 97.14% <ø> (ø) |
|
src/home/WalletHome.tsx | 97.82% <75.00%> (-1.04%) |
:arrow_down: |
src/config.ts | 97.40% <100.00%> (ø) |
|
src/navigator/Screens.tsx | 100.00% <100.00%> (ø) |
|
src/utils/countryFeatures.ts | 100.00% <100.00%> (ø) |
|
src/tokens/utils.ts | 97.05% <0.00%> (-2.95%) |
:arrow_down: |
src/localCurrency/consts.ts | 100.00% <0.00%> (ø) |
|
src/web3/saga.ts | 80.80% <0.00%> (+3.03%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update eb38639...807ebd8. Read the comment docs.
Tested using an Android 12 Device with a VPN.
@kathaypacific @jean - since there's been quite a few changes since the approval I thought another look would be good. I am not sure why 9a5cc1d2928bcfe83bee67d9f837be9aac36057e was needed to make the tests pass.
although not sure why WalletHome would be mounted anyway :| if it's just racing the WalletHome rendering and determining the user country, having the hack in the navigator might also show the cash in bottom sheet? not sure what is best, i'm also okay with the hack in the navigator (but it does feel intrusive to have it there, it's so global...)
Yes in most cases WalletHome
will not be mounted.
It's only for users switching from a non-sanctionned to a sanctionned country that it can happen.
@jeanregisser I had not pushed my change to shouldShowCashInBottomSheet
prior to merging. I think it's ok to leave as is since it's just an additional check, but it can be removed.
// If user is in a sanctioned country do not show the cash in bottom sheet
if (userInSanctionedCountry) {
return false
}
Hey @MuckT we have verified the above task on latest Android Internal Release build V 1.40.1 and latest iOS Test Flight Release build V 1.40.1 and below is our observation
Observation : We are able to proceed to phone number page after applying neighboring countries VPN as instructed in the weekly meet
1] For Cuba - used Mexico VPN 2] For Iran - used Turkey VPN 3] For Syria - used Turkey VPN 4] For North Korea - Used Seoul VPN
Thanks.!!