From a3e021bbbda33545a7d8b8457485ebc196a805ef Mon Sep 17 00:00:00 2001 From: Devin Cowan Date: Wed, 27 Mar 2024 12:33:37 -0400 Subject: [PATCH 1/5] testing --- nbfetch/handlers.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/nbfetch/handlers.py b/nbfetch/handlers.py index cf59291..10245ef 100644 --- a/nbfetch/handlers.py +++ b/nbfetch/handlers.py @@ -22,6 +22,11 @@ # typing imports from typing import Optional, Tuple +# probably need a varify=False for the hs client session? ssl cert... +host = "www2-hydroshare.edc.renci.org" +protocol = "https" +port = 443 + class ExtensionHandler( ExtensionHandlerMixin, ExtensionHandlerJinjaMixin, JupyterHandler @@ -311,9 +316,9 @@ def check_auth(self, authfile=None, username=None, password=None): if authfile: with open(authfile, 'rb') as f: token, cid = pickle.load(f) - hs = HydroShare(client_id=cid, token=token) + hs = HydroShare(client_id=cid, token=token, host=host, protocol=protocol, port=port) else: - hs = HydroShare(username=username, password=password) + hs = HydroShare(username=username, password=password, host=host, protocol=protocol, port=port) self.log.info('hs=%s' % str(hs)) info = hs.my_user_info() @@ -376,7 +381,7 @@ def get(self): id = self.get_argument("id") # check to see if the resource is public - hs = HydroShare() + hs = HydroShare(host=host, protocol=protocol, port=port) try: hs.resource(id) self.log.info(f"Pulling public rid {id}. \ @@ -428,7 +433,7 @@ def get(self): path = urljoin(self.base_url, path) self.redirect(path) return - + # self.write( self.render_template( "hstatus.html", From aac11649570a7f09489e627ac5eee3d085c1b994 Mon Sep 17 00:00:00 2001 From: Devin Cowan Date: Wed, 27 Mar 2024 13:25:26 -0400 Subject: [PATCH 2/5] Update host variable in handlers.py --- nbfetch/handlers.py | 1 + 1 file changed, 1 insertion(+) diff --git a/nbfetch/handlers.py b/nbfetch/handlers.py index 10245ef..ff0d417 100644 --- a/nbfetch/handlers.py +++ b/nbfetch/handlers.py @@ -24,6 +24,7 @@ # probably need a varify=False for the hs client session? ssl cert... host = "www2-hydroshare.edc.renci.org" +# host = "beta.hydroshare.org" protocol = "https" port = 443 From 9d17a7ffbbbfa131670de73482377c7e0b450a55 Mon Sep 17 00:00:00 2001 From: Devin Cowan Date: Wed, 27 Mar 2024 13:31:00 -0400 Subject: [PATCH 3/5] Add hsclient submodule --- .gitmodules | 3 +++ hsclient | 1 + 2 files changed, 4 insertions(+) create mode 100644 .gitmodules create mode 160000 hsclient diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..ed521e1 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "hsclient"] + path = hsclient + url = https://github.com/hydroshare/hsclient.git diff --git a/hsclient b/hsclient new file mode 160000 index 0000000..099e242 --- /dev/null +++ b/hsclient @@ -0,0 +1 @@ +Subproject commit 099e242706d850847f728db3c5dff791178efe98 From 0087866f3c545d4ee993bf4ba747a0f0fe2b54d2 Mon Sep 17 00:00:00 2001 From: Devin Cowan Date: Wed, 27 Mar 2024 13:34:11 -0400 Subject: [PATCH 4/5] Add hsclient fork installation --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 8adc153..795fb66 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,9 @@ pip install --upgrade pip # install nbfetch in edit mode pip install -e . +# install hsclient fork +pip install -e /hsclient + # enable jupyter_server extension jupyter server extension enable --py nbfetch From 2364e0fc703cfdb99c68e70d3ff4309e7662335a Mon Sep 17 00:00:00 2001 From: Devin Cowan Date: Wed, 27 Mar 2024 13:36:01 -0400 Subject: [PATCH 5/5] Update installation instructions for hsclient --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 795fb66..0e6958f 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ pip install --upgrade pip pip install -e . # install hsclient fork -pip install -e /hsclient +pip install -e hsclient # enable jupyter_server extension jupyter server extension enable --py nbfetch