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

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

Merged
merged 3 commits into from
Jan 21, 2025

Conversation

sandhose
Copy link
Member

@sandhose sandhose commented Jan 17, 2025

See the updated MSC2965

Copy link
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.)

synapse/rest/client/auth_metadata.py Outdated Show resolved Hide resolved
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
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
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

changelog.d/18093.feature Outdated Show resolved Hide resolved
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
@S7evinK S7evinK merged commit 048c1ac into develop Jan 21, 2025
37 of 39 checks passed
@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
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