Skip to content
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
1 change: 1 addition & 0 deletions changelog.d/491.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Standardise spelling and casing of homeserver, identity server, and integration manager.
4 changes: 2 additions & 2 deletions docs/identity_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Issue: #607
PR: #1354

## Introduction
Identity Servers support contact discovery on Matrix by letting people look up Third Party Identifiers to see if the owner has publicly linked them with their Matrix ID.
Identity servers support contact discovery on Matrix by letting people look up Third Party Identifiers to see if the owner has publicly linked them with their Matrix ID.

## Implementation

Expand Down Expand Up @@ -87,6 +87,6 @@ This screen displays the identity server configuration and the binding of the us
This screen is a form to set a new identity server URL

## Ref:
- https://matrix.org/blog/2019/09/27/privacy-improvements-in-synapse-1-4-and-riot-1-4 is a good summary of the role of an Identity server and the proper way to configure and use it in respect to the privacy and the consent of the user.
- https://matrix.org/blog/2019/09/27/privacy-improvements-in-synapse-1-4-and-riot-1-4 is a good summary of the role of an identity server and the proper way to configure and use it in respect to the privacy and the consent of the user.
- API documentation: https://matrix.org/docs/spec/identity_service/latest
- vector.im TOS: https://vector.im/identity-server-privacy-notice
20 changes: 10 additions & 10 deletions docs/notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ This document aims to describe how Element android displays notifications to the

