Hello community,

here is the log from the commit of package python-django_openstack_auth for 
openSUSE:Factory checked in at 2013-09-27 18:01:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-django_openstack_auth (Old)
 and      /work/SRC/openSUSE:Factory/.python-django_openstack_auth.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-django_openstack_auth"

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-django_openstack_auth/python-django_openstack_auth.changes
        2013-09-16 12:44:32.000000000 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-django_openstack_auth.new/python-django_openstack_auth.changes
   2013-09-27 18:01:24.000000000 +0200
@@ -1,0 +2,6 @@
+Tue Sep 17 08:45:26 UTC 2013 - [email protected]
+
+- update to 1.1.2:
+  * Try to scope token for all available projects
+
+-------------------------------------------------------------------

Old:
----
  django_openstack_auth-1.1.1.tar.gz

New:
----
  django_openstack_auth-1.1.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-django_openstack_auth.spec ++++++
--- /var/tmp/diff_new_pack.qkCMxp/_old  2013-09-27 18:01:24.000000000 +0200
+++ /var/tmp/diff_new_pack.qkCMxp/_new  2013-09-27 18:01:24.000000000 +0200
@@ -17,13 +17,14 @@
 
 
 Name:           python-django_openstack_auth
-Version:        1.1.1
+Version:        1.1.2
 Release:        0
 Summary:        A Django auth backend for use with the OpenStack Keystone
 License:        BSD-3-Clause
 Group:          Development/Languages/Python
 Url:            http://django_openstack_auth.readthedocs.org/
 Source:         
http://pypi.python.org/packages/source/d/django_openstack_auth/django_openstack_auth-%{version}.tar.gz
+BuildRequires:  python-Babel
 BuildRequires:  python-devel
 # Documentation requirements:
 BuildRequires:  python-Sphinx

++++++ django_openstack_auth-1.1.1.tar.gz -> django_openstack_auth-1.1.2.tar.gz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django_openstack_auth-1.1.1/PKG-INFO 
new/django_openstack_auth-1.1.2/PKG-INFO
--- old/django_openstack_auth-1.1.1/PKG-INFO    2013-08-01 20:21:26.000000000 
+0200
+++ new/django_openstack_auth-1.1.2/PKG-INFO    2013-09-04 22:12:53.000000000 
+0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: django_openstack_auth
-Version: 1.1.1
+Version: 1.1.2
 Summary: A Django authentication backend for use with the OpenStack Keystone 
Identity backend.
 Home-page: http://django_openstack_auth.readthedocs.org/
 Author: Gabriel Hurley
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/django_openstack_auth-1.1.1/django_openstack_auth.egg-info/PKG-INFO 
new/django_openstack_auth-1.1.2/django_openstack_auth.egg-info/PKG-INFO
--- old/django_openstack_auth-1.1.1/django_openstack_auth.egg-info/PKG-INFO     
2013-08-01 20:21:22.000000000 +0200
+++ new/django_openstack_auth-1.1.2/django_openstack_auth.egg-info/PKG-INFO     
2013-09-04 22:12:53.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: django-openstack-auth
-Version: 1.1.1
+Version: 1.1.2
 Summary: A Django authentication backend for use with the OpenStack Keystone 
Identity backend.
 Home-page: http://django_openstack_auth.readthedocs.org/
 Author: Gabriel Hurley
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/django_openstack_auth-1.1.1/openstack_auth/__init__.py 
new/django_openstack_auth-1.1.2/openstack_auth/__init__.py
--- old/django_openstack_auth-1.1.1/openstack_auth/__init__.py  2013-08-01 
20:20:50.000000000 +0200
+++ new/django_openstack_auth-1.1.2/openstack_auth/__init__.py  2013-09-04 
22:12:33.000000000 +0200
@@ -1,2 +1,2 @@
 # following PEP 386
-__version__ = "1.1.1"
+__version__ = "1.1.2"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/django_openstack_auth-1.1.1/openstack_auth/backend.py 
new/django_openstack_auth-1.1.2/openstack_auth/backend.py
--- old/django_openstack_auth-1.1.1/openstack_auth/backend.py   2013-08-01 
20:20:50.000000000 +0200
+++ new/django_openstack_auth-1.1.2/openstack_auth/backend.py   2013-09-04 
22:12:33.000000000 +0200
@@ -126,10 +126,9 @@
                         keystone_exceptions.AuthorizationFailure):
                     auth_ref = None
 
-                if auth_ref is None:
-                    msg = _("Unable to authenticate to any available"
-                            " projects.")
-                    raise KeystoneAuthException(msg)
+            if auth_ref is None:
+                msg = _("Unable to authenticate to any available projects.")
+                raise KeystoneAuthException(msg)
 
         # Check expiry for our new scoped token.
         self.check_auth_expiry(auth_ref)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/django_openstack_auth-1.1.1/openstack_auth/tests/tests.py 
