File tree 2 files changed +8
-4
lines changed
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -211,9 +211,11 @@ def employee_client(username=None,
211
211
access_token = settings .get ('access_token' )
212
212
213
213
user_id = settings .get ('userid' )
214
-
215
214
# Assume access_token is valid for now, user has logged in before at least.
216
- if access_token and user_id :
215
+ if settings .get ('auth_cert' , False ):
216
+ auth = slauth .X509Authentication (settings .get ('auth_cert' ), verify )
217
+ return EmployeeClient (auth = auth , transport = transport , config_file = config_file )
218
+ elif access_token and user_id :
217
219
auth = slauth .EmployeeAuthentication (user_id , access_token )
218
220
return EmployeeClient (auth = auth , transport = transport , config_file = config_file )
219
221
else :
Original file line number Diff line number Diff line change @@ -61,7 +61,8 @@ def get_client_settings_config_file(**kwargs): # pylint: disable=inconsistent-r
61
61
'proxy' : '' ,
62
62
'userid' : '' ,
63
63
'access_token' : '' ,
64
- 'verify' : "True"
64
+ 'verify' : "True" ,
65
+ 'auth_cert' : ''
65
66
})
66
67
config .read (config_files )
67
68
@@ -74,7 +75,8 @@ def get_client_settings_config_file(**kwargs): # pylint: disable=inconsistent-r
74
75
'api_key' : config .get ('softlayer' , 'api_key' ),
75
76
'userid' : config .get ('softlayer' , 'userid' ),
76
77
'access_token' : config .get ('softlayer' , 'access_token' ),
77
- 'verify' : config .get ('softlayer' , 'verify' )
78
+ 'verify' : config .get ('softlayer' , 'verify' ),
79
+ 'auth_cert' : config .get ('softlayer' , 'auth_cert' )
78
80
}
79
81
if r_config ["verify" ].lower () == "true" :
80
82
r_config ["verify" ] = True
You can’t perform that action at this time.
0 commit comments