From b8ef048a3accb80e38ea0d503af9366077bca993 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Fri, 19 Nov 2021 19:34:16 +0200 Subject: [PATCH] Show E2EE fingerprint in client view --- maubot/client.py | 1 + maubot/management/api/spec.yaml | 3 +++ maubot/management/frontend/src/pages/dashboard/Client.js | 5 +++++ maubot/management/frontend/src/style/pages/client/index.sass | 4 ++++ 4 files changed, 13 insertions(+) diff --git a/maubot/client.py b/maubot/client.py index 074e85e..6cfdfd4 100644 --- a/maubot/client.py +++ b/maubot/client.py @@ -247,6 +247,7 @@ class Client: "homeserver": self.homeserver, "access_token": self.access_token, "device_id": self.device_id, + "fingerprint": self.crypto.account.fingerprint if self.crypto else None, "enabled": self.enabled, "started": self.started, "sync": self.sync, diff --git a/maubot/management/api/spec.yaml b/maubot/management/api/spec.yaml index a86358e..8529599 100644 --- a/maubot/management/api/spec.yaml +++ b/maubot/management/api/spec.yaml @@ -679,6 +679,9 @@ components: device_id: type: string description: The Matrix device ID corresponding to the access token. + fingerprint: + type: string + description: The encryption device fingerprint for verification. enabled: type: boolean example: true diff --git a/maubot/management/frontend/src/pages/dashboard/Client.js b/maubot/management/frontend/src/pages/dashboard/Client.js index 29405fe..ac81114 100644 --- a/maubot/management/frontend/src/pages/dashboard/Client.js +++ b/maubot/management/frontend/src/pages/dashboard/Client.js @@ -75,6 +75,7 @@ class Client extends BaseMainView { avatar_url: "", access_token: "", device_id: "", + fingerprint: null, sync: true, autojoin: true, enabled: true, @@ -274,6 +275,10 @@ class Client extends BaseMainView { + {this.props.entry.fingerprint && } diff --git a/maubot/management/frontend/src/style/pages/client/index.sass b/maubot/management/frontend/src/style/pages/client/index.sass index b815dd9..54e0c67 100644 --- a/maubot/management/frontend/src/style/pages/client/index.sass +++ b/maubot/management/frontend/src/style/pages/client/index.sass @@ -36,6 +36,10 @@ > div.instances +instancelist + input.fingerprint + font-family: "Fira Code", monospace + font-size: 0.8em + @media screen and (max-width: 40rem) flex-wrap: wrap