new/django_openstack_auth-1.1.2/openstack_auth/tests/tests.py
--- old/django_openstack_auth-1.1.1/openstack_auth/tests/tests.py       
2013-08-01 20:20:50.000000000 +0200
+++ new/django_openstack_auth-1.1.2/openstack_auth/tests/tests.py       
2013-09-04 22:12:33.000000000 +0200
@@ -74,6 +74,105 @@
         response = self.client.post(url, form_data)
         self.assertRedirects(response, settings.LOGIN_REDIRECT_URL)
 
+    def test_login_with_disabled_tenants(self):
+        # Test to validate that authentication will try to get
+        # scoped token if the first project is disabled.
+        tenants = [self.data.tenant_one, self.data.tenant_two]
+        user = self.data.user
+        unscoped = self.data.unscoped_access_info
+
+        form_data = {'region': settings.OPENSTACK_KEYSTONE_URL,
+                     'domain': DEFAULT_DOMAIN,
+                     'password': user.password,
+                     'username': user.name}
+
+        self.mox.StubOutWithMock(self.ks_client_module, "Client")
+        self.mox.StubOutWithMock(self.keystone_client_unscoped.tenants, "list")
+
+        self.ks_client_module.Client(auth_url=settings.OPENSTACK_KEYSTONE_URL,
+                                     password=user.password,
+                                     username=user.name,
+                                     user_domain_name=DEFAULT_DOMAIN,
+                                     insecure=False,
+                                     debug=False)\
+                .AndReturn(self.keystone_client_unscoped)
+        self.keystone_client_unscoped.tenants.list().AndReturn(tenants)
+        exc = keystone_exceptions.AuthorizationFailure
+        self.ks_client_module.Client(auth_url=settings.OPENSTACK_KEYSTONE_URL,
+                                     tenant_id=self.data.tenant_two.id,
+                                     insecure=False,
+                                     token=unscoped.auth_token,
+                                     debug=False) \
+                .AndRaise(exc)
+        self.ks_client_module.Client(auth_url=settings.OPENSTACK_KEYSTONE_URL,
+                                     tenant_id=self.data.tenant_one.id,
+                                     insecure=False,
+                                     token=unscoped.auth_token,
+                                     debug=False) \
+                .AndReturn(self.keystone_client_scoped)
+
+        self.mox.ReplayAll()
+
+        url = reverse('login')
+
+        # GET the page to set the test cookie.
+        response = self.client.get(url, form_data)
+        self.assertEqual(response.status_code, 200)
+
+        # POST to the page to log in.
+        response = self.client.post(url, form_data)
+        self.assertRedirects(response, settings.LOGIN_REDIRECT_URL)
+
+    def test_no_enabled_tenants(self):
+        tenants = [self.data.tenant_one, self.data.tenant_two]
+        user = self.data.user
+        unscoped = self.data.unscoped_access_info
+
+        form_data = {'region': settings.OPENSTACK_KEYSTONE_URL,
+                     'domain': DEFAULT_DOMAIN,
+                     'password': user.password,
+                     'username': user.name}
+
+        self.mox.StubOutWithMock(self.ks_client_module, "Client")
+        self.mox.StubOutWithMock(self.keystone_client_unscoped.tenants, "list")
+
+        self.ks_client_module.Client(auth_url=settings.OPENSTACK_KEYSTONE_URL,
+                                     password=user.password,
+                                     username=user.name,
+                                     user_domain_name=DEFAULT_DOMAIN,
+                                     insecure=False,
+                                     debug=False)\
+                .AndReturn(self.keystone_client_unscoped)
+        self.keystone_client_unscoped.tenants.list().AndReturn(tenants)
+        exc = keystone_exceptions.AuthorizationFailure
+        self.ks_client_module.Client(auth_url=settings.OPENSTACK_KEYSTONE_URL,
+                                     tenant_id=self.data.tenant_two.id,
+                                     insecure=False,
+                                     token=unscoped.auth_token,
+                                     debug=False) \
+                .AndRaise(exc)
+        self.ks_client_module.Client(auth_url=settings.OPENSTACK_KEYSTONE_URL,
+                                     tenant_id=self.data.tenant_one.id,
+                                     insecure=False,
+                                     token=unscoped.auth_token,
+                                     debug=False) \
+                .AndRaise(exc)
+
+        self.mox.ReplayAll()
+
+        url = reverse('login')
+
+        # GET the page to set the test cookie.
+        response = self.client.get(url, form_data)
+        self.assertEqual(response.status_code, 200)
+
+        # POST to the page to log in.
+        response = self.client.post(url, form_data)
+        self.assertTemplateUsed(response, 'auth/login.html')
+        self.assertContains(response,
+                            'Unable to authenticate to any available'
+                            ' projects.')
+
     def test_no_tenants(self):
         user = self.data.user
 
@@ -243,7 +342,6 @@
         self.test_switch(next='/next_url')
 
     def test_switch_region(self, next=None):
