From 0bc0261527e410e350fe52e7dcad120cb7a58d9f Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Thu, 27 Feb 2020 21:56:32 -0600 Subject: first draft of whatsnew --- src/pyramid/config/security.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/pyramid/config/security.py b/src/pyramid/config/security.py index 8939cf62e..c63914fd0 100644 --- a/src/pyramid/config/security.py +++ b/src/pyramid/config/security.py @@ -60,8 +60,8 @@ class SecurityConfiguratorMixin: """ .. deprecated:: 2.0 - Authentication policies have been replaced by - security policies. See :ref:`upgrading_auth` for more information. + Authentication policies have been replaced by security policies. + See :ref:`upgrading_auth_20` for more information. Override the :app:`Pyramid` :term:`authentication policy` in the current configuration. The ``policy`` argument must be an instance @@ -121,8 +121,8 @@ class SecurityConfiguratorMixin: """ .. deprecated:: 2.0 - Authentication policies have been replaced by - security policies. See :ref:`upgrading_auth` for more information. + Authentication policies have been replaced by security policies. + See :ref:`upgrading_auth` for more information. Override the :app:`Pyramid` :term:`authorization policy` in the current configuration. The ``policy`` argument must be an instance -- cgit v1.2.3 From 7821fee97cd7611870d0e639aece8fa271c6e1ce Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Tue, 31 Mar 2020 22:08:01 -0500 Subject: namespace upgrading_auth since it's in the whatsnew doc --- src/pyramid/authorization.py | 2 +- src/pyramid/config/security.py | 2 +- src/pyramid/interfaces.py | 4 ++-- src/pyramid/security.py | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/pyramid/authorization.py b/src/pyramid/authorization.py index eadd46f85..2bef53ad9 100644 --- a/src/pyramid/authorization.py +++ b/src/pyramid/authorization.py @@ -60,7 +60,7 @@ class ACLAuthorizationPolicy: .. deprecated:: 2.0 Authorization policies have been deprecated by the new security system. - See :ref:`upgrading_auth` for more information. + See :ref:`upgrading_auth_20` for more information. """ diff --git a/src/pyramid/config/security.py b/src/pyramid/config/security.py index c63914fd0..59e8d0799 100644 --- a/src/pyramid/config/security.py +++ b/src/pyramid/config/security.py @@ -122,7 +122,7 @@ class SecurityConfiguratorMixin: .. deprecated:: 2.0 Authentication policies have been replaced by security policies. - See :ref:`upgrading_auth` for more information. + See :ref:`upgrading_auth_20` for more information. Override the :app:`Pyramid` :term:`authorization policy` in the current configuration. The ``policy`` argument must be an instance diff --git a/src/pyramid/interfaces.py b/src/pyramid/interfaces.py index 0b7a07040..29c5eb0da 100644 --- a/src/pyramid/interfaces.py +++ b/src/pyramid/interfaces.py @@ -535,7 +535,7 @@ class IAuthenticationPolicy(Interface): .. deprecated:: 2.0 Authentication policies have been removed in favor of security - policies. See :ref:`upgrading_auth` for more information. + policies. See :ref:`upgrading_auth_20` for more information. """ @@ -595,7 +595,7 @@ class IAuthorizationPolicy(Interface): .. deprecated:: 2.0 Authentication policies have been removed in favor of security - policies. See :ref:`upgrading_auth` for more information. + policies. See :ref:`upgrading_auth_20` for more information. """ diff --git a/src/pyramid/security.py b/src/pyramid/security.py index 9cdafaf6f..a0ab39701 100644 --- a/src/pyramid/security.py +++ b/src/pyramid/security.py @@ -85,7 +85,7 @@ def principals_allowed_by_permission(context, permission): .. deprecated:: 2.0 The new security policy has removed the concept of principals. See - :ref:`upgrading_auth` for more information. + :ref:`upgrading_auth_20` for more information. Provided a ``context`` (a resource object), and a ``permission`` string, if an :term:`authorization policy` is @@ -286,8 +286,8 @@ class AuthenticationAPIMixin: .. deprecated:: 2.0 ``unauthenticated_userid`` does not have an equivalent in the new - security system. Use :attr:`.authenticated_userid` or - :attr:`.identity` instead. See :ref:`upgrading_auth` for more + security system. Use :attr:`.authenticated_userid` or + :attr:`.identity` instead. See :ref:`upgrading_auth_20` for more information. Return an object which represents the *claimed* (not verified) user @@ -322,7 +322,7 @@ class AuthenticationAPIMixin: .. deprecated:: 2.0 The new security policy has removed the concept of principals. See - :ref:`upgrading_auth` for more information. + :ref:`upgrading_auth_20` for more information. Return the list of 'effective' :term:`principal` identifiers for the ``request``. If no :term:`authentication policy` is in effect, -- cgit v1.2.3 From 46a9c339cdbdf9e78f585026054e3ecdba2ee53d Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Sat, 28 Nov 2020 22:54:49 -0600 Subject: add examples for upgrading --- src/pyramid/interfaces.py | 2 +- src/pyramid/session.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/pyramid/interfaces.py b/src/pyramid/interfaces.py index 29c5eb0da..cd2818c22 100644 --- a/src/pyramid/interfaces.py +++ b/src/pyramid/interfaces.py @@ -1139,7 +1139,7 @@ class ISession(IDict): support types that can be serialized using JSON. It's recommended to switch any session implementations to support only JSON and to only store primitive types in sessions. See - :ref:`pickle_session_deprecation` for more information about why this + :ref:`upgrading_session_20` for more information about why this change was made. .. versionchanged:: 1.9 diff --git a/src/pyramid/session.py b/src/pyramid/session.py index 8c27aa674..032d58a8b 100644 --- a/src/pyramid/session.py +++ b/src/pyramid/session.py @@ -51,7 +51,7 @@ class PickleSerializer: Pyramid will require JSON-serializable objects in :app:`Pyramid` 2.0. - Please see :ref:`pickle_session_deprecation`. + Please see :ref:`upgrading_session_20`. A serializer that uses the pickle protocol to dump Python data to bytes. @@ -456,7 +456,7 @@ def SignedCookieSessionFactory( In :app:`Pyramid` 2.0 the default ``serializer`` option changed to use :class:`pyramid.session.JSONSerializer`. See - :ref:`pickle_session_deprecation` for more information about why this + :ref:`upgrading_session_20` for more information about why this change was made. .. versionadded: 1.5a3 -- cgit v1.2.3 From 30cd9bcee5115f18f1d20eaa74a7e5753260f0ac Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Sat, 28 Nov 2020 23:13:33 -0600 Subject: fix a few references --- src/pyramid/interfaces.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/pyramid/interfaces.py b/src/pyramid/interfaces.py index cd2818c22..6704f7c7c 100644 --- a/src/pyramid/interfaces.py +++ b/src/pyramid/interfaces.py @@ -116,7 +116,7 @@ class IResponse(Interface): identity = Attribute( """An object containing authentication information related to the current request. The object's type and meaning is defined by the - configured security policy.""" + configured :term:`security policy`.""" ) authenticated_userid = Attribute( @@ -245,7 +245,11 @@ class IResponse(Interface): is_authenticated = Attribute( """A boolean indicating whether the request has an authenticated - user, as determined by the security policy in use.""" + user, as determined by the security policy in use. + + The value is determined by the result of + :attr:`pyramid.request.Request.authenticated_userid`. + """ ) last_modified = Attribute( @@ -506,6 +510,9 @@ class ISecurityPolicy(Interface): def authenticated_userid(request): """Return a :term:`userid` string identifying the trusted and verified user, or ``None`` if unauthenticated. + + If the result is ``None``, then + :attr:`pyramid.request.Request.is_authenticated` will return ``False``. """ def permits(request, context, permission): -- cgit v1.2.3