Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
backends: Add missing @override declarations.
Anders Kaseorg302b961ec12c
diff --git a/zproject/backends.py b/zproject/backends.pyindex 56cded1e64d..8a9b91aa572 100644--- a/zproject/backends.py+++ b/zproject/backends.py@@ -2083,6 +2083,7 @@ class SocialAuthMixin(ZulipAuthMixin, ExternalAuthMethod, BaseAuth):standard_relay_params = [*settings.SOCIAL_AUTH_FIELDS_STORED_IN_SESSION, "next"]+ @overridedef auth_complete(self, *args: Any, **kwargs: Any) -> HttpResponse | None:"""This is a small wrapper around the core `auth_complete` method ofpython-social-auth, designed primarily to prevent 500s for@@ -2197,6 +2198,7 @@ class GitHubAuthBackend(SocialAuthMixin, GithubOAuth2):)]+ @overridedef user_data(self, access_token: str, *args: Any, **kwargs: Any) -> dict[str, str]:"""This patched user_data function lets us combine together the 3social auth backends into a single Zulip backend for GitHub OAuth2"""@@ -2330,6 +2332,7 @@ class AppleAuthBackend(SocialAuthMixin, AppleIdAuth):# This method replaces a method from python-social-auth; it is adapted to store# the state_token data in Redis.+ @overridedef get_or_create_state(self) -> str:"""Creates the Oauth2 state parameter in first step of the flow,before redirecting the user to the IdP (aka Apple).@@ -2365,6 +2368,7 @@ class AppleAuthBackend(SocialAuthMixin, AppleIdAuth):)return state+ @overridedef validate_state(self) -> str | None:"""This method replaces a method from python-social-auth; it is@@ -2390,6 +2394,7 @@ class AppleAuthBackend(SocialAuthMixin, AppleIdAuth):self.strategy.session_set(param, value)return request_state+ @overridedef get_user_details(self, response: dict[str, Any]) -> dict[str, Any]:"""Overridden to correctly grab the user's name from the request params,@@ -2465,6 +2470,7 @@ class AppleAuthBackend(SocialAuthMixin, AppleIdAuth):class ZulipSAMLIdentityProvider(SAMLIdentityProvider):+ @overridedef get_user_details(self, attributes: dict[str, Any]) -> dict[str, Any]:"""Overridden to support plumbing of additional Attributes@@ -2669,12 +2675,14 @@ class SAMLAuthBackend(SocialAuthMixin, SAMLAuth):del settings.SOCIAL_AUTH_SAML_ENABLED_IDPS[idp_name]super().__init__(*args, **kwargs)+ @overridedef get_idp(self, idp_name: str) -> ZulipSAMLIdentityProvider:"""Given the name of an IdP, get a SAMLIdentityProvider instance.Forked to use our subclass of SAMLIdentityProvider for more flexibility."""idp_config = self.setting("ENABLED_IDPS")[idp_name]return ZulipSAMLIdentityProvider(idp_name, **idp_config)+ @overridedef auth_url(self) -> str:"""Get the URL to which we must redirect in order toauthenticate the user. Overriding the original SAMLAuth.auth_url.@@ -2764,6 +2772,7 @@ class SAMLAuthBackend(SocialAuthMixin, SAMLAuth):else:return request_subdomain+ @overridedef _check_entitlements(self, idp: SAMLIdentityProvider, attributes: dict[str, list[str]]) -> None:@@ -3107,6 +3116,7 @@ class GenericOpenIdConnectBackend(SocialAuthMixin, OpenIdConnectAuth):# configuration from.OIDC_ENDPOINT = settings_dict.get("oidc_url")+ @overridedef get_key_and_secret(self) -> tuple[str, str]:client_id = self.settings_dict.get("client_id", "")assert isinstance(client_id, str)