Skip to content

Commit

Permalink
Protocol should be optional.
Browse files Browse the repository at this point in the history
  • Loading branch information
ianjosephwilson committed Oct 18, 2010
1 parent a8ab20c commit a75339d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions velruse/providers/facebook_.py
Expand Up @@ -75,7 +75,7 @@ class FacebookResponder(utils.RouteResponder):
map.connect('login', '/auth', action='login', requirements=dict(method='POST'))
map.connect('process', '/process', action='process')

def __init__(self, storage, api_key, app_secret, app_id, protocol):
def __init__(self, storage, api_key, app_secret, app_id, protocol=None):
self.api_key = api_key
self.app_secret = app_secret
self.app_id = app_id
Expand All @@ -88,12 +88,15 @@ def parse_config(cls, config):
"""Parse config data from a config file"""
key_map = {'API Key': 'api_key',
'Application Secret': 'app_secret',
'Application ID': 'app_id',
'Protocol': 'protocol'}
'Application ID': 'app_id'}
optional_key_map = {'Protocol': 'protocol'}
fb_vals = config['Facebook']
params = {}
for k, v in key_map.items():
params[v] = fb_vals[k]
for k, v in optional_key_map.items():
if k in fb_vals:
params[v] = fb_vals[k]
params['storage'] = config['UserStore']
return params

Expand Down
2 changes: 1 addition & 1 deletion velruse/providers/openidconsumer.py
Expand Up @@ -167,7 +167,7 @@ class OpenIDResponder(utils.RouteResponder):
map.connect('login', '/auth', action='login', requirements=dict(method='POST'))
map.connect('process', '/process', action='process')

def __init__(self, storage, openid_store, endpoint_regex, realm, protocol, schema=None):
def __init__(self, storage, openid_store, endpoint_regex, realm, protocol=None, schema=None):
"""Create the OpenID Consumer"""
self.storage = storage
self.openid_store = openid_store
Expand Down

0 comments on commit a75339d

Please sign in to comment.