-
Notifications
You must be signed in to change notification settings - Fork 401
Move oidc.load_metadata()
startup into _base.start()
#19056
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
base: develop
Are you sure you want to change the base?
Move oidc.load_metadata()
startup into _base.start()
#19056
Conversation
# Load the OIDC provider metadatas, if OIDC is enabled. | ||
if hs.config.oidc.oidc_enabled: | ||
oidc = hs.get_oidc_handler() | ||
# Loading the provider metadata also ensures the provider config is valid. | ||
# | ||
# FIXME: It feels a bit strange to validate and block on startup as one of these | ||
# OIDC providers could be temporarily unavailable and cause Synapse to be unable | ||
# to start. | ||
await oidc.load_metadata() |
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.
Previously, this lived in synapse/app/homeserver.py
-> setup()
which is only for the SynapseHomeServer
(main Synapse instance).
This has now moved to _base.start()
which means it will run on workers and the main Synapse instance.
I can't really tell if this should be only be run on the main instance or not. Kinda feels like we should validate the provider config on any Synapse instance. This will cause every instance to contact the providers to fetch the metadata.
handle_startup_exception(e) | ||
|
||
async def _start_when_reactor_running() -> None: | ||
# TODO: Feels like this should be moved somewhere else. |
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.
It's possible that the correct conclusion is that this belongs only on the main
Synapse instance (see #19056 (comment)). In that case, this PR should just remove this TODO
with some context on why.
Move
oidc.load_metadata()
startup into_base.start()
.Dev notes
oidc.load_metadata()
introduced in matrix-org/synapse#7256Pull Request Checklist
EventStore
toEventWorkerStore
.".code blocks
.