Commit Graph

124 Commits

Author SHA1 Message Date
J. Ryan Stinnett
27ee90cad5 Add post-login complete security flow
This adds a step after login to complete security for your new session. At the
moment, the only verification method is entering your SSSS passphrase, but nicer
paths will be added soon.

This new step only appears when crypto is available and the account has
cross-signing enabled in SSSS.

Fixes https://github.com/vector-im/riot-web/issues/11214
2020-01-15 21:53:36 +00:00
Travis Ralston
042bd35d79 Fix MatrixClientPeg imports 2019-12-22 21:15:54 -07:00
Travis Ralston
806d728d59 Import from the js-sdk's src/ directory
Because ES6 and such.
2019-12-22 21:14:33 -07:00
Travis Ralston
be4eeb5e07 Fix js-sdk imports for new module 2019-12-22 21:10:26 -07:00
Travis Ralston
d56f0f2a25 Convert many imports to handle ES6 exports
Reliant upon https://github.com/matrix-org/matrix-react-sdk/pull/3761
2019-12-22 21:04:42 -07:00
Travis Ralston
434570eca9 Explain why MatrixClientPeg is the way it is 2019-12-16 16:07:58 -07:00
Travis Ralston
225695ab5c Fix exports for rate limited functions and MatrixClientPeg
MatrixClientPeg in particular doesn't work very well with this.
2019-12-12 19:33:08 -07:00
J. Ryan Stinnett
66f7600969 Add accessSecretStorage helper with common flow setup
This moves the details of dialogs that may be needed when accessing secret
storage to centralised helper. In addition, this clears the secret storage key
cache so that keys are only live for a single operation.
2019-12-11 15:07:46 +00:00
J. Ryan Stinnett
7446bcdedb Extract callbacks to a new module 2019-12-05 15:34:07 +00:00
J. Ryan Stinnett
9f1c2cd3e1 Add dialogs for creating and accessing secret storage
This adds dialogs for creating and accessing secret storage via a passphrase or
recovery key. These flows are adapted from the ones used for key backup.
2019-12-05 15:34:07 +00:00
J. Ryan Stinnett
92c0fdf085 Clarify current state of cross-signing private keys 2019-11-29 15:57:46 +00:00
J. Ryan Stinnett
c568c15186 In-memory keys need an object 2019-11-20 17:35:10 +00:00
J. Ryan Stinnett
50cccd3212 Add cross-signing feature flag
Fixes https://github.com/vector-im/riot-web/issues/11407
2019-11-18 16:06:00 +00:00
Michael Telatynski
e502558f7d Delint
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2019-09-18 09:27:43 +01:00
J. Ryan Stinnett
84e3d339ac Change to provider object 2019-08-23 11:17:51 +01:00
J. Ryan Stinnett
e7097d58ec Add IS access token callback
This passes a callback to the JS SDK which it can use to get IS access tokens
whenever needed for either talking to the IS directly or passing along to the
HS.

Fixes https://github.com/vector-im/riot-web/issues/10525
2019-08-22 14:44:09 +01:00
J. Ryan Stinnett
1c6312d999 Store ICE fallback permission in device setting
This stores the ICE server fallback permission in a device setting so it is
remembered across sessions.

Part of https://github.com/matrix-org/matrix-react-sdk/pull/3309
2019-08-15 15:04:23 +01:00
J. Ryan Stinnett
674f33917f Remove editing feature flag
Part of https://github.com/vector-im/riot-web/issues/10282
2019-07-17 16:56:15 +01:00
Travis Ralston
a33e5f1918
Merge pull request #3188 from matrix-org/travis/soft-logout-non-default-hs
Fix React crash when using a non-default homeserver on soft logout
2019-07-09 11:32:31 -06:00
Travis Ralston
ab63e8bd04 Remove backwards compat function 2019-07-08 11:55:00 -06:00
Travis Ralston
1f1a5b2aac Fix React crash when using a non-default homeserver on soft logout
The function used exists on the peg, not the client. This commit also fixes the name of the function in a backwards compatible way.
2019-07-05 14:35:21 -06:00
Travis Ralston
93872e6fa5 Ask for the user's password to rehydrate their soft logged out session
Fixes https://github.com/vector-im/riot-web/issues/10236

