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

Remove usage of v1 Identity Server API #3003

Merged
merged 2 commits into from
Jan 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions spec/unit/autodiscovery.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ describe("AutoDiscovery", function () {
.respond(200, {
versions: ["r0.0.1"],
});
httpBackend.when("GET", "/_matrix/identity/api/v1").respond(404, {});
httpBackend.when("GET", "/_matrix/identity/v2").respond(404, {});
httpBackend.when("GET", "/.well-known/matrix/client").respond(200, {
"m.homeserver": {
// Note: we also expect this test to trim the trailing slash
Expand Down Expand Up @@ -591,7 +591,7 @@ describe("AutoDiscovery", function () {
.respond(200, {
versions: ["r0.0.1"],
});
httpBackend.when("GET", "/_matrix/identity/api/v1").respond(500, {});
httpBackend.when("GET", "/_matrix/identity/v2").respond(500, {});
httpBackend.when("GET", "/.well-known/matrix/client").respond(200, {
"m.homeserver": {
// Note: we also expect this test to trim the trailing slash
Expand Down Expand Up @@ -636,9 +636,9 @@ describe("AutoDiscovery", function () {
versions: ["r0.0.1"],
});
httpBackend
.when("GET", "/_matrix/identity/api/v1")
.when("GET", "/_matrix/identity/v2")
.check((req) => {
expect(req.path).toEqual("https://identity.example.org/_matrix/identity/api/v1");
expect(req.path).toEqual("https://identity.example.org/_matrix/identity/v2");
})
.respond(200, {});
httpBackend.when("GET", "/.well-known/matrix/client").respond(200, {
Expand Down Expand Up @@ -682,9 +682,9 @@ describe("AutoDiscovery", function () {
versions: ["r0.0.1"],
});
httpBackend
.when("GET", "/_matrix/identity/api/v1")
.when("GET", "/_matrix/identity/v2")
.check((req) => {
expect(req.path).toEqual("https://identity.example.org/_matrix/identity/api/v1");
expect(req.path).toEqual("https://identity.example.org/_matrix/identity/v2");
})
.respond(200, {});
httpBackend.when("GET", "/.well-known/matrix/client").respond(200, {
Expand Down
4 changes: 2 additions & 2 deletions src/autodiscovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ export class AutoDiscovery {

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

// Supply the base_url to the caller because they may be ignoring
Expand Down
5 changes: 0 additions & 5 deletions src/http-api/prefix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ export enum ClientPrefix {
}

export enum IdentityPrefix {
/**
* URI path for v1 of the identity API
* @deprecated Use v2.
*/
V1 = "/_matrix/identity/api/v1",
/**
* URI path for the v2 identity API
*/
Expand Down