Skip to content

Support the new /auth_metadata endpoint defined in MSC2965.#18093

Merged
S7evinK merged 3 commits intodevelopfrom
quenting/msc2965-auth-metadata
Jan 21, 2025
Merged

Support the new /auth_metadata endpoint defined in MSC2965.#18093
S7evinK merged 3 commits intodevelopfrom
quenting/msc2965-auth-metadata

Conversation

@sandhose
Copy link
Copy Markdown
Member

@sandhose sandhose commented Jan 17, 2025

See the updated MSC2965

Copy link
Copy Markdown
Member

@anoadragon453 anoadragon453 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small nits and a question, but otherwise looks good!

(Would be nice to see some Complement tests for all this at some point at well.)

Comment on lines +118 to +125
req_mock = AsyncMock(
return_value={
"issuer": ISSUER,
"authorization_endpoint": "https://example.com/auth",
"token_endpoint": "https://example.com/token",
}
)
self.hs.get_proxied_http_client().get_json = req_mock # type: ignore[method-assign]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is mocking a request Synapse is supposed to be making externally, right? This one?

response = await self._http_client.get_json(url)

Just checking that we're not mocking the test http client and then immediately checking it returns the mocked data.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that's what's happening

@S7evinK S7evinK merged commit 048c1ac into develop Jan 21, 2025
@S7evinK S7evinK deleted the quenting/msc2965-auth-metadata branch January 21, 2025 12:48
Comment on lines +95 to +99
raise SynapseError(
404,
"OIDC discovery has not been configured on this homeserver",
Codes.NOT_FOUND,
)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spec would prefer M_UNRECOGNIZED with 404. https://spec.matrix.org/v1.13/client-server-api/#common-error-codes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants