[pyramid] Drop retrieval of auth/session secret in all-in-one.conf
authorDenis Laxalde <denis.laxalde@logilab.fr>
Mon, 27 Feb 2017 14:49:32 +0100
changeset 11993 07af2c2c264b
parent 11992 fa1837a85708
child 11994 c1a6b18c141f
[pyramid] Drop retrieval of auth/session secret in all-in-one.conf We actually never supported this in cubicweb, but only in pyramid-cubicweb.
cubicweb/pyramid/auth.py
cubicweb/pyramid/session.py
--- a/cubicweb/pyramid/auth.py	Mon Feb 27 09:06:23 2017 +0100
+++ b/cubicweb/pyramid/auth.py	Mon Feb 27 14:49:32 2017 +0100
@@ -128,20 +128,10 @@
         session_prefix = 'cubicweb.auth.authtkt.session.'
         persistent_prefix = 'cubicweb.auth.authtkt.persistent.'
 
-        try:
-            secret = config.registry['cubicweb.config']['pyramid-auth-secret']
-            warnings.warn(
-                "pyramid-auth-secret from all-in-one is now "
-                "cubicweb.auth.authtkt.[session|persistent].secret",
-                DeprecationWarning)
-        except:
-            secret = 'notsosecret'
-
         session_secret = settings.get(
-            session_prefix + 'secret', secret)
+            session_prefix + 'secret', 'notsosecret')
         persistent_secret = settings.get(
-            persistent_prefix + 'secret', secret)
-
+            persistent_prefix + 'secret', 'notsosecret')
         if 'notsosecret' in (session_secret, persistent_secret):
             warnings.warn('''
 
--- a/cubicweb/pyramid/session.py	Mon Feb 27 09:06:23 2017 +0100
+++ b/cubicweb/pyramid/session.py	Mon Feb 27 14:49:32 2017 +0100
@@ -187,15 +187,9 @@
     See also :ref:`defaults_module`
     """
     settings = config.registry.settings
-    secret = settings.get('cubicweb.session.secret', '')
-    if not secret:
-        secret = config.registry['cubicweb.config'].get('pyramid-session-secret')
-        warnings.warn('''
-        Please migrate pyramid-session-secret from
-        all-in-one.conf to cubicweb.session.secret config entry in
-        your pyramid.ini file.
-        ''')
-    if not secret:
+    try:
+        secret = settings['cubicweb.session.secret']
+    except KeyError:
         secret = 'notsosecret'
         warnings.warn('''