- 
                Notifications
    You must be signed in to change notification settings 
- Fork 405
          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?
Changes from all commits
608a116
              ac3a514
              91c0685
              b142996
              f450a68
              3385725
              938f2ec
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Move `oidc.load_metadata()` startup into `_base.start()`. | ||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -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() | ||
| 
      Comment on lines
    
      +651
     to 
      +659
    
   There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Previously, this lived in  This has now moved to  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. | ||
|  | ||
| # Load the certificate from disk. | ||
| refresh_certificate(hs) | ||
|  | ||
|  | ||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -420,13 +420,12 @@ def setup( | |
| 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 commentThe 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  | ||
| # | ||
| # 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() | ||
| """ | ||
| Things that should run when starting the `SynapseHomeServer` (main homeserver | ||
| process) should live here. | ||
|  | ||
| Should be called once the reactor is running. | ||
| """ | ||
|  | ||
| await _base.start(hs, freeze) | ||
|  | ||
|  | ||
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.
Typechecking job failing seems unrelated -> #19117