summaryrefslogtreecommitdiff
path: root/docs/topics
diff options
context:
space:
mode:
authorSirAbhi13 <abhinav.sny.2002@gmail.com>2022-11-30 12:33:36 +0530
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-12-09 12:44:48 +0100
commitb8738aea14446b267a47087b52b38a98b440a6aa (patch)
treec40b58040034ff32d22f8cd520611c81e4272c9d /docs/topics
parent3fec3bf90bef36b26efe5e47a92bf5a8041a207b (diff)
downloaddjango-b8738aea14446b267a47087b52b38a98b440a6aa.tar.gz
Fixed #33199 -- Deprecated passing positional arguments to Signer/TimestampSigner.
Thanks Jacob Walls for the implementation idea.
Diffstat (limited to 'docs/topics')
-rw-r--r--docs/topics/signing.txt14
1 files changed, 11 insertions, 3 deletions
diff --git a/docs/topics/signing.txt b/docs/topics/signing.txt
index 9ae5ca3351..0e88c443cc 100644
--- a/docs/topics/signing.txt
+++ b/docs/topics/signing.txt
@@ -96,12 +96,12 @@ By default, the ``Signer`` class uses the :setting:`SECRET_KEY` setting to
generate signatures. You can use a different secret by passing it to the
``Signer`` constructor::
- >>> signer = Signer('my-other-secret')
+ >>> signer = Signer(key='my-other-secret')
>>> value = signer.sign('My string')
>>> value
'My string:EkfQJafvGyiofrdGnuthdxImIJw'
-.. class:: Signer(key=None, sep=':', salt=None, algorithm=None, fallback_keys=None)
+.. class:: Signer(*, key=None, sep=':', salt=None, algorithm=None, fallback_keys=None)
Returns a signer which uses ``key`` to generate signatures and ``sep`` to
separate values. ``sep`` cannot be in the :rfc:`URL safe base64 alphabet
@@ -115,6 +115,10 @@ generate signatures. You can use a different secret by passing it to the
The ``fallback_keys`` argument was added.
+ .. deprecated:: 4.2
+
+ Support for passing positional arguments is deprecated.
+
Using the ``salt`` argument
---------------------------
@@ -172,7 +176,7 @@ created within a specified period of time::
>>> signer.unsign(value, max_age=timedelta(seconds=20))
'hello'
-.. class:: TimestampSigner(key=None, sep=':', salt=None, algorithm='sha256')
+.. class:: TimestampSigner(*, key=None, sep=':', salt=None, algorithm='sha256')
.. method:: sign(value)
@@ -195,6 +199,10 @@ created within a specified period of time::
otherwise raises ``SignatureExpired``. The ``max_age`` parameter can
accept an integer or a :py:class:`datetime.timedelta` object.
+ .. deprecated:: 4.2
+
+ Support for passing positional arguments is deprecated.
+
.. _signing-complex-data:
Protecting complex data structures