Skip to content
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

fix: add missing app urls #28

Merged
merged 1 commit into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demo/src/main/java/ramp/network/demo/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class MainActivity : AppCompatActivity() {
val config = Config(
hostLogoUrl = "https://ramp.network/assets/images/Logo.svg",
hostAppName = "My App",
url = "https://ri-widget-dev2.firebaseapp.com",
url = "https://app.dev.ramp-network.org",
hostApiKey = "3qncr4yvxfpro6endeaeu6npkh8qc23e9uadtazq",
enabledFlows = setOf(Flow.OFFRAMP, Flow.ONRAMP)
)
Expand Down
4 changes: 2 additions & 2 deletions rampsdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ android {
minSdkVersion 21
targetSdkVersion 32
versionCode 15
versionName "2.0.0"
versionName "2.0.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
Expand Down Expand Up @@ -86,7 +86,7 @@ afterEvaluate {
from components.release
groupId = 'com.github.RampNetwork'
artifactId = 'ramp-sdk-android'
version = '2.0.0'
version = '2.0.1'
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ object UrlSafeChecker {
private val listOfSafeUrls = listOf(
"https://ri-widget-dev2.firebaseapp.com",
"https://ri-widget-staging.firebaseapp.com",
"https://buy.ramp.network"
"https://buy.ramp.network",
"https://app.dev.ramp-network.org",
"https://app.demo.ramp.network",
"https://app.ramp.network"
)
private val listOfSafeRegex = listOf("^https://ri-widget-dev-(\\d+)\\.firebaseapp\\.com$")
private val listOfSafeRegex = listOf("^https://ri-widget-dev-(\\d+)\\.firebaseapp\\.com$", "^https://app.(\\d+)\\.dev\\.ramp-network\\.org")

fun isUrlSafe(url: String) = checkStaticUrls(url) || checkRegexList(url)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,22 @@ internal class UrlSafeCheckerTest {
val safeUrl3 = "https://buy.ramp.network"
val safeUrl4 = "https://ri-widget-dev-5.firebaseapp.com"
val safeUrl5 = "https://ri-widget-dev-42.firebaseapp.com"
val safeUrl6 = "https://app.33.dev.ramp-network.org"
jakubsta marked this conversation as resolved.
Show resolved Hide resolved
val safeUrl7 = "https://app.dev.ramp-network.org"
val safeUrl8 = "https://app.demo.ramp.network"
val safeUrl9 = "https://app.ramp.network"


Assertions.assertAll(
{ Assertions.assertTrue(UrlSafeChecker.isUrlSafe(safeUrl1)) },
{ Assertions.assertTrue(UrlSafeChecker.isUrlSafe(safeUrl2)) },
{ Assertions.assertTrue(UrlSafeChecker.isUrlSafe(safeUrl3)) },
{ Assertions.assertTrue(UrlSafeChecker.isUrlSafe(safeUrl4)) },
{ Assertions.assertTrue(UrlSafeChecker.isUrlSafe(safeUrl5)) }
{ Assertions.assertTrue(UrlSafeChecker.isUrlSafe(safeUrl5)) },
{ Assertions.assertTrue(UrlSafeChecker.isUrlSafe(safeUrl6)) },
{ Assertions.assertTrue(UrlSafeChecker.isUrlSafe(safeUrl7)) },
{ Assertions.assertTrue(UrlSafeChecker.isUrlSafe(safeUrl8)) },
{ Assertions.assertTrue(UrlSafeChecker.isUrlSafe(safeUrl9)) }
)
}

Expand Down