mirror of
https://github.com/OpenBankProject/API-Manager.git
synced 2026-02-06 16:36:45 +00:00
#3 Renamed OAUTH_CLIENT_{KEY,SECRET} to OAUTH_CONSUMER_{KEY,SECRET}
This commit is contained in:
parent
5726d1e55a
commit
da1ada7f2c
@ -170,8 +170,8 @@ OAUTH_API_BASE_PATH = '/obp/v2.1.0'
|
||||
|
||||
|
||||
# Set OAuth client key/secret in apimanager/local_settings.py
|
||||
OAUTH_CLIENT_KEY = None
|
||||
OAUTH_CLIENT_SECRET = None
|
||||
OAUTH_CONSUMER_KEY = None
|
||||
OAUTH_CONSUMER_SECRET = None
|
||||
|
||||
# Local settings can override anything in here
|
||||
try:
|
||||
@ -179,7 +179,7 @@ try:
|
||||
except:
|
||||
pass
|
||||
|
||||
if not OAUTH_CLIENT_KEY:
|
||||
raise ImproperlyConfigured('Missing settings for OAUTH_CLIENT_KEY')
|
||||
if not OAUTH_CLIENT_SECRET:
|
||||
raise ImproperlyConfigured('Missing settings for OAUTH_CLIENT_SECRET')
|
||||
if not OAUTH_CONSUMER_KEY:
|
||||
raise ImproperlyConfigured('Missing settings for OAUTH_CONSUMER_KEY')
|
||||
if not OAUTH_CONSUMER_SECRET:
|
||||
raise ImproperlyConfigured('Missing settings for OAUTH_CONSUMER_SECRET')
|
||||
|
||||
@ -46,8 +46,8 @@ def api_call(request, method='GET', urlpath='', payload=None):
|
||||
api_log(logging.INFO, '{} {}'.format(method, url))
|
||||
if not hasattr(request, 'api'):
|
||||
request.api = OAuth1Session(
|
||||
settings.OAUTH_CLIENT_KEY,
|
||||
client_secret=settings.OAUTH_CLIENT_SECRET,
|
||||
settings.OAUTH_CONSUMER_KEY,
|
||||
client_secret=settings.OAUTH_CONSUMER_SECRET,
|
||||
resource_owner_key=request.session['oauth_token'],
|
||||
resource_owner_secret=request.session['oauth_secret']
|
||||
)
|
||||
|
||||
@ -25,8 +25,8 @@ class InitiateView(RedirectView):
|
||||
def get_redirect_url(self, *args, **kwargs):
|
||||
callback_uri = self.get_callback_uri(self.request)
|
||||
api = OAuth1Session(
|
||||
settings.OAUTH_CLIENT_KEY,
|
||||
client_secret=settings.OAUTH_CLIENT_SECRET,
|
||||
settings.OAUTH_CONSUMER_KEY,
|
||||
client_secret=settings.OAUTH_CONSUMER_SECRET,
|
||||
callback_uri=callback_uri,
|
||||
)
|
||||
|
||||
@ -59,8 +59,8 @@ class AuthorizeView(RedirectView):
|
||||
|
||||
def get_redirect_url(self, *args, **kwargs):
|
||||
api = OAuth1Session(
|
||||
settings.OAUTH_CLIENT_KEY,
|
||||
settings.OAUTH_CLIENT_SECRET,
|
||||
settings.OAUTH_CONSUMER_KEY,
|
||||
settings.OAUTH_CONSUMER_SECRET,
|
||||
resource_owner_key=self.request.session['oauth_token'],
|
||||
resource_owner_secret=self.request.session['oauth_secret']
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user