Skip to content

Commit ad34ece

Browse files
bw-ghapp[bot]david-livefront
authored andcommitted
SDK Update - com.bitwarden:sdk-android 2.0.0-6000-b41ccf65
1 parent 16fc30a commit ad34ece

3 files changed

Lines changed: 17 additions & 7 deletions

File tree

app/src/main/kotlin/com/x8bit/bitwarden/data/platform/manager/sdk/repository/ServerCommunicationConfigRepositoryImpl.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,8 @@ class ServerCommunicationConfigRepositoryImpl(
2222
) : ServerCommunicationConfigRepository {
2323

2424
override suspend fun get(hostname: String): ServerCommunicationConfig? {
25-
val serverCommunicationConfig = configDiskSource
26-
.serverConfig
27-
?.serverData
28-
?.communication
29-
?: return null
25+
val serverData = configDiskSource.serverConfig?.serverData
26+
val serverCommunicationConfig = serverData?.communication ?: return null
3027

3128
if (serverCommunicationConfig.bootstrap.type != "ssoCookieVendor") {
3229
return ServerCommunicationConfig(
@@ -43,6 +40,7 @@ class ServerCommunicationConfigRepositoryImpl(
4340
bootstrap = BootstrapConfig.SsoCookieVendor(
4441
v1 = SsoCookieVendorConfig(
4542
idpLoginUrl = serverCommunicationConfig.bootstrap.idpLoginUrl,
43+
vaultUrl = serverData.environment?.vaultUrl,
4644
cookieName = serverCommunicationConfig.bootstrap.cookieName,
4745
cookieDomain = serverCommunicationConfig.bootstrap.cookieDomain,
4846
cookieValue = acquiredCookies,

app/src/test/kotlin/com/x8bit/bitwarden/data/platform/datasource/sdk/ServerCommunicationConfigRepositoryTest.kt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package com.x8bit.bitwarden.data.platform.datasource.sdk
33
import com.bitwarden.data.datasource.disk.model.ServerConfig
44
import com.bitwarden.data.datasource.disk.util.FakeConfigDiskSource
55
import com.bitwarden.network.model.ConfigResponseJson
6+
import com.bitwarden.network.model.ConfigResponseJson.EnvironmentJson
67
import com.bitwarden.servercommunicationconfig.AcquiredCookie
78
import com.bitwarden.servercommunicationconfig.BootstrapConfig
89
import com.bitwarden.servercommunicationconfig.ServerCommunicationConfig
@@ -44,6 +45,7 @@ class ServerCommunicationConfigRepositoryTest {
4445
fun `get returns ServerCommunicationConfig with cookies when config exists`() = runTest {
4546
val hostname = "vault.bitwarden.com"
4647
val idpLoginUrl = "https://idp.example.com/login"
48+
val vaultUrl = "https://api.bitwarden.com"
4749
val cookieName = "session"
4850
val cookieDomain = ".example.com"
4951
configDiskSource.serverConfig = ServerConfig(
@@ -53,7 +55,14 @@ class ServerCommunicationConfigRepositoryTest {
5355
version = null,
5456
gitHash = null,
5557
server = null,
56-
environment = null,
58+
environment = EnvironmentJson(
59+
cloudRegion = null,
60+
vaultUrl = vaultUrl,
61+
apiUrl = null,
62+
identityUrl = null,
63+
notificationsUrl = null,
64+
ssoUrl = null,
65+
),
5766
featureStates = null,
5867
communication = ConfigResponseJson.CommunicationJson(
5968
bootstrap = ConfigResponseJson.CommunicationJson.BootstrapJson(
@@ -81,6 +90,7 @@ class ServerCommunicationConfigRepositoryTest {
8190
bootstrap = BootstrapConfig.SsoCookieVendor(
8291
v1 = SsoCookieVendorConfig(
8392
idpLoginUrl = idpLoginUrl,
93+
vaultUrl = vaultUrl,
8494
cookieName = cookieName,
8595
cookieDomain = cookieDomain,
8696
cookieValue = listOf(
@@ -134,6 +144,7 @@ class ServerCommunicationConfigRepositoryTest {
134144
bootstrap = BootstrapConfig.SsoCookieVendor(
135145
v1 = SsoCookieVendorConfig(
136146
idpLoginUrl = "https://$hostname/proxy-cookie-redirect-connector",
147+
vaultUrl = "https://api.bitwarden.com",
137148
cookieName = "session",
138149
cookieDomain = hostname,
139150
cookieValue = listOf(
@@ -182,6 +193,7 @@ class ServerCommunicationConfigRepositoryTest {
182193
bootstrap = BootstrapConfig.SsoCookieVendor(
183194
v1 = SsoCookieVendorConfig(
184195
idpLoginUrl = "https://$hostname/proxy-cookie-redirect-connector",
196+
vaultUrl = null,
185197
cookieName = "session",
186198
cookieDomain = hostname,
187199
cookieValue = null,

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ androidxRoom = "2.8.4"
3030
androidxSecurityCrypto = "1.1.0"
3131
androidxSplash = "1.2.0"
3232
androidxWork = "2.11.2"
33-
bitwardenSdk = "2.0.0-5997-31c3809a"
33+
bitwardenSdk = "2.0.0-6000-b41ccf65"
3434
crashlytics = "3.0.6"
3535
detekt = "1.23.8"
3636
firebaseBom = "34.11.0"

0 commit comments

Comments
 (0)