summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2018-01-13 09:42:26 -0500
committerJason R. Coombs <jaraco@jaraco.com>2018-01-13 09:42:26 -0500
commit821e1553d080aac3c2441dd38909b1130e99e005 (patch)
treeb12fe7c51f24718bd3599b33a619a1c10eb9ad6d
parentf148b031e6fcbc90bb0701b5a326bd1127f47ec7 (diff)
downloadcherrypy-git-821e1553d080aac3c2441dd38909b1130e99e005.tar.gz
Deprecate basic_auth and digest_auth tools. Ref #1688.
-rw-r--r--cherrypy/lib/auth.py13
-rw-r--r--cherrypy/lib/httpauth.py2
2 files changed, 15 insertions, 0 deletions
diff --git a/cherrypy/lib/auth.py b/cherrypy/lib/auth.py
index 34ad6886..bb9e69fc 100644
--- a/cherrypy/lib/auth.py
+++ b/cherrypy/lib/auth.py
@@ -1,3 +1,11 @@
+"""
+Deprecated implementation of basic and digest auth.
+
+Look to auth_basic and auth_digest instead.
+"""
+
+import warnings
+
import cherrypy
from cherrypy.lib import httpauth
@@ -5,6 +13,11 @@ from cherrypy.lib import httpauth
def check_auth(users, encrypt=None, realm=None):
"""If an authorization header contains credentials, return True or False.
"""
+ msg = (
+ "`basic_auth` and `digest_auth` tools are deprecated. Use "
+ "`auth_basic` and `auth_digest` instead."
+ )
+ warnings.warn(msg, DeprecationWarning)
request = cherrypy.serving.request
if 'authorization' in request.headers:
# make sure the provided credentials are correctly set
diff --git a/cherrypy/lib/httpauth.py b/cherrypy/lib/httpauth.py
index 7e9fb035..e3a9b85e 100644
--- a/cherrypy/lib/httpauth.py
+++ b/cherrypy/lib/httpauth.py
@@ -1,4 +1,6 @@
"""
+Deprecated implementations of HTTP Digest Authentication
+
This module defines functions to implement HTTP Digest Authentication
(:rfc:`2617`).
This has full compliance with 'Digest' and 'Basic' authentication methods. In