Skip to content

Commit 88ce2c1

Browse files
committed
fix: generalize auth config for WES endpoints
Based on @DailyDreaming's suggestion/examples, change the auth property of WESClient to accept a full dictionary, rather than a string that requires additional context.
1 parent ec87724 commit 88ce2c1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

test/test_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def setUpClass(cls):
3333
cls.wdl_attachments = ['file://' + os.path.abspath('testdata/md5sum.input')]
3434

3535
# client for the swagger API methods
36-
cls.client = WESClient({'auth': '', 'proto': 'http', 'host': 'localhost:8080'})
36+
cls.client = WESClient({'auth': {'Authorization': ''}, 'proto': 'http', 'host': 'localhost:8080'})
3737

3838
# manual test (wdl only working locally atm)
3939
cls.manual = False

wes_client/util.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def get_service_info(self):
178178
:return: The body of the get result as a dictionary.
179179
"""
180180
postresult = requests.get("%s://%s/ga4gh/wes/v1/service-info" % (self.proto, self.host),
181-
headers={"Authorization": self.auth})
181+
headers=self.auth)
182182
return wes_reponse(postresult)
183183

184184
def list_runs(self):
@@ -194,7 +194,7 @@ def list_runs(self):
194194
:return: The body of the get result as a dictionary.
195195
"""
196196
postresult = requests.get("%s://%s/ga4gh/wes/v1/runs" % (self.proto, self.host),
197-
headers={"Authorization": self.auth})
197+
headers=self.auth)
198198
return wes_reponse(postresult)
199199

200200
def run(self, wf, jsonyaml, attachments):
@@ -214,7 +214,7 @@ def run(self, wf, jsonyaml, attachments):
214214
parts = build_wes_request(wf, jsonyaml, attachments)
215215
postresult = requests.post("%s://%s/ga4gh/wes/v1/runs" % (self.proto, self.host),
216216
files=parts,
217-
headers={"Authorization": self.auth})
217+
headers=self.auth)
218218
return wes_reponse(postresult)
219219

220220
def cancel(self, run_id):
@@ -228,7 +228,7 @@ def cancel(self, run_id):
228228
:return: The body of the delete result as a dictionary.
229229
"""
230230
postresult = requests.delete("%s://%s/ga4gh/wes/v1/runs/%s" % (self.proto, self.host, run_id),
231-
headers={"Authorization": self.auth})
231+
headers=self.auth)
232232
return wes_reponse(postresult)
233233

234234
def get_run_log(self, run_id):
@@ -242,7 +242,7 @@ def get_run_log(self, run_id):
242242
:return: The body of the get result as a dictionary.
243243
"""
244244
postresult = requests.get("%s://%s/ga4gh/wes/v1/runs/%s" % (self.proto, self.host, run_id),
245-
headers={"Authorization": self.auth})
245+
headers=self.auth)
246246
return wes_reponse(postresult)
247247

248248
def get_run_status(self, run_id):
@@ -256,5 +256,5 @@ def get_run_status(self, run_id):
256256
:return: The body of the get result as a dictionary.
257257
"""
258258
postresult = requests.get("%s://%s/ga4gh/wes/v1/runs/%s/status" % (self.proto, self.host, run_id),
259-
headers={"Authorization": self.auth})
259+
headers=self.auth)
260260
return wes_reponse(postresult)

0 commit comments

Comments
 (0)