1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-08 21:42:24 +03:00

Add cross-signing diagnostic panel

This is not part of any designs, so it may be short-lived, but it's quite handy
for diagnosing issues with cross-signing at least while the feature is in
development.
This commit is contained in:
J. Ryan Stinnett
2019-11-28 16:45:29 +00:00
parent b55a1a1077
commit c103fe4273
7 changed files with 163 additions and 41 deletions

View File

@@ -1,5 +1,6 @@
/*
Copyright 2018 New Vector Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -20,7 +21,6 @@ import sdk from '../../../index';
import MatrixClientPeg from '../../../MatrixClientPeg';
import { _t } from '../../../languageHandler';
import Modal from '../../../Modal';
import SettingsStore from '../../../../lib/settings/SettingsStore';
export default class KeyBackupPanel extends React.PureComponent {
constructor(props) {
@@ -125,27 +125,6 @@ export default class KeyBackupPanel extends React.PureComponent {
);
}
_bootstrapSecureSecretStorage = async () => {
try {
const InteractiveAuthDialog = sdk.getComponent("dialogs.InteractiveAuthDialog");
await MatrixClientPeg.get().bootstrapSecretStorage({
doInteractiveAuthFlow: async (makeRequest) => {
const { finished } = Modal.createTrackedDialog(
'Cross-signing keys dialog', '', InteractiveAuthDialog,
{
title: _t("Send cross-signing keys to homeserver"),
matrixClient: MatrixClientPeg.get(),
makeRequest,
},
);
await finished;
},
});
} catch (e) {
console.error(e);
}
}
_deleteBackup = () => {
const QuestionDialog = sdk.getComponent('dialogs.QuestionDialog');
Modal.createTrackedDialog('Delete Backup', '', QuestionDialog, {
@@ -320,21 +299,6 @@ export default class KeyBackupPanel extends React.PureComponent {
</div>
</div>;
} else {
// This is a temporary button for testing SSSS. Initialising SSSS
// depends on cross-signing and is part of the same project, so we
// only show this mode when the cross-signing feature is enabled.
// TODO: Clean this up when removing the feature flag.
let bootstrapSecureSecretStorage;
if (SettingsStore.isFeatureEnabled("feature_cross_signing")) {
bootstrapSecureSecretStorage = (
<div className="mx_KeyBackupPanel_buttonRow">
<AccessibleButton kind="primary" onClick={this._bootstrapSecureSecretStorage}>
{_t("Bootstrap Secure Secret Storage (MSC1946)")}
</AccessibleButton>
</div>
);
}
return <div>
<div>
<p>{_t(
@@ -349,7 +313,6 @@ export default class KeyBackupPanel extends React.PureComponent {
{_t("Start using Key Backup")}
</AccessibleButton>
</div>
{bootstrapSecureSecretStorage}
</div>;
}
}