Loading crossbow/crossbowGlobus.py +27 −14 Original line number Diff line number Diff line Loading @@ -81,12 +81,14 @@ class crossbowGlobus(crossbowBase): ''' def __init__(self,api_key,CKAN_url="http://128.219.185.145:5000", user_agent='crossbow',token_file='refresh-tokens.json'): user_agent='crossbow',token_file='refresh-tokens.json', init=True): self.client_id = '18270179-b498-4032-9187-ca646d6e29af' #self.cadesdtn = 'e6bcd4fa-ac1b-11e6-9aee-22000a1e3b52' self.cadesdtn = '586dc9b6-189a-11e7-bb9f-22000b9a448b' if init: try: # if we already have tokens, load and use them tokens = self._load_tokens_from_file(token_file) Loading Loading @@ -136,6 +138,17 @@ class crossbowGlobus(crossbowBase): # return a set of tokens, organized by resource server name return token_response.by_resource_server def _get_authorize_url(self,client_id): """ returns the authorization url for native app authentication """ client = globus_sdk.NativeAppAuthClient(client_id=client_id) # pass refresh_tokens=True to request refresh tokens client.oauth2_start_flow(refresh_tokens=True) authorize_url = client.oauth2_get_authorize_url() return authorize_url def _activate_endpoint(self,ep_id): """ function for manually activating an endpoint Loading crossbow/crossbowOlcf.py +1 −1 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ class crossbowOlcf(object): #get tokens ssh_stdin, ssh_stdout, ssh_stderr = \ self.ssh.exec_command("cd crossbow/crossbow; python test.py") self.ssh.exec_command("cd crossbow/crossbow; python remote_auth_1.py") print ssh_stdout.readlines() if __name__ == "__main__": Loading crossbow/remote_auth_1.py 0 → 100644 +5 −0 Original line number Diff line number Diff line from crossbowGlobus import crossbowGlobus cbow = crossbowGlobus(api_key="eaabd7d9-3cb4-4014-85fe-73736e658472",init=False) url = cbow._get_authorize_url(self,cbow.client_id) print url crossbow/test.pydeleted 100644 → 0 +0 −1 Original line number Diff line number Diff line print "hello world" Loading
crossbow/crossbowGlobus.py +27 −14 Original line number Diff line number Diff line Loading @@ -81,12 +81,14 @@ class crossbowGlobus(crossbowBase): ''' def __init__(self,api_key,CKAN_url="http://128.219.185.145:5000", user_agent='crossbow',token_file='refresh-tokens.json'): user_agent='crossbow',token_file='refresh-tokens.json', init=True): self.client_id = '18270179-b498-4032-9187-ca646d6e29af' #self.cadesdtn = 'e6bcd4fa-ac1b-11e6-9aee-22000a1e3b52' self.cadesdtn = '586dc9b6-189a-11e7-bb9f-22000b9a448b' if init: try: # if we already have tokens, load and use them tokens = self._load_tokens_from_file(token_file) Loading Loading @@ -136,6 +138,17 @@ class crossbowGlobus(crossbowBase): # return a set of tokens, organized by resource server name return token_response.by_resource_server def _get_authorize_url(self,client_id): """ returns the authorization url for native app authentication """ client = globus_sdk.NativeAppAuthClient(client_id=client_id) # pass refresh_tokens=True to request refresh tokens client.oauth2_start_flow(refresh_tokens=True) authorize_url = client.oauth2_get_authorize_url() return authorize_url def _activate_endpoint(self,ep_id): """ function for manually activating an endpoint Loading
crossbow/crossbowOlcf.py +1 −1 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ class crossbowOlcf(object): #get tokens ssh_stdin, ssh_stdout, ssh_stderr = \ self.ssh.exec_command("cd crossbow/crossbow; python test.py") self.ssh.exec_command("cd crossbow/crossbow; python remote_auth_1.py") print ssh_stdout.readlines() if __name__ == "__main__": Loading
crossbow/remote_auth_1.py 0 → 100644 +5 −0 Original line number Diff line number Diff line from crossbowGlobus import crossbowGlobus cbow = crossbowGlobus(api_key="eaabd7d9-3cb4-4014-85fe-73736e658472",init=False) url = cbow._get_authorize_url(self,cbow.client_id) print url
crossbow/test.pydeleted 100644 → 0 +0 −1 Original line number Diff line number Diff line print "hello world"