Skip to content

Commit

Permalink
Encode and decode authnz id in download tool wrapper & manager.
Browse files Browse the repository at this point in the history
  • Loading branch information
VJalili committed Oct 11, 2018
1 parent 8cd1b0e commit 1efa294
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/galaxy/managers/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,9 @@ def download(self, trans, history_id, bucket_name, authz_id, dataset_ids=None, o
trans.app.config.new_file_path, cloudauthz, trans.sa_session, trans.user.id)
object_label = hda.name.replace(" ", "_")
args = {
"authz_id": cloudauthz.id,
# We encode ID here because it the tool wrapper assumes
# it receives an encoded ID and attempts decoding it.
"authz_id": trans.security.encode_id(cloudauthz.id),
"credentials_file": credentials_file,
"bucket": bucket_name,
"object_label": object_label,
Expand Down
2 changes: 1 addition & 1 deletion tools/cloud/download.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<requirement type="package" version="0.3.3">cloudbridge</requirement>
</requirements>
<command><![CDATA[
#set $authz_record=$__app__.authnz_manager.try_get_authz_config($__app__.obj.model.context.current, $__user_id__, $authz_id)
#set $authz_record=$__app__.authnz_manager.try_get_authz_config($__app__.obj.model.context.current, $__user_id__, $__app__.security.decode_id($authz_id.__str__()))
#if $credentials_file == None
#set $credentials_file = $__app__.authnz_manager.get_cloud_access_credentials_in_file($__app__.config.new_file_path, $authz_record, $__app__.obj.model.context.current, $__user_id__)
#end if
Expand Down

0 comments on commit 1efa294

Please sign in to comment.