The changes to the MatrixClientPeg (assign/start) are to permit the SoftLogout page to access the MatrixClientPeg reliably. This is why assign() is called by Lifecycle as an alternative to start().

Minimal design work has been done here. The majority is deferred to https://github.com/vector-im/riot-web/issues/10262
2019-07-04 16:51:16 -06:00
David Baker
8fa50b26a6 Fix welcome user
https://github.com/matrix-org/matrix-react-sdk/pull/3101 meant we
don't get logged straight in after registering if using an email
address, but this was the point at which we made a chat with the
welcome user. Instead, set a flag in memory that we should try &
make a chat with the welcome user for that user ID if we get a
session for them.

Of course, if the user logs in on both tabs, this would mean each
would make a chat with the welcome user (although actually this
was a problem with the old code too). Check our m.direct to see if
we've started a chat with the welcome user before making one (which
also means we have to make sure the cached sync is up to date...
see comments).
2019-06-14 15:31:19 +01:00
Travis Ralston
d81804e0fe Merge branch 'develop' into matthew/low_bandwidth 2019-05-30 19:42:09 -06:00
Bruno Windels
31817a91c6 remove replacements flag 2019-05-16 14:43:47 +01:00
David Baker
b4d2463d17
Merge pull request #2974 from matrix-org/dbkr/fix_sso
Fix Single Sign-on
2019-05-15 14:12:05 +01:00
David Baker
da1bff1c5d Fix Single Sign-on
https://github.com/matrix-org/matrix-react-sdk/pull/2826 checked
that we had data in the crypto store if the had credentials in
localStorage. However, SSO stores creds in localStorage and then
redirects the browser to remove the loginToken parameter from the
URL without starting crypto, so after the redirect, we see creds
in localStorage but no crypto data, and error.

Fix by marking when we've successfully initialised crypto and only
erroring if that flag is set.

Fixes https://github.com/vector-im/riot-web/issues/9695
2019-05-15 13:47:48 +01:00
Bruno Windels
0b18ff52c5 pass feature flag to js-sdk 2019-05-14 15:43:10 +01:00
J. Ryan Stinnett
8903f65fcb Enable client-side aggregations for reactions
If reactions are enabled, we need to enable client-side aggregation in the
`MatrixClient` to access the data.
2019-05-10 17:19:27 +01:00
J. Ryan Stinnett
2fdc07b38d Track stores after possible store reassignment 2019-04-05 11:38:27 +01:00
J. Ryan Stinnett
16573a6381 Track store failures after startup
This watches the `IndexedDBStore` in case it degrades. If it does, we track this
in analytics so we can observe how often it happens in the field.

Should help track errors like https://github.com/vector-im/riot-web/issues/7769
2019-04-04 11:59:53 +01:00
David Baker
6e6e748376 Logging tweaks
To try & diagnose https://github.com/vector-im/riot-web/issues/7769

Null check on e before looking for the `name` property and log it
separately rather than appending it to a string (not that this will
help if it's undefined, but it's more useful in general).
2019-04-02 12:31:18 +01:00
J. Ryan Stinnett
90dbeefcfb Remove unused option for disabling IndexedDB
`createMatrixClient` and surrounding paths support an argument to disable
IndexedDB, but it is never actually used. This removes the option to simplify
the code.
2019-03-26 13:29:04 +00:00
J. Ryan Stinnett
1c677d3581 Change to new consistent name for MemoryStore 2019-03-21 15:35:00 +00:00
Travis Ralston
7ea4008daa Implement support for watching for changes in settings
This implements a dream of one day being able to listen for changes in a settings to react to them, regardless of which device actually changed the setting. The use case for this kind of thing is extremely limited, but when it is needed it should be more than powerful enough.
2019-02-22 17:09:07 -07:00
David Baker
26287067fc Security: Force TURN setting was inverted
In making the settings more positive, we flipped 'disable peer to
peer' but didn't change the caption, so the setting was inverted
from what it was labelled as.

