summary refs log tree commit diff
diff options
context:
space:
mode:
authorQuentin Gliech <quenting@element.io>2024-07-11 16:28:27 +0200
committerQuentin Gliech <quenting@element.io>2024-07-11 16:28:27 +0200
commit0119d40b7da825096269fc3834cd62e04bc6ff1c (patch)
treea58221ee83bcbf939ac432c211e3a611b11767ba
parentMerge remote-tracking branch 'origin/develop' into quenting/msc3861-load-urls (diff)
downloadsynapse-quenting/msc3861-load-urls.tar.xz
-rw-r--r--synapse/api/auth/msc3861_delegated.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/synapse/api/auth/msc3861_delegated.py b/synapse/api/auth/msc3861_delegated.py
index 285a0395dd..ecda2a14f2 100644
--- a/synapse/api/auth/msc3861_delegated.py
+++ b/synapse/api/auth/msc3861_delegated.py
@@ -121,7 +121,9 @@ class MSC3861DelegatedAuth(BaseAuth):
         self._hostname = hs.hostname
         self._admin_token = self._config.admin_token
 
-        self._issuer_metadata = RetryOnExceptionCachedCall(self._load_metadata)
+        self._issuer_metadata = RetryOnExceptionCachedCall[OpenIDProviderMetadata](
+            self._load_metadata
+        )
 
         if isinstance(auth_method, PrivateKeyJWTWithKid):
             # Use the JWK as the client secret when using the private_key_jwt method
@@ -154,7 +156,7 @@ class MSC3861DelegatedAuth(BaseAuth):
         """
         issuer: Optional[str] = None
         try:
-            metadata = await self._load_metadata()
+            metadata = await self._issuer_metadata.get()
             issuer = metadata.issuer
         # We don't want to raise here if we can't load the metadata
         except Exception:
@@ -174,7 +176,7 @@ class MSC3861DelegatedAuth(BaseAuth):
             return self._config.account_management_url
 
         try:
-            metadata = await self._load_metadata()
+            metadata = await self._issuer_metadata.get()
             return metadata.get("account_management_uri", None)
         # We don't want to raise here if we can't load the metadata
         except Exception:
@@ -190,7 +192,7 @@ class MSC3861DelegatedAuth(BaseAuth):
         if self._config.introspection_endpoint is not None:
             return self._config.introspection_endpoint
 
-        metadata = await self._load_metadata()
+        metadata = await self._issuer_metadata.get()
         return metadata.get("introspection_endpoint")
 
     async def _introspect_token(self, token: str) -> IntrospectionToken: