From 052cb72b63b9f5a36f45a4135d1e1c05c10004dd Mon Sep 17 00:00:00 2001
From: Michael Merickel <github@m.merickel.org>
Date: Thu, 04 Oct 2018 18:26:11 +0200
Subject: [PATCH] Merge pull request #3369 from mmerickel/remove-deprecated-principal

---
 TODO.txt                       |    6 ------
 pyramid/tests/test_security.py |    7 -------
 pyramid/security.py            |   28 ++++++++--------------------
 CHANGES.rst                    |    9 ++++++++-
 4 files changed, 16 insertions(+), 34 deletions(-)

diff --git a/CHANGES.rst b/CHANGES.rst
index 2b08965..4f0de29 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -132,9 +132,16 @@
   See https://github.com/Pylons/pyramid/pull/3328
 
 - Removed ``pyramid.config.Configurator.set_request_property`` which had been
-  deprecated since Pyramid 1.5.
+  deprecated since Pyramid 1.5. Instead use
+  ``pyramid.config.Configurator.add_request_method`` with ``reify=True`` or
+  ``property=True``.
   See https://github.com/Pylons/pyramid/pull/3368
 
+- Removed the ``principal`` keyword argument from
+  ``pyramid.security.remember`` which had been deprecated since Pyramid 1.6
+  and replaced by the ``userid`` argument.
+  See https://github.com/Pylons/pyramid/pull/3369
+
 Documentation Changes
 ---------------------
 
diff --git a/TODO.txt b/TODO.txt
index 98934b0..3181719 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -111,12 +111,6 @@
          )
  
 
-Future
-------
-
-- 1.9: Remove extra code enabling ``pyramid.security.remember(principal=...)``
-  and force use of ``userid``.
-
 Probably Bad Ideas
 ------------------
 
diff --git a/pyramid/security.py b/pyramid/security.py
index 4e9672d..0bdca09 100644
--- a/pyramid/security.py
+++ b/pyramid/security.py
@@ -17,8 +17,6 @@
 Allow = 'Allow'
 Deny = 'Deny'
 
-_marker = object()
-
 class AllPermissionsList(object):
     """ Stand in 'permission list' to represent all permissions """
 
@@ -120,7 +118,7 @@
     '"effective_principals" attribute of the Pyramid request instead.'
     )
 
-def remember(request, userid=_marker, **kw):
+def remember(request, userid, **kw):
     """
     Returns a sequence of header tuples (e.g. ``[('Set-Cookie', 'foo=abc')]``)
     on this request's response.
@@ -143,24 +141,14 @@
     always return an empty sequence. If used, the composition and
     meaning of ``**kw`` must be agreed upon by the calling code and
     the effective authentication policy.
-    
-    .. deprecated:: 1.6
-        Renamed the ``principal`` argument to ``userid`` to clarify its
-        purpose.
+
+    .. versionchanged:: 1.6
+        Deprecated the ``principal`` argument in favor of ``userid`` to clarify
+        its relationship to the authentication policy.
+
+    .. versionchanged:: 1.10
+        Removed the deprecated ``principal`` argument.
     """
-    if userid is _marker:
-        principal = kw.pop('principal', _marker)
-        if principal is _marker:
-            raise TypeError(
-                'remember() missing 1 required positional argument: '
-                '\'userid\'')
-        else:
-            deprecated(
-                'principal',
-                'The "principal" argument was deprecated in Pyramid 1.6. '
-                'It will be removed in Pyramid 1.9. Use the "userid" '
-                'argument instead.')
-            userid = principal
     policy = _get_authentication_policy(request)
     if policy is None:
         return []
diff --git a/pyramid/tests/test_security.py b/pyramid/tests/test_security.py
index 1da73ff..e5399ec 100644
--- a/pyramid/tests/test_security.py
+++ b/pyramid/tests/test_security.py
@@ -183,13 +183,6 @@
         result = self._callFUT(request, 'me')
         self.assertEqual(result, [('X-Pyramid-Test', 'me')])
 
-    def test_with_deprecated_principal_arg(self):
-        request = _makeRequest()
-        registry = request.registry
-        _registerAuthenticationPolicy(registry, 'yo')
-        result = self._callFUT(request, principal='me')
-        self.assertEqual(result, [('X-Pyramid-Test', 'me')])
-
     def test_with_missing_arg(self):
         request = _makeRequest()
         registry = request.registry

--
Gitblit v1.9.3