Skip to content

Commit 7d37bb1

Browse files
authored
Remove usage of v1 Identity Server API (#3003)
* Remove usage of v1 Identity Server API It's been deprecated for over a year at this point - everyone should be able to support v2. * Missed one.
1 parent 0f717a9 commit 7d37bb1

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

spec/unit/autodiscovery.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ describe("AutoDiscovery", function () {
544544
.respond(200, {
545545
versions: ["r0.0.1"],
546546
});
547-
httpBackend.when("GET", "/_matrix/identity/api/v1").respond(404, {});
547+
httpBackend.when("GET", "/_matrix/identity/v2").respond(404, {});
548548
httpBackend.when("GET", "/.well-known/matrix/client").respond(200, {
549549
"m.homeserver": {
550550
// Note: we also expect this test to trim the trailing slash
@@ -591,7 +591,7 @@ describe("AutoDiscovery", function () {
591591
.respond(200, {
592592
versions: ["r0.0.1"],
593593
});
594-
httpBackend.when("GET", "/_matrix/identity/api/v1").respond(500, {});
594+
httpBackend.when("GET", "/_matrix/identity/v2").respond(500, {});
595595
httpBackend.when("GET", "/.well-known/matrix/client").respond(200, {
596596
"m.homeserver": {
597597
// Note: we also expect this test to trim the trailing slash
@@ -636,9 +636,9 @@ describe("AutoDiscovery", function () {
636636
versions: ["r0.0.1"],
637637
});
638638
httpBackend
639-
.when("GET", "/_matrix/identity/api/v1")
639+
.when("GET", "/_matrix/identity/v2")
640640
.check((req) => {
641-
expect(req.path).toEqual("https://identity.example.org/_matrix/identity/api/v1");
641+
expect(req.path).toEqual("https://identity.example.org/_matrix/identity/v2");
642642
})
643643
.respond(200, {});
644644
httpBackend.when("GET", "/.well-known/matrix/client").respond(200, {
@@ -682,9 +682,9 @@ describe("AutoDiscovery", function () {
682682
versions: ["r0.0.1"],
683683
});
684684
httpBackend
685-
.when("GET", "/_matrix/identity/api/v1")
685+
.when("GET", "/_matrix/identity/v2")
686686
.check((req) => {
687-
expect(req.path).toEqual("https://identity.example.org/_matrix/identity/api/v1");
687+
expect(req.path).toEqual("https://identity.example.org/_matrix/identity/v2");
688688
})
689689
.respond(200, {});
690690
httpBackend.when("GET", "/.well-known/matrix/client").respond(200, {

src/autodiscovery.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,9 @@ export class AutoDiscovery {
214214

215215
// Step 5b: Verify there is an identity server listening on the provided
216216
// URL.
217-
const isResponse = await this.fetchWellKnownObject(`${isUrl}/_matrix/identity/api/v1`);
217+
const isResponse = await this.fetchWellKnownObject(`${isUrl}/_matrix/identity/v2`);
218218
if (!isResponse?.raw || isResponse.action !== AutoDiscoveryAction.SUCCESS) {
219-
logger.error("Invalid /api/v1 response");
219+
logger.error("Invalid /v2 response");
220220
failingClientConfig["m.identity_server"].error = AutoDiscovery.ERROR_INVALID_IDENTITY_SERVER;
221221

222222
// Supply the base_url to the caller because they may be ignoring

src/http-api/prefix.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ export enum ClientPrefix {
3434
}
3535

3636
export enum IdentityPrefix {
37-
/**
38-
* URI path for v1 of the identity API
39-
* @deprecated Use v2.
40-
*/
41-
V1 = "/_matrix/identity/api/v1",
4237
/**
4338
* URI path for the v2 identity API
4439
*/

0 commit comments

Comments
 (0)