Skip to content

Commit

Permalink
Relax identity server discovery checks to FAIL_PROMPT
Browse files Browse the repository at this point in the history
As discussed in MSC2284, this relaxes the identity server discovery to a
`FAIL_PROMPT` state so that clients can choose to warn and continue.

Part of element-hq/element-web#11102
Implements matrix-org/matrix-spec-proposals#2284
  • Loading branch information
jryans committed Nov 1, 2019
1 parent 35adb75 commit 45836b8
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/autodiscovery.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,21 +275,11 @@ export class AutoDiscovery {
let isUrl = "";
if (wellknown["m.identity_server"]) {
// We prepare a failing identity server response to save lines later
// in this branch. Note that we also fail the homeserver check in the
// object because according to the spec we're supposed to FAIL_ERROR
// if *anything* goes wrong with the IS validation, including invalid
// format. This means we're supposed to stop discovery completely.
// in this branch.
const failingClientConfig = {
"m.homeserver": {
state: AutoDiscovery.FAIL_ERROR,
error: AutoDiscovery.ERROR_INVALID_IS,

// We'll provide the base_url that was previously valid for
// debugging purposes.
base_url: clientConfig["m.homeserver"].base_url,
},
"m.homeserver": clientConfig["m.homeserver"],
"m.identity_server": {
state: AutoDiscovery.FAIL_ERROR,
state: AutoDiscovery.FAIL_PROMPT,
error: AutoDiscovery.ERROR_INVALID_IS,
base_url: null,
},
Expand Down

0 comments on commit 45836b8

Please sign in to comment.