Skip to content

fix: Referenced self on static method on IBM Auth Helper #166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions sdcclient/ibm_auth_helper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
class IbmAuthHelper():
import requests


class IbmAuthHelper:
'''Authenticate with IBM Cloud IAM.

**Arguments**
Expand All @@ -14,8 +17,8 @@ class IbmAuthHelper():
def get_headers(url, apikey, guid):
iam_token = IbmAuthHelper.__get_iam_token(url, apikey)
return {
'Authorization': 'Bearer ' + iam_token,
'IBMInstanceID': guid
'Authorization': 'Bearer ' + iam_token,
'IBMInstanceID': guid
}

@staticmethod
Expand All @@ -32,7 +35,7 @@ def __get_iam_endpoint(url):
@staticmethod
def __get_iam_token(url, apikey):
env_url = IbmAuthHelper.__get_iam_endpoint(url)
response = self.http.post(
response = requests.post(
'https://' + env_url + '/identity/token',
data={
'grant_type': 'urn:ibm:params:oauth:grant-type:apikey',
Expand Down