File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 1- class IbmAuthHelper ():
1+ import requests
2+
3+
4+ class IbmAuthHelper :
25 '''Authenticate with IBM Cloud IAM.
36
47 **Arguments**
@@ -14,8 +17,8 @@ class IbmAuthHelper():
1417 def get_headers (url , apikey , guid ):
1518 iam_token = IbmAuthHelper .__get_iam_token (url , apikey )
1619 return {
17- 'Authorization' : 'Bearer ' + iam_token ,
18- 'IBMInstanceID' : guid
20+ 'Authorization' : 'Bearer ' + iam_token ,
21+ 'IBMInstanceID' : guid
1922 }
2023
2124 @staticmethod
@@ -32,7 +35,7 @@ def __get_iam_endpoint(url):
3235 @staticmethod
3336 def __get_iam_token (url , apikey ):
3437 env_url = IbmAuthHelper .__get_iam_endpoint (url )
35- response = self . http .post (
38+ response = requests .post (
3639 'https://' + env_url + '/identity/token' ,
3740 data = {
3841 'grant_type' : 'urn:ibm:params:oauth:grant-type:apikey' ,
You can’t perform that action at this time.
0 commit comments