matrix-org / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://matrix-org.github.io/synapse
Apache License 2.0
11.83k stars 2.12k forks source link

[20200921] Expose forced-on E2EE through a /versions flag or something #8311

Closed turt2live closed 4 years ago

turt2live commented 4 years ago

Capabilities are probably wrong for this, and we don't yet have an info API. For speed, I'd recommend a /versions flag of io.element.e2ee_forced for clients to check.

neilisfragile commented 4 years ago

Release blocker tag because it needs to make it into a release before the end of September, though ideally the implementation would be done much sooner to unblock @turt2live

clokep commented 4 years ago

From discussions elsewhere, this seems related to the encryption_enabled_by_default_for_room_type flag, which controls whether newly created local rooms use E2EE by default or not.

This essentially has three values:

We could expose that in the configuration, but unfortunately it seems more than just a True/False value.

turt2live commented 4 years ago

this is where I wish we had an info endpoint :(

Can we do two flags to represent all and private? If both are false/not present then it's safe to assume the server won't manipulate the behaviour.

Something like:

{
  "io.element.forced_e2e.everywhere": true,
  "io.element.forced_e2e.private_only": true
}

io.element.forced_e2e.everywhere when true implicitly means io.element.forced_e2e.private_only is enabled. Similarly, when io.element.forced_e2e.everywhere is missing then it is implied false, which forces the client to look at io.element.forced_e2e.private_only

This should make the server implementation something along the lines of (I don't know python well):

if config['encryption_enabled_by_default_for_room_type'] != 'off':
    unstable_features["io.element.forced_e2e.everywhere" if config['encryption_enabled_by_default_for_room_type'] == 'all' else "io.element.forced_e2e.private_only"] = True
clokep commented 4 years ago

@turt2live Yes, we can do that -- would it make more sense to have a separate flag for private and public? Something like:

{
    "io.element.forced_e2e.public": true,
    "io.element.forced_e2e.private": true,
}

It is a bit less implicit.

turt2live commented 4 years ago

yea, that should be fine. The client will know what presets its about to use anyways :D