summary refs log tree commit diff
path: root/synapse/handlers/oidc_handler.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-10-19 18:23:05 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2020-10-19 18:23:05 +0100
commitdb233aaa6486302928f1ff6781fe43ad08b66f17 (patch)
tree30dc9c1ea3f6ec72fbe84ccd5cb676647c605048 /synapse/handlers/oidc_handler.py
parentMerge commit '04faa0bfa' into anoa/dinsic_release_1_21_x (diff)
parentFix typing for notifier (#8064) (diff)
downloadsynapse-db233aaa6486302928f1ff6781fe43ad08b66f17.tar.xz
Merge commit '9d1e4942a' into anoa/dinsic_release_1_21_x
* commit '9d1e4942a':
  Fix typing for notifier (#8064)
  Add comment explaining cast
  Handle optional dependencies for Oidc and Saml
  Newsfile
  Change HomeServer definition to work with typing.
Diffstat (limited to 'synapse/handlers/oidc_handler.py')
-rw-r--r--synapse/handlers/oidc_handler.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/synapse/handlers/oidc_handler.py b/synapse/handlers/oidc_handler.py

index 87f0c5e197..fa5ee5de8f 100644 --- a/synapse/handlers/oidc_handler.py +++ b/synapse/handlers/oidc_handler.py
@@ -14,7 +14,7 @@ # limitations under the License. import json import logging -from typing import Dict, Generic, List, Optional, Tuple, TypeVar +from typing import TYPE_CHECKING, Dict, Generic, List, Optional, Tuple, TypeVar from urllib.parse import urlencode import attr @@ -39,9 +39,11 @@ from synapse.http.server import respond_with_html from synapse.http.site import SynapseRequest from synapse.logging.context import make_deferred_yieldable from synapse.push.mailer import load_jinja2_templates -from synapse.server import HomeServer from synapse.types import UserID, map_username_to_mxid_localpart +if TYPE_CHECKING: + from synapse.server import HomeServer + logger = logging.getLogger(__name__) SESSION_COOKIE_NAME = b"oidc_session" @@ -91,7 +93,7 @@ class OidcHandler: """Handles requests related to the OpenID Connect login flow. """ - def __init__(self, hs: HomeServer): + def __init__(self, hs: "HomeServer"): self._callback_url = hs.config.oidc_callback_url # type: str self._scopes = hs.config.oidc_scopes # type: List[str] self._client_auth = ClientAuth(