From 2cdd38bb2356c63afc675490414ea6ce9ccffad2 Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Wed, 22 Jan 2020 14:04:48 -0800 Subject: [PATCH] remove unused social auth strategy --- src/social_auth/backends/pipeline/sauth.py | 7 ---- src/social_auth/strategy.py | 43 ---------------------- 2 files changed, 50 deletions(-) delete mode 100644 src/social_auth/backends/pipeline/sauth.py delete mode 100644 src/social_auth/strategy.py diff --git a/src/social_auth/backends/pipeline/sauth.py b/src/social_auth/backends/pipeline/sauth.py deleted file mode 100644 index e74804f246b042..00000000000000 --- a/src/social_auth/backends/pipeline/sauth.py +++ /dev/null @@ -1,7 +0,0 @@ -from __future__ import absolute_import - -from social.pipeline.social_auth import ( # NOQA - social_user as social_auth_user, - associate_user, - load_extra_data, -) diff --git a/src/social_auth/strategy.py b/src/social_auth/strategy.py deleted file mode 100644 index 841259374cc1ee..00000000000000 --- a/src/social_auth/strategy.py +++ /dev/null @@ -1,43 +0,0 @@ -from __future__ import absolute_import - -from social.strategies.django_strategy import DjangoStrategy - - -class DSAStrategy(DjangoStrategy): - settings_map = { - "BITBUCKET_KEY": "BITBUCKET_CONSUMER_KEY", - "BITBUCKET_SECRET": "BITBUCKET_CONSUMER_SECRET", - "GITHUB_SECRET": "GITHUB_API_SECRET", - "GITHUB_KEY": "GITHUB_APP_ID", - "GITHUB_SCOPE": "GITHUB_EXTENDED_PERMISSIONS", - "GOOGLE_OAUTH_KEY": "GOOGLE_CONSUMER_KEY", - "GOOGLE_OAUTH_SECRET": "GOOGLE_CONSUMER_SECRET", - "GOOGLE_OAUTH_SCOPE": "GOOGLE_OAUTH_EXTRA_SCOPE", - "GOOGLE_OAUTH2_KEY": "GOOGLE_OAUTH2_CLIENT_KEY", - "GOOGLE_OAUTH2_SECRET": "GOOGLE_OAUTH2_CLIENT_SECRET", - "GOOGLE_OAUTH2_SCOPE": "GOOGLE_OAUTH_EXTRA_SCOPE", - "TRELLO_KEY": "TRELLO_CONSUMER_KEY", - "TRELLO_SECRET": "TRELLO_CONSUMER_SECRET", - "ON_HTTPS": "SOCIAL_AUTH_REDIRECT_IS_HTTPS", - } - - def get_setting(self, name): - if name in self.settings_map: - # Try DSA setting name from map defined above - try: - return super(DSAStrategy, self).get_setting(self.settings_map[name]) - except (AttributeError, KeyError): - pass - # Fallback to PSA setting name - return super(DSAStrategy, self).get_setting(name) - - def get_pipeline(self): - pipeline = super(DSAStrategy, self).get_pipeline() - pipeline_renamed = [] - for entry in pipeline: - if entry.startswith("social_auth.backends.pipeline.social"): - entry = entry.replace( - "social_auth.backends.pipeline.social", "social_auth.backends.pipeline.sauth" - ) - pipeline_renamed.append(entry) - return pipeline_renamed