Skip to content

Commit

Permalink
merge(#28): fix: add missing app urls
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubsta authored Jan 11, 2023
2 parents c10f9e4 + f0ddcf2 commit d18efba
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
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"
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

0 comments on commit d18efba

Please sign in to comment.