mirror of
https://github.com/element-hq/synapse.git
synced 2025-12-28 06:47:37 +00:00
Move oidc.load_metadata() startup into _base.start() (#19056)
Slightly related to ["clean-tenant provisioning"](https://github.com/element-hq/synapse-small-hosts/issues/221) as making startup cleaner, makes it more clear how to handle clean provisioning.
This commit is contained in:
parent
e02a6f5e5d
commit
891acfd502
1
changelog.d/19056.misc
Normal file
1
changelog.d/19056.misc
Normal file
@ -0,0 +1 @@
|
||||
Move `oidc.load_metadata()` startup into `_base.start()`.
|
||||
@ -648,6 +648,16 @@ async def start(hs: "HomeServer", *, freeze: bool = True) -> None:
|
||||
# Apply the cache config.
|
||||
hs.config.caches.resize_all_caches()
|
||||
|
||||
# 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()
|
||||
|
||||
# Load the certificate from disk.
|
||||
refresh_certificate(hs)
|
||||
|
||||
|
||||
@ -447,14 +447,6 @@ async def start(
|
||||
False otherwise the homeserver cannot be garbage collected after `shutdown`.
|
||||
"""
|
||||
|
||||
# TODO: Feels like this should be moved somewhere else.
|
||||
#
|
||||
# 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.
|
||||
await oidc.load_metadata()
|
||||
|
||||
await _base.start(hs, freeze=freeze)
|
||||
|
||||
# TODO: Feels like this should be moved somewhere else.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user