Skip to content
Draft
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
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@
<data android:scheme="https" />
<data android:host="bitwarden.com" />
<data android:host="bitwarden.eu" />
<data android:host="bitwarden.pw" />
<data android:pathPattern="/duo-callback" />
<data android:pathPattern="/sso-callback" />
<data android:pathPattern="/webauthn-callback" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ private fun EnvironmentUrlDataJson.authTabData(
kind: String,
): AuthTabData = when (this.environmentRegion) {
EnvironmentRegion.UNITED_STATES -> {
// TODO: PM-26577 Update this to use a "HttpsScheme"
AuthTabData.CustomScheme(
callbackUrl = "bitwarden://$kind-callback",
AuthTabData.HttpsScheme(
host = "bitwarden.com",
path = "$kind-callback",
)
}

EnvironmentRegion.EUROPEAN_UNION -> {
// TODO: PM-26577 Update this to use a "HttpsScheme"
AuthTabData.CustomScheme(
callbackUrl = "bitwarden://$kind-callback",
AuthTabData.HttpsScheme(
host = "bitwarden.eu",
path = "$kind-callback",
)
}

EnvironmentRegion.INTERNAL -> {
// TODO: PM-26577 Update this to use a "HttpsScheme"
AuthTabData.CustomScheme(
callbackUrl = "bitwarden://$kind-callback",
AuthTabData.HttpsScheme(
host = "bitwarden.pw",
path = "$kind-callback",
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7548,7 +7548,7 @@ class AuthRepositoryTest {
Instant.parse("2023-10-27T12:00:00Z"),
ZoneOffset.UTC,
)
private const val DEEPLINK_SCHEME = "bitwarden"
private const val DEEPLINK_SCHEME = "https"
private const val UNIQUE_APP_ID = "testUniqueAppId"
private const val NAME = "Example Name"
private const val EMAIL = "test@bitwarden.com"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,24 @@ class EnvironmentUrlDataJsonExtensionsTest {

@Test
fun `duoAuthTabData should return the correct AuthTabData for all environments`() {
// TODO: PM-26577 Update these to use a "HttpsScheme"
assertEquals(
AuthTabData.CustomScheme(
callbackUrl = "bitwarden://duo-callback",
callbackScheme = "bitwarden",
AuthTabData.HttpsScheme(
host = "bitwarden.com",
path = "duo-callback",
),
EnvironmentUrlDataJson.DEFAULT_US.duoAuthTabData,
)
assertEquals(
AuthTabData.CustomScheme(
callbackUrl = "bitwarden://duo-callback",
callbackScheme = "bitwarden",
AuthTabData.HttpsScheme(
host = "bitwarden.eu",
path = "duo-callback",
),
EnvironmentUrlDataJson.DEFAULT_EU.duoAuthTabData,
)
assertEquals(
AuthTabData.CustomScheme(
callbackUrl = "bitwarden://duo-callback",
callbackScheme = "bitwarden",
AuthTabData.HttpsScheme(
host = "bitwarden.pw",
path = "duo-callback",
),
DEFAULT_INTERNAL_ENVIRONMENT_URL_DATA.duoAuthTabData,
)
Expand All @@ -42,25 +41,24 @@ class EnvironmentUrlDataJsonExtensionsTest {

@Test
fun `webAuthnAuthTabData should return the correct AuthTabData for all environments`() {
// TODO: PM-26577 Update these to use a "HttpsScheme"
assertEquals(
AuthTabData.CustomScheme(
callbackUrl = "bitwarden://webauthn-callback",
callbackScheme = "bitwarden",
AuthTabData.HttpsScheme(
host = "bitwarden.com",
path = "webauthn-callback",
),
EnvironmentUrlDataJson.DEFAULT_US.webAuthnAuthTabData,
)
assertEquals(
AuthTabData.CustomScheme(
callbackUrl = "bitwarden://webauthn-callback",
callbackScheme = "bitwarden",
AuthTabData.HttpsScheme(
host = "bitwarden.eu",
path = "webauthn-callback",
),
EnvironmentUrlDataJson.DEFAULT_EU.webAuthnAuthTabData,
)
assertEquals(
AuthTabData.CustomScheme(
callbackUrl = "bitwarden://webauthn-callback",
callbackScheme = "bitwarden",
AuthTabData.HttpsScheme(
host = "bitwarden.pw",
path = "webauthn-callback",
),
DEFAULT_INTERNAL_ENVIRONMENT_URL_DATA.webAuthnAuthTabData,
)
Expand All @@ -75,25 +73,24 @@ class EnvironmentUrlDataJsonExtensionsTest {

@Test
fun `ssoAuthTabData should return the correct AuthTabData for all environments`() {
// TODO: PM-26577 Update these to use a "HttpsScheme"
assertEquals(
AuthTabData.CustomScheme(
callbackUrl = "bitwarden://sso-callback",
callbackScheme = "bitwarden",
AuthTabData.HttpsScheme(
host = "bitwarden.com",
path = "sso-callback",
),
EnvironmentUrlDataJson.DEFAULT_US.ssoAuthTabData,
)
assertEquals(
AuthTabData.CustomScheme(
callbackUrl = "bitwarden://sso-callback",
callbackScheme = "bitwarden",
AuthTabData.HttpsScheme(
host = "bitwarden.eu",
path = "sso-callback",
),
EnvironmentUrlDataJson.DEFAULT_EU.ssoAuthTabData,
)
assertEquals(
AuthTabData.CustomScheme(
callbackUrl = "bitwarden://sso-callback",
callbackScheme = "bitwarden",
AuthTabData.HttpsScheme(
host = "bitwarden.pw",
path = "sso-callback",
),
DEFAULT_INTERNAL_ENVIRONMENT_URL_DATA.ssoAuthTabData,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ class EnterpriseSignOnViewModelTest : BaseViewModelTest() {
assertEquals(
EnterpriseSignOnEvent.NavigateToSsoLogin(
uri = ssoUri,
authTabData = AuthTabData.CustomScheme(
callbackUrl = "bitwarden://sso-callback",
callbackScheme = "bitwarden",
authTabData = AuthTabData.HttpsScheme(
host = "bitwarden.com",
path = "sso-callback",
),
),
eventFlow.awaitItem(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,9 @@ class TwoFactorLoginViewModelTest : BaseViewModelTest() {
assertEquals(
TwoFactorLoginEvent.NavigateToDuo(
uri = mockkUri,
authTabData = AuthTabData.CustomScheme(
callbackUrl = "bitwarden://duo-callback",
callbackScheme = "bitwarden",
authTabData = AuthTabData.HttpsScheme(
host = "bitwarden.com",
path = "duo-callback",
),
),
awaitItem(),
Expand Down Expand Up @@ -519,9 +519,9 @@ class TwoFactorLoginViewModelTest : BaseViewModelTest() {
assertEquals(
TwoFactorLoginEvent.NavigateToWebAuth(
uri = mockkUri,
authTabData = AuthTabData.CustomScheme(
callbackUrl = "bitwarden://webauthn-callback",
callbackScheme = "bitwarden",
authTabData = AuthTabData.HttpsScheme(
host = "bitwarden.com",
path = "webauthn-callback",
),
),
awaitItem(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ val EnvironmentUrlDataJson.appLinksScheme: String
EnvironmentRegion.UNITED_STATES,
EnvironmentRegion.EUROPEAN_UNION,
EnvironmentRegion.INTERNAL,
-> {
// TODO: PM-26577 Update this to use "https"
"bitwarden"
}
-> "https"

EnvironmentRegion.SELF_HOSTED -> "bitwarden"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,7 @@ class EnvironmentUrlsDataJsonExtensionsTest {

@Test
fun `appLinksScheme should return the correct scheme for US environment`() {
// TODO: PM-26577 Update this to use "https"
val expectedScheme = "bitwarden"
val expectedScheme = "https"

assertEquals(
expectedScheme,
Expand All @@ -350,8 +349,7 @@ class EnvironmentUrlsDataJsonExtensionsTest {

@Test
fun `appLinksScheme should return the correct scheme for EU environment`() {
// TODO: PM-26577 Update this to use "https"
val expectedScheme = "bitwarden"
val expectedScheme = "https"

assertEquals(
expectedScheme,
Expand All @@ -361,8 +359,7 @@ class EnvironmentUrlsDataJsonExtensionsTest {

@Test
fun `appLinksScheme should return the correct scheme for internal environment`() {
// TODO: PM-26577 Update this to use "https"
val expectedScheme = "bitwarden"
val expectedScheme = "https"

assertEquals(
expectedScheme,
Expand Down
Loading