-        tenant = self.data.tenant_one
         tenants = [self.data.tenant_one, self.data.tenant_two]
         user = self.data.user
         unscoped = self.data.unscoped_access_info
@@ -369,7 +467,108 @@
         response = self.client.post(url, form_data)
         self.assertRedirects(response, settings.LOGIN_REDIRECT_URL)
 
-    def test_no_tenants(self):
+    def test_login_with_disabled_projects(self):
+        projects = [self.data.project_one, self.data.project_two]
+        user = self.data.user
+        unscoped = self.data.unscoped_access_info
+
+        form_data = {'region': settings.OPENSTACK_KEYSTONE_URL,
+                     'domain': DEFAULT_DOMAIN,
+                     'password': user.password,
+                     'username': user.name}
+
+        self.mox.StubOutWithMock(self.ks_client_module, "Client")
+        self.mox.StubOutWithMock(self.keystone_client_unscoped.projects,
+                                 "list")
+
+        self.ks_client_module.Client(auth_url=settings.OPENSTACK_KEYSTONE_URL,
+                                     password=user.password,
+                                     username=user.name,
+                                     user_domain_name=DEFAULT_DOMAIN,
+                                     insecure=False,
+                                     debug=False)\
+                .AndReturn(self.keystone_client_unscoped)
+        self.keystone_client_unscoped.projects.list(user=user.id) \
+                .AndReturn(projects)
+        exc = keystone_exceptions.AuthorizationFailure
+        self.ks_client_module.Client(auth_url=settings.OPENSTACK_KEYSTONE_URL,
+                                     tenant_id=self.data.project_two.id,
+                                     insecure=False,
+                                     token=unscoped.auth_token,
+                                     debug=False) \
+                .AndRaise(exc)
+        self.ks_client_module.Client(auth_url=settings.OPENSTACK_KEYSTONE_URL,
+                                     tenant_id=self.data.project_one.id,
+                                     insecure=False,
+                                     token=unscoped.auth_token,
+                                     debug=False) \
+                .AndReturn(self.keystone_client_scoped)
+
+        self.mox.ReplayAll()
+
+        url = reverse('login')
+
+        # GET the page to set the test cookie.
+        response = self.client.get(url, form_data)
+        self.assertEqual(response.status_code, 200)
+
+        # POST to the page to log in.
+        response = self.client.post(url, form_data)
+        self.assertRedirects(response, settings.LOGIN_REDIRECT_URL)
+
+    def test_no_enabled_projects(self):
+        projects = [self.data.project_one, self.data.project_two]
+        user = self.data.user
+        unscoped = self.data.unscoped_access_info
+
+        form_data = {'region': settings.OPENSTACK_KEYSTONE_URL,
+                     'domain': DEFAULT_DOMAIN,
+                     'password': user.password,
+                     'username': user.name}
+
+        self.mox.StubOutWithMock(self.ks_client_module, "Client")
+        self.mox.StubOutWithMock(self.keystone_client_unscoped.projects,
+                                 "list")
+
+        self.ks_client_module.Client(auth_url=settings.OPENSTACK_KEYSTONE_URL,
+                                     password=user.password,
+                                     username=user.name,
+                                     user_domain_name=DEFAULT_DOMAIN,
+                                     insecure=False,
+                                     debug=False)\
+                .AndReturn(self.keystone_client_unscoped)
+        self.keystone_client_unscoped.projects.list(user=user.id) \
+                .AndReturn(projects)
+        exc = keystone_exceptions.AuthorizationFailure
+        self.ks_client_module.Client(auth_url=settings.OPENSTACK_KEYSTONE_URL,
+                                     tenant_id=self.data.project_two.id,
+                                     insecure=False,
+                                     token=unscoped.auth_token,
+                                     debug=False) \
+                .AndRaise(exc)
+        self.ks_client_module.Client(auth_url=settings.OPENSTACK_KEYSTONE_URL,
+                                     tenant_id=self.data.project_one.id,
+                                     insecure=False,
+                                     token=unscoped.auth_token,
+                                     debug=False) \
+                .AndRaise(exc)
+
+        self.mox.ReplayAll()
+
+        url = reverse('login')
+
+        # GET the page to set the test cookie.
+        response = self.client.get(url, form_data)
+        self.assertEqual(response.status_code, 200)
+
+        # POST to the page to log in.
+        response = self.client.post(url, form_data)
+        self.assertTemplateUsed(response, 'auth/login.html')
+        self.assertContains(response,
+                            'Unable to authenticate to any available'
+                            ' projects.')
+
+    def test_no_projects(self):
         user = self.data.user
 
         form_data = {'region': settings.OPENSTACK_KEYSTONE_URL,
@@ -541,7 +740,6 @@
         self.test_switch(next='/next_url')
 
     def test_switch_region(self, next=None):
-
         projects = [self.data.project_one, self.data.project_two]
         user = self.data.user
         unscoped = self.data.unscoped_access_info

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to