From 13734ad645514e28236a200b12c72756ea491477 Mon Sep 17 00:00:00 2001 From: Hong Yuan Date: Fri, 16 Mar 2018 09:20:01 +0800 Subject: Fix secret length in doc of SignedCookieSessionFactory --- pyramid/session.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyramid/session.py b/pyramid/session.py index 33119343b..4a9c8c100 100644 --- a/pyramid/session.py +++ b/pyramid/session.py @@ -141,7 +141,7 @@ def BaseCookieSessionFactory( ): """ .. versionadded:: 1.5 - + Configure a :term:`session factory` which will provide cookie-based sessions. The return value of this function is a :term:`session factory`, which may be provided as the ``session_factory`` argument of a @@ -393,7 +393,7 @@ def UnencryptedCookieSessionFactoryConfig( compatible with cookies generated using ``UnencryptedCookieSessionFactory``, so existing user session data will be destroyed if you switch to it. - + Configure a :term:`session factory` which will provide unencrypted (but signed) cookie-based sessions. The return value of this function is a :term:`session factory`, which may be provided as @@ -452,7 +452,7 @@ def UnencryptedCookieSessionFactoryConfig( class SerializerWrapper(object): def __init__(self, secret): self.secret = secret - + def loads(self, bstruct): return signed_deserialize(bstruct, secret) @@ -500,7 +500,7 @@ def SignedCookieSessionFactory( ): """ .. versionadded:: 1.5 - + Configure a :term:`session factory` which will provide signed cookie-based sessions. The return value of this function is a :term:`session factory`, which may be provided as @@ -519,7 +519,7 @@ def SignedCookieSessionFactory( ``secret`` A string which is used to sign the cookie. The secret should be at least as long as the block size of the selected hash algorithm. For - ``sha512`` this would mean a 128 bit (64 character) secret. It should + ``sha512`` this would mean a 512 bit (64 character) secret. It should be unique within the set of secret values provided to Pyramid for its various subsystems (see :ref:`admonishment_against_secret_sharing`). -- cgit v1.2.3 From fab055d611f44c5196d1b5acda3fce712fef62dc Mon Sep 17 00:00:00 2001 From: jonathan vanasco Date: Wed, 11 Apr 2018 13:42:58 -0400 Subject: updated docs/interfaces to note change in webob 1.7 of `set_cookie(key` to `set_cookie(name` --- docs/narr/webob.rst | 2 +- pyramid/interfaces.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/narr/webob.rst b/docs/narr/webob.rst index 406351562..5fd19e417 100644 --- a/docs/narr/webob.rst +++ b/docs/narr/webob.rst @@ -406,7 +406,7 @@ Here are some highlights: ``response.text``. ``response.content_type_params`` is a dictionary of all the parameters. -``response.set_cookie(key, value, max_age=None, path='/', ...)`` +``response.set_cookie(name, value, max_age=None, path='/', ...)`` Set a cookie. The keyword arguments control the various cookie parameters. The ``max_age`` argument is the length for the cookie to live in seconds (you may also use a timedelta object). The ``Expires`` key will also be diff --git a/pyramid/interfaces.py b/pyramid/interfaces.py index e9cc007ac..5aa3fc20b 100644 --- a/pyramid/interfaces.py +++ b/pyramid/interfaces.py @@ -244,7 +244,7 @@ class IResponse(Interface): """ Gets and sets and deletes the Server header. For more information on Server see RFC216 section 14.38. """) - def set_cookie(key, value='', max_age=None, path='/', domain=None, + def set_cookie(name, value='', max_age=None, path='/', domain=None, secure=False, httponly=False, comment=None, expires=None, overwrite=False): """ Set (add) a cookie for the response """ -- cgit v1.2.3 From 41662fd21a3f4f41684a92c904750543987b87da Mon Sep 17 00:00:00 2001 From: jonathan vanasco Date: Wed, 11 Apr 2018 17:39:03 -0400 Subject: updated `delete_cookie` docs with `name` instead of `key` --- docs/narr/webob.rst | 2 +- pyramid/interfaces.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/narr/webob.rst b/docs/narr/webob.rst index 5fd19e417..4efe783b0 100644 --- a/docs/narr/webob.rst +++ b/docs/narr/webob.rst @@ -412,7 +412,7 @@ Here are some highlights: (you may also use a timedelta object). The ``Expires`` key will also be set based on the value of ``max_age``. -``response.delete_cookie(key, path='/', domain=None)`` +``response.delete_cookie(name, path='/', domain=None)`` Delete a cookie from the client. This sets ``max_age`` to 0 and the cookie value to ``''``. diff --git a/pyramid/interfaces.py b/pyramid/interfaces.py index 5aa3fc20b..765a63ada 100644 --- a/pyramid/interfaces.py +++ b/pyramid/interfaces.py @@ -259,7 +259,7 @@ class IResponse(Interface): """ Get/set the unicode value of the body (using the charset of the Content-Type)""") - def unset_cookie(key, strict=True): + def unset_cookie(name, strict=True): """ Unset a cookie with the given name (remove it from the response).""" -- cgit v1.2.3 From 073facffe63ddb9f73106bec4266d4783bb32132 Mon Sep 17 00:00:00 2001 From: jonathan vanasco Date: Wed, 11 Apr 2018 20:24:45 -0400 Subject: updated unset_cookie --- pyramid/interfaces.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyramid/interfaces.py b/pyramid/interfaces.py index 765a63ada..bedfb60b3 100644 --- a/pyramid/interfaces.py +++ b/pyramid/interfaces.py @@ -180,7 +180,7 @@ class IResponse(Interface): """Gets and sets and deletes the Date header. For more information on Date see RFC 2616 section 14.18. Converts using HTTP date.""") - def delete_cookie(key, path='/', domain=None): + def delete_cookie(name, path='/', domain=None): """ Delete a cookie from the client. Note that path and domain must match how the cookie was originally set. This sets the cookie to the empty string, and max_age=0 so that it should expire immediately. """ -- cgit v1.2.3