mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-10-31 08:15:02 +00:00
feat(branding): rebrand app identity to HealthChat
App id ch.healthchat.element, locked matrix.healthchat.ch homeserver.
This commit is contained in:
@@ -24,12 +24,12 @@ object ApplicationConfig {
|
|||||||
* Cannot be empty.
|
* Cannot be empty.
|
||||||
* For Element, the value is "Element".
|
* For Element, the value is "Element".
|
||||||
*/
|
*/
|
||||||
const val PRODUCTION_APPLICATION_NAME: String = "Element"
|
const val PRODUCTION_APPLICATION_NAME: String = "HealthChat"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used in the strings to reference the Element Desktop client, for instance Element Web.
|
* Used in the strings to reference the Element Desktop client, for instance Element Web.
|
||||||
* Cannot be empty.
|
* Cannot be empty.
|
||||||
* For Element, the value is "Element". We use the same name for desktop and mobile for now.
|
* For Element, the value is "Element". We use the same name for desktop and mobile for now.
|
||||||
*/
|
*/
|
||||||
const val DESKTOP_APPLICATION_NAME: String = "Element"
|
const val DESKTOP_APPLICATION_NAME: String = "HealthChat"
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-3
@@ -37,9 +37,9 @@ class DefaultEnterpriseService(
|
|||||||
) : EnterpriseService {
|
) : EnterpriseService {
|
||||||
override suspend fun isEnterpriseUser(sessionId: SessionId) = false
|
override suspend fun isEnterpriseUser(sessionId: SessionId) = false
|
||||||
override suspend fun tweakMasUrl(url: String, urlContentFetcher: ClientUrlContentFetcher) = url
|
override suspend fun tweakMasUrl(url: String, urlContentFetcher: ClientUrlContentFetcher) = url
|
||||||
override fun accountProviderAllowList(): List<AccountProvider> = emptyList()
|
override fun accountProviderAllowList(): List<AccountProvider> = listOf(healthChatAccountProvider)
|
||||||
override fun canConnectToAnyAccountProvider(): Boolean = true
|
override fun canConnectToAnyAccountProvider(): Boolean = false
|
||||||
override suspend fun isAllowedToConnectToAccountProvider(accountProvider: AccountProvider) = true
|
override suspend fun isAllowedToConnectToAccountProvider(accountProvider: AccountProvider) = healthChatAccountProvider.matches(accountProvider)
|
||||||
override suspend fun isElementProEnforced(serverName: String): Boolean = withContext(dispatchers.io) {
|
override suspend fun isElementProEnforced(serverName: String): Boolean = withContext(dispatchers.io) {
|
||||||
val temporaryMatrixClient = temporaryMatrixClientFactory.create(serverName).getOrElse { return@withContext false }
|
val temporaryMatrixClient = temporaryMatrixClientFactory.create(serverName).getOrElse { return@withContext false }
|
||||||
temporaryMatrixClient.use { client ->
|
temporaryMatrixClient.use { client ->
|
||||||
@@ -77,6 +77,11 @@ class DefaultEnterpriseService(
|
|||||||
override fun getNoisyNotificationChannelId(sessionId: SessionId): String? = null
|
override fun getNoisyNotificationChannelId(sessionId: SessionId): String? = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HealthChat is locked to its own homeserver: this is the only account provider users can sign in to.
|
||||||
|
*/
|
||||||
|
private val healthChatAccountProvider = AccountProvider.Generic(serverName = "matrix.healthchat.ch")
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A minimal version of the enterprise config that only contains the fields we need to check if Element Pro is enforced.
|
* A minimal version of the enterprise config that only contains the fields we need to check if Element Pro is enforced.
|
||||||
*/
|
*/
|
||||||
|
|||||||
+10
-6
@@ -14,6 +14,7 @@ import io.element.android.compound.colors.SemanticColorsLightDark
|
|||||||
import io.element.android.features.enterprise.api.BugReportUrl
|
import io.element.android.features.enterprise.api.BugReportUrl
|
||||||
import io.element.android.libraries.androidutils.json.JsonProvider
|
import io.element.android.libraries.androidutils.json.JsonProvider
|
||||||
import io.element.android.libraries.core.uri.ensureProtocol
|
import io.element.android.libraries.core.uri.ensureProtocol
|
||||||
|
import io.element.android.libraries.matrix.api.accountprovider.AccountProvider
|
||||||
import io.element.android.libraries.matrix.test.A_HOMESERVER_URL
|
import io.element.android.libraries.matrix.test.A_HOMESERVER_URL
|
||||||
import io.element.android.libraries.matrix.test.A_SESSION_ID
|
import io.element.android.libraries.matrix.test.A_SESSION_ID
|
||||||
import io.element.android.libraries.matrix.test.FakeTemporaryMatrixClient
|
import io.element.android.libraries.matrix.test.FakeTemporaryMatrixClient
|
||||||
@@ -29,21 +30,24 @@ import org.junit.Test
|
|||||||
|
|
||||||
class DefaultEnterpriseServiceTest {
|
class DefaultEnterpriseServiceTest {
|
||||||
@Test
|
@Test
|
||||||
fun accountProviderAllowList() = runTest {
|
fun `accountProviderAllowList contains the HealthChat homeserver only`() = runTest {
|
||||||
val defaultEnterpriseService = createDefaultEnterpriseService()
|
val defaultEnterpriseService = createDefaultEnterpriseService()
|
||||||
assertThat(defaultEnterpriseService.accountProviderAllowList()).isEmpty()
|
assertThat(defaultEnterpriseService.accountProviderAllowList())
|
||||||
|
.containsExactly(AccountProvider.Generic(serverName = "matrix.healthchat.ch"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `canConnectToAnyAccountProvider is always true`() = runTest {
|
fun `canConnectToAnyAccountProvider is always false`() = runTest {
|
||||||
val defaultEnterpriseService = createDefaultEnterpriseService()
|
val defaultEnterpriseService = createDefaultEnterpriseService()
|
||||||
assertThat(defaultEnterpriseService.canConnectToAnyAccountProvider()).isTrue()
|
assertThat(defaultEnterpriseService.canConnectToAnyAccountProvider()).isFalse()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `isAllowedToConnectToAccountProvider is true for all account providers`() = runTest {
|
fun `isAllowedToConnectToAccountProvider is true for the HealthChat homeserver only`() = runTest {
|
||||||
val defaultEnterpriseService = createDefaultEnterpriseService()
|
val defaultEnterpriseService = createDefaultEnterpriseService()
|
||||||
assertThat(defaultEnterpriseService.isAllowedToConnectToAccountProvider(anAccountProviderGeneric())).isTrue()
|
assertThat(defaultEnterpriseService.isAllowedToConnectToAccountProvider(AccountProvider.Generic("matrix.healthchat.ch"))).isTrue()
|
||||||
|
assertThat(defaultEnterpriseService.isAllowedToConnectToAccountProvider(AccountProvider.Generic("https://matrix.healthchat.ch/"))).isTrue()
|
||||||
|
assertThat(defaultEnterpriseService.isAllowedToConnectToAccountProvider(anAccountProviderGeneric())).isFalse()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -9,16 +9,24 @@
|
|||||||
package config
|
package config
|
||||||
|
|
||||||
object BuildTimeConfig {
|
object BuildTimeConfig {
|
||||||
const val APPLICATION_ID = "io.element.android.x"
|
const val APPLICATION_ID = "ch.healthchat.element"
|
||||||
const val APPLICATION_NAME = "Element X"
|
const val APPLICATION_NAME = "HealthChat"
|
||||||
val METADATA_HOST_REVERSED: String? = null
|
|
||||||
val OAUTH_CLIENT_URL_PATH: String? = "apps/android"
|
// OIDC redirect scheme base. MAS requires the custom scheme to be the
|
||||||
val URL_WEBSITE: String? = null
|
// reverse-DNS of the CLIENT_URI (URL_WEBSITE) host, or an extension of it.
|
||||||
val URL_LOGO: String? = null
|
val METADATA_HOST_REVERSED: String? = "ch.healthchat.element"
|
||||||
|
// No path is appended to the OIDC client_uri: MAS validates the redirect
|
||||||
|
// scheme against the apex host, so the client URI must stay https://healthchat.ch.
|
||||||
|
val OAUTH_CLIENT_URL_PATH: String? = null
|
||||||
|
// Must stay the apex host: the OIDC client_uri host must reverse-match
|
||||||
|
// METADATA_HOST_REVERSED, and logo/tos/policy URIs must be on this host
|
||||||
|
// or a subdomain of it.
|
||||||
|
val URL_WEBSITE: String? = "https://healthchat.ch"
|
||||||
|
val URL_LOGO: String? = "https://www.healthchat.ch/favicon.ico"
|
||||||
val URL_COPYRIGHT: String? = null
|
val URL_COPYRIGHT: String? = null
|
||||||
val URL_ACCEPTABLE_USE: String? = null
|
val URL_ACCEPTABLE_USE: String? = "https://www.healthchat.ch/datenschutz"
|
||||||
val URL_PRIVACY: String? = null
|
val URL_PRIVACY: String? = "https://www.healthchat.ch/datenschutz"
|
||||||
val URL_POLICY: String? = null
|
val URL_POLICY: String? = "https://www.healthchat.ch/datenschutz"
|
||||||
val SERVICES_MAPTILER_BASE_URL: String? = null
|
val SERVICES_MAPTILER_BASE_URL: String? = null
|
||||||
val SERVICES_MAPTILER_APIKEY: String? = null
|
val SERVICES_MAPTILER_APIKEY: String? = null
|
||||||
val SERVICES_MAPTILER_LIGHT_MAPID: String? = null
|
val SERVICES_MAPTILER_LIGHT_MAPID: String? = null
|
||||||
|
|||||||
Reference in New Issue
Block a user