-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Move CICO provider url composition server-side #74
Conversation
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.
Thanks! Great changes overall.
However biggest security concern is about returning some private keys to the client.
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 great, the code on valora-auth
is very tidy :)
#!/usr/bin/env bash | ||
|
||
firebase functions:config:set \ | ||
transak.url_staging=$(grep TRANSAK_URL_STAGING .env | cut -d '=' -f 2-) \ |
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.
Not really necessary but we could have a bash function that receives the env variable name as parameter and runs grep $1 .env | cut -d '=' -f 2-
and call it in all these lines to make them slightly more readable.
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.
Cool! Couple of additional comments.
Also wondering if we should find a different name for valora-auth
that doesn't contain valora.
i.e. to be more in line with the other services names we have and given we've put all Valora branding into a private repo.
@jeanregisser I've renamed it to |
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.
Thanks! 👍
Left some optional comments, but since this is working and looks good relative to security, I'm approving 😄
firebase functions:config:set \ | ||
transak.public_key=$(grep TRANSAK_PUBLIC_KEY_STAGING .env | cut -d '=' -f 2-) \ | ||
transak.private_key=$(grep TRANSAK_PRIVATE_KEY_STAGING .env | cut -d '=' -f 2-) \ | ||
ramp.public_key=$(grep RAMP_PUBLIC_KEY_STAGING .env | cut -d '=' -f 2-) \ | ||
moonpay.public_key=$(grep MOONPAY_PUBLIC_KEY_STAGING .env | cut -d '=' -f 2-) \ | ||
moonpay.private_key=$(grep MOONPAY_PRIVATE_KEY_STAGING .env | cut -d '=' -f 2-) \ |
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.
nit: there's a way to import dotenv variables in a single command and also slightly more robustly (handles no quotes, single and double quotes) that we're using in our run_app.sh
script https://github.com/celo-org/wallet/blob/4e6cc3a42d654fa072eccb79e6b836a44b123f7d/packages/mobile/scripts/run_app.sh#L42-L44
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.
Leaving this somewhat manual for now because I couldn't figure out how to properly nest provider specific variables (e.g., do moonpay.public_key
instead of moonpay_public_key
) and didn't want to crowd the env namesapce
Hi @tarikbellamine can you give more information to test this task. Thanks! |
Hi @Celoqa! The way to test this is to see if the WebView or InAppBrowser loads correctly for each cash-in option. For example, if you select "MoonPay", then it should load the MoonPay url in app. If there is a failure, you will see that there is a loading indicator going on forever when you select an option. |
Hi @tarikbellamine Thank you so much for giving more information about this task. Selecting MoonPay:
Selecting Simplex:
Selecting Ramp:
Selecting Transak:
Can you please let us know if we need to test anything else in this task. |
That's all. Thanks! |
Description
Moving all provider API keys server-side for better security and ease of future key rotation.
Other changes
ProviderOptionsScreen
to dry up codeTested
Manually
Related issues
Backwards compatibility
Yes