File tree 1 file changed +16
-6
lines changed
1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -230,16 +230,26 @@ def refresh(ctx):
230
230
refresh_url = "{endpoint}/v1/authentication/refresh" .format (endpoint = oci .regions .endpoint_for ("auth" , client_config .get ('region' )))
231
231
click .echo ("Attempting to refresh token from {refresh_url}" .format (refresh_url = refresh_url ), file = sys .stderr )
232
232
233
- response = requests . post (
234
- refresh_url ,
235
- headers = {
233
+ request_params = {
234
+ 'url' : refresh_url ,
235
+ ' headers' : {
236
236
'content-type' : 'application/json'
237
237
},
238
- data = json .dumps ({
238
+ ' data' : json .dumps ({
239
239
'currentToken' : token
240
240
}),
241
- auth = auth
242
- )
241
+ 'auth' : auth
242
+ }
243
+
244
+ cert_bundle = ctx .obj .get ('cert_bundle' )
245
+ if cert_bundle :
246
+ cert_bundle = os .path .expanduser (cert_bundle )
247
+ if not os .path .isfile (cert_bundle ):
248
+ raise click .BadParameter (param_hint = 'cert_bundle' , message = 'Cannot find cert_bundle file: {}' .format (cert_bundle ))
249
+
250
+ request_params ['verify' ] = os .path .expanduser (cert_bundle )
251
+
252
+ response = requests .post (** request_params )
243
253
244
254
if response .status_code == 200 :
245
255
refreshed_token = json .loads (response .content .decode ('UTF-8' ))['token' ]
You can’t perform that action at this time.
0 commit comments