Also, forcing p2p isn't the inverse of forcing turn.

Change the setting to be 'allow p2p' and the label to match.
2019-02-13 11:51:32 +00:00
Matthew Hodgson
ce24165e19 port over low_bandwidth mode to develop 2019-02-08 16:44:03 +00:00
Bruno Windels
ac4ab11985 remove ll feature flag, it's time! 2019-02-07 18:24:07 +00:00
J. Ryan Stinnett
68ae72f855 Spell homeserver correctly 2019-01-31 18:52:39 -06:00
Travis Ralston
a1e3887a74
Merge branch 'experimental' into travis/settings/positive 2019-01-28 08:25:40 -07:00
Travis Ralston
cb6f415a05 Be more positive with setting labels
Fixes https://github.com/vector-im/riot-web/issues/6435

This is done through an on-the-fly inverter for the settings. All the settings changed are boolean values, so this should be more than safe to just let happen throughout the SettingsStore. Typically a change like this would be done in the individual handlers (similar to how setting names are remapped to different properties or even different storage locations on the fly), however doing that for this many settings would be a huge nightmare and involve changing *all* the layers. By putting a global "invert this" flag on the setting, we can get away with doing the inversion as the last possible step during a read (or write).

To speed up calculations of the default values, we cache all the inverted values into a lookup table similar to how we represent the defaults already. Without this, the DefaultHandler would need to iterate the setting list and invert the values, slowing things down over time. We invert the value up front so we can keep the generic inversion logic without checking the level ahead of time. It is fully intended that a default value represents the new setting name, not the legacy name.

This commit also includes a debugger for settings because it was hard to visualize what the SettingsStore was doing during development. Some added information is included as it may be helpful for when someone has a problem with their settings and we need to debug it. Typically the debugger would be run in conjunction with `mxSendRageshake`: `mxSettingsStore.debugSetting('showJoinLeaves') && mxSendRageshake('Debugging showJoinLeaves setting')`.
2019-01-24 20:57:40 -07:00
David Baker
1d2538a7bc First working version of SAS 2019-01-15 18:08:13 +00:00
David Baker
e112641524 Handle crypto db version upgrade
Display a dialog telling the user what the situation is with
options to sign out or continue withwout e2e.

Requires https://github.com/matrix-org/matrix-js-sdk/pull/785
2018-11-16 11:31:46 +00:00
Bruno Windels
ef204b6e99 check if phased rollout has expired before trying to enable LL 2018-10-15 16:41:24 +02:00
David Baker
18661e042d Fall back to another store if indexeddb start fails
If we can't start indexeddb, fall back to a different store.

Previously we just ignored the exception and ploughed on anyway, on
the assumption that startup() was just for the indexeddb store to
load data anyway, and if that failed it would just do an initial
/sync instead (and also we'd keep trying to save the sync back which
would fail...). Then, in the previous release we started pulling
the settings out of the store on startup, making the assumpton that
the store actually worked, so the read obviously failed and the app
failed to start up.

This makes Riot work in Tor browser / firefox in daft mode again.
2018-10-04 13:40:56 +01:00
David Baker
e1f68551f1 Fix error logging 2018-10-02 19:23:43 +01:00
Bruno Windels
42fc83d2a8 Move LL filter creation inside MatrixClient
As we need an option to turn lazy loading on (we can't just accept a filter,
as /messages has an incompatible filter), better only pass the option
and create the filter inside startClient
2018-08-02 19:38:41 +02:00
Bruno Windels
4b96e01410 enable newly introduced option 2018-08-02 13:01:57 +02:00
Bruno Windels
af07d73432 hide lazy loading behind feature flag 2018-07-25 16:10:49 +02:00
Luke Barnard
a11e1cc2f9 [WIP] Send lazy_load_memberers filter when syncing 2018-07-25 16:10:49 +02:00