Skip to content

Commit bbe1edb

Browse files
committed
fix issue when server config is blank
1 parent b3628f3 commit bbe1edb

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

user_sync/connector/connector_umapi.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,14 @@ def __init__(self, name, caller_options, is_primary=False):
7070
server_builder.set_string_value('host', 'usermanagement.adobe.io')
7171
server_builder.set_string_value('endpoint', '/v2/usermanagement')
7272

73-
auth_host_key = 'ims_host' if 'ims_host' in server_config else 'auth_host'
74-
server_builder.set_string_value(auth_host_key, 'ims-na1.adobelogin.com')
73+
if server_config is None:
74+
auth_host_key = 'auth_host'
75+
auth_endpoint_key = 'auth_endpoint'
76+
else:
77+
auth_host_key = 'ims_host' if 'ims_host' in server_config else 'auth_host'
78+
auth_endpoint_key = 'ims_endpoint_jwt' if 'ims_endpoint_jwt' in server_config else 'auth_endpoint'
7579

76-
auth_endpoint_key = 'ims_endpoint_jwt' if 'ims_endpoint_jwt' in server_config else 'auth_endpoint'
80+
server_builder.set_string_value(auth_host_key, 'ims-na1.adobelogin.com')
7781
auth_endpoint_default = '/ims/exchange/jwt'
7882
if options['authentication_method'] == 'oauth':
7983
auth_endpoint_default = '/ims/token/v2'

user_sync/connector/directory_adobe_console.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,14 @@ def __init__(self, caller_options, *args, **kwargs):
6060
server_builder.set_string_value('endpoint', '/v2/usermanagement')
6161
server_builder.set_string_value('ims_endpoint_jwt', '/ims/exchange/jwt')
6262

63-
auth_host_key = 'ims_host' if 'ims_host' in server_config else 'auth_host'
64-
server_builder.set_string_value(auth_host_key, 'ims-na1.adobelogin.com')
63+
if server_config is None:
64+
auth_host_key = 'auth_host'
65+
auth_endpoint_key = 'auth_endpoint'
66+
else:
67+
auth_host_key = 'ims_host' if 'ims_host' in server_config else 'auth_host'
68+
auth_endpoint_key = 'ims_endpoint_jwt' if 'ims_endpoint_jwt' in server_config else 'auth_endpoint'
6569

66-
auth_endpoint_key = 'ims_endpoint_jwt' if 'ims_endpoint_jwt' in server_config else 'auth_endpoint'
70+
server_builder.set_string_value(auth_host_key, 'ims-na1.adobelogin.com')
6771
auth_endpoint_default = '/ims/exchange/jwt'
6872
if options['authentication_method'] == 'oauth':
6973
auth_endpoint_default = '/ims/token/v2'

0 commit comments

Comments
 (0)