]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
auth: Deprecate unused client_secret parameter
authorBen Darnell <ben@bendarnell.com>
Mon, 19 Jun 2023 19:54:01 +0000 (15:54 -0400)
committerBen Darnell <ben@bendarnell.com>
Sat, 8 Jul 2023 00:38:00 +0000 (20:38 -0400)
OAuth2Mixin.authorize_redirect has never used this argument
and similar methods in this module don't have it.

Closes #1122

tornado/auth.py
tornado/test/auth_test.py

index 59501f56b7b4f7cf4e021fadbf1d7e572fae189e..97cfc93adadb22812a9bf2ccf978b87cf1239c66 100644 (file)
@@ -63,6 +63,7 @@ import hmac
 import time
 import urllib.parse
 import uuid
+import warnings
 
 from tornado import httpclient
 from tornado import escape
@@ -571,7 +572,13 @@ class OAuth2Mixin(object):
 
            The ``callback`` argument and returned awaitable were removed;
            this is now an ordinary synchronous function.
+
+        .. deprecated:: 6.4
+           The ``client_secret`` argument (which has never had any effect)
+           is deprecated and will be removed in Tornado 7.0.
         """
+        if client_secret is not None:
+            warnings.warn("client_secret argument is deprecated", DeprecationWarning)
         handler = cast(RequestHandler, self)
         args = {"response_type": response_type}
         if redirect_uri is not None:
index 3cd715f7336fcbea20e0f00ae426125a47d321d6..5eddb9803cd78f9f08689206cbf2c4b36b9d6100 100644 (file)
@@ -550,7 +550,6 @@ class GoogleLoginHandler(RequestHandler, GoogleOAuth2Mixin):
             self.authorize_redirect(
                 redirect_uri=self._OAUTH_REDIRECT_URI,
                 client_id=self.settings["google_oauth"]["key"],
-                client_secret=self.settings["google_oauth"]["secret"],
                 scope=["profile", "email"],
                 response_type="code",
                 extra_params={"prompt": "select_account"},