Skip to content

Commit 89fe312

Browse files
authored
fix: Referenced self on static method on IBM Auth Helper (#166)
1 parent f78ff73 commit 89fe312

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

sdcclient/ibm_auth_helper.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
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',

0 commit comments

Comments
 (0)