-
Notifications
You must be signed in to change notification settings - Fork 235
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
Conversation
There was a problem hiding this 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.)
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] |
There was a problem hiding this comment.
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?
synapse/synapse/api/auth/msc3861_delegated.py
Line 145 in ca290d3
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.
There was a problem hiding this comment.
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
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
raise SynapseError( | ||
404, | ||
"OIDC discovery has not been configured on this homeserver", | ||
Codes.NOT_FOUND, | ||
) |
There was a problem hiding this comment.
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
See the updated MSC2965