# Table of Contents
1. [Prerequisites Knowledge](#prerequisites-knowledge)
* [How does a matrix client get a message from a Home Server?](#how-does-a-matrix-client-get-a-message-from-a-home-server)
* [How does a matrix client get a message from a homeserver?](#how-does-a-matrix-client-get-a-message-from-a-homeserver)
* [How does a mobile app receives push notification?](#how-does-a-mobile-app-receives-push-notification)
* [Push VS Notification](#push-vs-notification)
* [Push in the matrix federated world](#push-in-the-matrix-federated-world)
* [How does the Home Server knows when to notify a client?](#how-does-the-home-server-knows-when-to-notify-a-client)
* [How does the homeserver know when to notify a client?](#how-does-the-homeserver-know-when-to-notify-a-client)
* [Push vs privacy, and mitigation](#push-vs-privacy-and-mitigation)
* [Background processing limitations](#background-processing-limitations)
2. [Element Notification implementations](#element-notification-implementations)
Expand All @@ -22,9 +22,9 @@ First let's start with some prerequisite knowledge

# Prerequisites Knowledge

## How does a matrix client get a message from a Home Server?
## How does a matrix client get a message from a homeserver?

In order to get messages from a home server, a matrix client need to perform a ``sync`` operation.
In order to get messages from a homeserver, a matrix client need to perform a ``sync`` operation.

`To read events, the intended flow of operation is for clients to first call the /sync API without a since parameter. This returns the most recent message events for each room, as well as the state of the room at the start of the returned timeline. `

Expand Down Expand Up @@ -90,7 +90,7 @@ That means that Element Android, a matrix client created by New Vector, is using

If you create your own matrix client, you will also need to deploy an instance of a **Push Gateway** with the credentials needed to use FCM for your app.

On registration, a matrix client must tell to it's Home Server what Push Gateway to use.
On registration, a matrix client must tell its homeserver what Push Gateway to use.

See [Sygnal](https://github.com/matrix-org/sygnal/) for a reference implementation.
```
Expand Down Expand Up @@ -122,13 +122,13 @@ Recommended reading:
* https://matrix.org/docs/spec/client_server/r0.4.0.html#id128


## How does the Home Server knows when to notify a client?
## How does the homeserver know when to notify a client?
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks also for (all) the grammar fix 👍


This is defined by [**push rules**](https://matrix.org/docs/spec/client_server/r0.4.0.html#push-rules-).

`A push rule is a single rule that states under what conditions an event should be passed onto a push gateway and how the notification should be presented (sound / importance).`

A Home Server can be configured with default rules (for Direct messages, group messages, mentions, etc.. ).
A homeserver can be configured with default rules (for Direct messages, group messages, mentions, etc.. ).

There are different kind of push rules, it can be per room (each new message on this room should be notified), it can also define a pattern that a message should match (when you are mentioned, or key word based).

Expand Down Expand Up @@ -187,7 +187,7 @@ In background, and depending on wether push is available or not, Element will us

## Push (FCM) received in background

In order to enable Push, Element must first get a push token from the firebase SDK, then register a pusher with this token on the HomeServer.
In order to enable Push, Element must first get a push token from the firebase SDK, then register a pusher with this token on the homeserver.

When a message should be notified to a user, the user's homeserver notifies the registered `push gateway` for Element, that is [sygnal](https://github.com/matrix-org/sygnal) _- The reference implementation for push gateways -_ hosted by matrix.org.

Expand All @@ -199,7 +199,7 @@ Homeserver ----> Sygnal (configured for Element) ----> FCM ----> Element

The push gateway is configured to only send `(eventId,roomId)` in the push payload (for better [privacy](#push-vs-privacy-and-mitigation)).

Element needs then to synchronise with the user's HomeServer, in order to resolve the event and create a notification.
Element needs then to synchronise with the user's homeserver, in order to resolve the event and create a notification.

As per [Google recommendation](https://android-developers.googleblog.com/2018/09/notifying-your-users-with-fcm.html), Element will then use the WorkManager API in order to trigger a background sync.

Expand All @@ -217,7 +217,7 @@ Homeserver ----> Sygnal ----> FCM ----> Element

**Possible outcomes**

Upon reception of the FCM push, Element will perform a sync call to the Home Server, during this process it is possible that:
Upon reception of the FCM push, Element will perform a sync call to the homeserver, during this process it is possible that:
* Happy path, the sync is performed, the message resolved and displayed in the notification drawer
* The notified message is not in the sync. Can happen if a lot of things did happen since the push (`gappy sync`)
* The sync generates additional notifications (e.g an encrypted message where the user is mentioned detected locally)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class CommonTestHelper(context: Context) {
}

/**
* Create a Home server configuration, with Http connection allowed for test
* Create a homeserver configuration, with Http connection allowed for test
*/
fun createHomeServerConfig(): HomeServerConnectionConfig {
return HomeServerConnectionConfig.Builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ class KeysBackupTest : InstrumentedTest {
// - Do an e2e backup to the homeserver
mKeysBackupTestHelper.prepareAndCreateKeysBackupData(keysBackup)

// Get key backup version from the home server
// Get key backup version from the homeserver
val keysVersionResult = mTestHelper.doSync<KeysVersionResult?> {
keysBackup.getCurrentVersion(it)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ data class HomeServerConnectionConfig(
*/
fun withHomeServerUri(hsUri: Uri): Builder {
if (hsUri.scheme != "http" && hsUri.scheme != "https") {
throw RuntimeException("Invalid home server URI: $hsUri")
throw RuntimeException("Invalid homeserver URI: $hsUri")
}
// ensure trailing /
val hsString = hsUri.toString().ensureTrailingSlash()
homeServerUri = try {
Uri.parse(hsString)
} catch (e: Exception) {
throw RuntimeException("Invalid home server URI: $hsUri")
throw RuntimeException("Invalid homeserver URI: $hsUri")
}
return this
}
Expand Down Expand Up @@ -138,7 +138,7 @@ data class HomeServerConnectionConfig(
}

/**
* Add an accepted TLS version for TLS connections with the home server.
* Add an accepted TLS version for TLS connections with the homeserver.
*
* @param tlsVersion the tls version to add to the set of TLS versions accepted.
* @return this builder
Expand All @@ -160,7 +160,7 @@ data class HomeServerConnectionConfig(
}

/**
* Add a TLS cipher suite to the list of accepted TLS connections with the home server.
* Add a TLS cipher suite to the list of accepted TLS connections with the homeserver.
*
* @param tlsCipherSuite the tls cipher suite to add.
* @return this builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ data class RegistrationFlowResponse(
val completedStages: List<String>? = null,

/**
* The session identifier that the client must pass back to the home server, if one is provided,
* The session identifier that the client must pass back to the homeserver, if one is provided,
* in subsequent attempts to authenticate in the same API call.
*/
@Json(name = "session")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import org.matrix.android.sdk.internal.crypto.store.SavedKeyBackupKeyInfo

interface KeysBackupService {
/**
* Retrieve the current version of the backup from the home server
* Retrieve the current version of the backup from the homeserver
*
* It can be different than keysBackupVersion.
* @param callback onSuccess(null) will be called if there is no backup on the server
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ enum class KeysBackupState {
// Need to check the current backup version on the homeserver
Unknown,

// Checking if backup is enabled on home server
// Checking if backup is enabled on homeserver
CheckingBackUpOnHomeserver,

// Backup has been stopped because a new backup version has been detected on the homeserver
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ data class Event(

/**
* The `age` value transcoded in a timestamp based on the device clock when the SDK received
* the event from the home server.
* the event from the homeserver.
* Unlike `age`, this value is static.
*/
@Transient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ internal class DefaultSessionCreator @Inject constructor(
) : SessionCreator {

/**
* Credentials can affect the homeServerConnectionConfig, override home server url and/or
* Credentials can affect the homeServerConnectionConfig, override homeserver url and/or
* identity server url if provided in the credentials
*/
override suspend fun createSession(credentials: Credentials, homeServerConnectionConfig: HomeServerConnectionConfig): Session {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ data class MXDeviceInfo(
val signatures: Map<String, Map<String, String>>? = null,

/*
* Additional data from the home server.
* Additional data from the homeserver.
*/
@Json(name = "unsigned")
val unsigned: JsonDict? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import io.realm.RealmObject
import io.realm.annotations.Index

/**
* Clients can store custom config data for their account on their HomeServer.
* Clients can store custom config data for their account on their homeserver.
* This account data will be synced between different devices and can persist across installations on a particular device.
* Users may only view the account data for their own account.
* The account_data may be either global or scoped to a particular rooms.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class Credentials {

public String deviceId;

// Optional data that may contain info to override home server and/or identity server
// Optional data that may contain info to override homeserver and/or identity server
public WellKnown wellKnown;

public JSONObject toJson() throws JSONException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
*/
public class HomeServerConnectionConfig {

// the home server URI
// the homeserver URI
private Uri mHomeServerUri;
// the jitsi server URI. Can be null
@Nullable
Expand Down Expand Up @@ -82,7 +82,7 @@ private HomeServerConnectionConfig() {
}

/**
* Update the home server URI.
* Update the homeserver URI.
*
* @param uri the new HS uri
*/
Expand All @@ -91,7 +91,7 @@ public void setHomeserverUri(Uri uri) {
}

/**
* @return the home server uri
* @return the homeserver uri
*/
public Uri getHomeserverUri() {
return mHomeServerUri;
Expand Down Expand Up @@ -145,7 +145,7 @@ public Credentials getCredentials() {
public void setCredentials(Credentials credentials) {
mCredentials = credentials;

// Override home server url and/or identity server url if provided
// Override homeserver url and/or identity server url if provided
if (credentials.wellKnown != null) {
if (credentials.wellKnown.homeServer != null) {
String homeServerUrl = credentials.wellKnown.homeServer.baseURL;
Expand Down Expand Up @@ -200,15 +200,15 @@ public boolean shouldPin() {
}

/**
* TLS versions accepted for TLS connections with the home server.
* TLS versions accepted for TLS connections with the homeserver.
*/
@Nullable
public List<TlsVersion> getAcceptedTlsVersions() {
return mTlsVersions;
}

/**
* TLS cipher suites accepted for TLS connections with the home server.
* TLS cipher suites accepted for TLS connections with the homeserver.
*/
@Nullable
public List<CipherSuite> getAcceptedTlsCipherSuites() {
Expand Down Expand Up @@ -426,7 +426,7 @@ public Builder(HomeServerConnectionConfig from) {
*/
public Builder withHomeServerUri(final Uri homeServerUri) {
if (homeServerUri == null || (!"http".equals(homeServerUri.getScheme()) && !"https".equals(homeServerUri.getScheme()))) {
throw new RuntimeException("Invalid home server URI: " + homeServerUri);
throw new RuntimeException("Invalid homeserver URI: " + homeServerUri);
}

// remove trailing /
Expand All @@ -435,7 +435,7 @@ public Builder withHomeServerUri(final Uri homeServerUri) {
String url = homeServerUri.toString();
mHomeServerConnectionConfig.mHomeServerUri = Uri.parse(url.substring(0, url.length() - 1));
} catch (Exception e) {
throw new RuntimeException("Invalid home server URI: " + homeServerUri);
throw new RuntimeException("Invalid homeserver URI: " + homeServerUri);
}
} else {
mHomeServerConnectionConfig.mHomeServerUri = homeServerUri;
Expand Down Expand Up @@ -549,7 +549,7 @@ public Builder withShouldAcceptTlsExtensions(boolean shouldAcceptTlsExtension) {
}

/**
* Add an accepted TLS version for TLS connections with the home server.
* Add an accepted TLS version for TLS connections with the homeserver.
*
* @param tlsVersion the tls version to add to the set of TLS versions accepted.
* @return this builder
Expand Down Expand Up @@ -577,7 +577,7 @@ public Builder forceUsageOfTlsVersions(boolean forceUsageOfTlsVersions) {
}

/**
* Add a TLS cipher suite to the list of accepted TLS connections with the home server.
* Add a TLS cipher suite to the list of accepted TLS connections with the homeserver.
*
* @param tlsCipherSuite the tls cipher suite to add.
* @return this builder
Expand Down Expand Up @@ -666,7 +666,7 @@ public Builder withProxy(@Nullable String proxyHostname, int proxyPort) {
public HomeServerConnectionConfig build() {
// Check mandatory parameters
if (mHomeServerConnectionConfig.mHomeServerUri == null) {
throw new RuntimeException("Home server URI not set");
throw new RuntimeException("Homeserver URI not set");
}

return mHomeServerConnectionConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
public class LoginStorage {
private static final String PREFS_LOGIN = "Vector.LoginStorage";

// multi accounts + home server config
// multi accounts + homeserver config
private static final String PREFS_KEY_CONNECTION_CONFIGS = "PREFS_KEY_CONNECTION_CONFIGS";

private final Context mContext;
Expand All @@ -49,7 +49,7 @@ public LoginStorage(Context appContext) {
}

/**
* @return the list of home server configurations.
* @return the list of homeserver configurations.
*/
public List<HomeServerConnectionConfig> getCredentialsList() {
SharedPreferences prefs = mContext.getSharedPreferences(PREFS_LOGIN, Context.MODE_PRIVATE);
Expand Down Expand Up @@ -85,7 +85,7 @@ public List<HomeServerConnectionConfig> getCredentialsList() {
/**
* Add a credentials to the credentials list
*
* @param config the home server config to add.
* @param config the homeserver config to add.
*/
public void addCredentials(HomeServerConnectionConfig config) {
if (null != config && config.getCredentials() != null) {
Expand Down Expand Up @@ -203,4 +203,4 @@ public void clear() {
//Need to commit now because called before forcing an app restart
editor.commit();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ internal class DefaultIdentityService @Inject constructor(
} else {
// Disconnect previous one if any, first, because the token will change.
// In case of error when configuring the new identity server, this is not a big deal,
// we will ask for a new token on the previous Identity server
// we will ask for a new token on the previous identity server
runCatching { identityDisconnectTask.execute(Unit) }
.onFailure { Timber.w(it, "Unable to disconnect identity server") }

Expand Down Expand Up @@ -241,7 +241,7 @@ internal class DefaultIdentityService @Inject constructor(

override suspend fun getShareStatus(threePids: List<ThreePid>): Map<ThreePid, SharedState> {
// Note: we do not require user consent here, because it is used for emails and phone numbers that the user has already sent
// to the home server, and not emails and phone numbers from the contact book of the user
// to the homeserver, and not emails and phone numbers from the contact book of the user

if (threePids.isEmpty()) {
return emptyMap()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ internal interface IdentityAuthAPI {
suspend fun ping()

/**
* Ping v1 will be used to check outdated Identity server
* Ping v1 will be used to check outdated identity server
*/
@GET("_matrix/identity/api/v1")
suspend fun pingV1()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ import javax.inject.Inject

/**
* The integration manager allows to
* - Get the Integration Manager that a user has explicitly set for its account (via account data)
* - Get the recommended/preferred Integration Manager list as defined by the HomeServer (via wellknown)
* - Get the integration manager that a user has explicitly set for its account (via account data)
* - Get the recommended/preferred integration manager list as defined by the homeserver (via wellknown)
* - Check if the user has disabled the integration manager feature
* - Allow / Disallow Integration manager (propagated to other riot clients)
*
Expand Down
Loading