Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate homeserver configuration prior to loading the app #9779

Merged
merged 22 commits into from May 23, 2019
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f08491c
Validate default homeserver config before loading the app
turt2live Apr 16, 2019
5445632
Use new js-sdk properties for getting discovery errors
turt2live Apr 16, 2019
51941ea
Add note to self
turt2live Apr 17, 2019
c8caf67
Move bulk of discovery processing to react-sdk
turt2live Apr 18, 2019
e7bf643
Don't repackage the ValidatedDiscoveryConfig
turt2live Apr 18, 2019
ab6ba0e
Add some clarity to the config options
turt2live Apr 19, 2019
45caa8b
Add a couple notes
turt2live May 2, 2019
bf97fd6
Handle cases of no default server
turt2live May 3, 2019
a5092dc
Fix tests to use new server config options
turt2live May 3, 2019
fc5c93a
Fix unit tests for new login
turt2live May 3, 2019
886828c
Merge pull request #9496 from vector-im/travis/guests/block-ui
turt2live May 10, 2019
7f5589c
Clarify comment on is_url and hs_url handling
turt2live May 14, 2019
68a7550
Flag the validated config as the default config
turt2live May 14, 2019
559416d
Show most homeserver options on the mobile guide
turt2live May 14, 2019
22cc33e
Do a simple .well-known lookup for default_server_name for mobile guide
turt2live May 14, 2019
51f5671
Merge pull request #9719 from vector-im/travis/wk/clarify_is_hs_url
turt2live May 16, 2019
39d1293
Merge pull request #9721 from vector-im/travis/wk/fallback_hs
turt2live May 16, 2019
1ac5df3
Merge branch 'develop' into travis/feature/wellknown2
turt2live May 16, 2019
7a65dc9
Merge pull request #9726 from vector-im/travis/wk/mobileguide
turt2live May 17, 2019
fa9d2a8
Merge branch 'develop' into travis/feature/wellknown2
turt2live May 21, 2019
b772bc7
Update copyright
turt2live May 23, 2019
26d8056
Merge branch 'develop' into travis/feature/wellknown2
turt2live May 23, 2019
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Use new js-sdk properties for getting discovery errors

  • Loading branch information
turt2live committed Apr 16, 2019
commit 54456320266c72bb39cc4ee5acaf0e3b4c8c5418
@@ -448,20 +448,6 @@ async function loadLanguage() {
async function verifyServerConfig() {
console.log("Verifying homeserver configuration");

// Errors which can be returned by .well-known lookups. If autodiscovery fails for unexpected reasons,
// the last thing we want is "missing-translation|en:Your error here". The actual strings are also defined
// in the react-sdk, so we don't need them here.
const discoveryErrors = [
"Invalid homeserver discovery response",
"Failed to get autodiscovery configuration from server",
"Invalid base_url for m.homeserver",
"Homeserver URL does not appear to be a valid Matrix homeserver",
"Invalid identity server discovery response",
"Invalid base_url for m.identity_server",
"Identity server URL does not appear to be a valid identity server",
"General failure",
];

const config = SdkConfig.get();
let wkConfig = config['default_server_config']; // overwritten later under some conditions
const serverName = config['default_server_name'];
@@ -512,7 +498,7 @@ async function verifyServerConfig() {

const hsResult = result['m.homeserver'];
if (hsResult.state !== AutoDiscovery.SUCCESS) {
if (discoveryErrors.indexOf(hsResult.error) !== -1) {
if (AutoDiscovery.ALL_ERRORS.indexOf(hsResult.error) !== -1) {
throw newTranslatableError(hsResult.error);
}
throw newTranslatableError(_td("Unexpected error resolving homeserver configuration"));
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.