From 20ca3f8ee40ce26865ae68dc418c380a2f05f639 Mon Sep 17 00:00:00 2001 From: Francesco Siddi Date: Tue, 12 Dec 2017 18:49:52 +0100 Subject: [PATCH] Rename blender_id url to blender-id This fixes a non-compliant to RFC 1178 exception raised by the Django implementation of Blender ID. The issue is debated here https://code.djangoproject.com/ticket/20264. --- pillar/config.py | 4 ++-- pillar/tests/config_testing.py | 2 +- tests/test_api/test_oauth.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pillar/config.py b/pillar/config.py index 291787a3..11a5a0ab 100644 --- a/pillar/config.py +++ b/pillar/config.py @@ -28,7 +28,7 @@ SECRET_KEY = '' AUTH_TOKEN_HMAC_KEY = b'' # Authentication settings -BLENDER_ID_ENDPOINT = 'http://blender_id:8000/' +BLENDER_ID_ENDPOINT = 'http://blender-id:8000/' PILLAR_SERVER_ENDPOINT = 'http://pillar:5001/api/' @@ -116,7 +116,7 @@ BLENDER_ID_USER_INFO_TOKEN = '-set-in-config-local-' # 'blender-id': { # 'id': 'CLOUD-OF-SNOWFLAKES-43', # 'secret': 'thesecret', -# 'base_url': 'http://blender_id:8000/' +# 'base_url': 'http://blender-id:8000/' # } # } # OAuth providers are defined in pillar.auth.oauth diff --git a/pillar/tests/config_testing.py b/pillar/tests/config_testing.py index c81994b6..f0f4ba21 100644 --- a/pillar/tests/config_testing.py +++ b/pillar/tests/config_testing.py @@ -24,7 +24,7 @@ OAUTH_CREDENTIALS = { 'blender-id': { 'id': 'blender-id-app-id', 'secret': 'blender-id–secret', - 'base_url': 'http://blender_id:8000/' + 'base_url': 'http://blender-id:8000/' }, 'facebook': { 'id': 'fb-app-id', diff --git a/tests/test_api/test_oauth.py b/tests/test_api/test_oauth.py index 152a8d46..6c5c358b 100644 --- a/tests/test_api/test_oauth.py +++ b/tests/test_api/test_oauth.py @@ -12,7 +12,7 @@ class OAuthTests(AbstractPillarTest): oauth_provider = OAuthSignIn.get_provider('blender-id') self.assertIsInstance(oauth_provider, BlenderIdSignIn) - self.assertEqual(oauth_provider.service.base_url, 'http://blender_id:8000/api/') + self.assertEqual(oauth_provider.service.base_url, 'http://blender-id:8000/api/') def test_provider_not_implemented(self): from pillar.auth.oauth import OAuthSignIn, ProviderNotImplemented @@ -46,11 +46,11 @@ class OAuthTests(AbstractPillarTest): def test_provider_callback_happy(self): from pillar.auth.oauth import OAuthSignIn - responses.add(responses.POST, 'http://blender_id:8000/oauth/token', + responses.add(responses.POST, 'http://blender-id:8000/oauth/token', json={'access_token': 'successful-token'}, status=200) - responses.add(responses.GET, 'http://blender_id:8000/api/user', + responses.add(responses.GET, 'http://blender-id:8000/api/user', json={'id': '7', 'email': 'harry@blender.org'}, status=200)