From 34b7d37ffc131a38c9594d0ac973cf81fdc3ef8c Mon Sep 17 00:00:00 2001 From: John Conroy Date: Mon, 15 Nov 2021 11:11:00 -0500 Subject: [PATCH 1/5] Switch globus auth from nexus to groups --- context/app/routes_auth.py | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/context/app/routes_auth.py b/context/app/routes_auth.py index 28b1db7a69..bde6c3b3b8 100644 --- a/context/app/routes_auth.py +++ b/context/app/routes_auth.py @@ -21,24 +21,17 @@ def load_app_client(): current_app.config['APP_CLIENT_ID'], current_app.config['APP_CLIENT_SECRET']) -def has_hubmap_group(nexus_token): +def has_hubmap_group(groups_token): # Mostly copy-and-paste from # https://github.com/hubmapconsortium/commons/blob/dc69f4/hubmap_commons/hm_auth.py#L347-L355 headers = { 'Content-Type': 'application/json', 'Accept': 'application/json', - 'Authorization': 'Bearer ' + nexus_token - } - params = { - 'fields': 'id,name,description', - # I'm not sure what these do, and if they are necessary: - 'for_all_identities': 'false', - 'my_statuses': 'active' + 'Authorization': 'Bearer ' + groups_token } response = requests.get( - 'https://nexus.api.globusonline.org/groups', - headers=headers, - params=params) + 'https://groups.api.globus.org/v2/groups/my_groups', + headers=headers) response.raise_for_status() groups = response.json() return any([group['id'] == current_app.config['GROUP_ID'] for group in groups]) @@ -70,7 +63,7 @@ def login(): 'openid profile email', 'urn:globus:auth:scope:transfer.api.globus.org:all', 'urn:globus:auth:scope:auth.globus.org:view_identities', - 'urn:globus:auth:scope:nexus.api.globus.org:groups' + 'urn:globus:auth:scope:groups.api.globus.org:all' ]) } ) @@ -82,8 +75,8 @@ def login(): tokens = client.oauth2_exchange_code_for_tokens(code) # The repr is deceptive: Looks like a dict, but direct access not possible. - token_object = tokens.by_resource_server['nexus.api.globus.org'] - nexus_token = token_object['access_token'] + token_object = tokens.by_resource_server['groups.api.globus.org'] + groups_token = token_object['access_token'] auth_token_object = tokens.by_resource_server['auth.globus.org'] auth_token = auth_token_object['access_token'] @@ -93,12 +86,12 @@ def login(): headers=user_info_request_headers).json() user_email = user_info['email'] if 'email' in user_info else '' - if not has_hubmap_group(nexus_token): + if not has_hubmap_group(groups_token): # Globus institution login worked, but user does not have HuBMAP group! return render_template('errors/401-no-hubmap-group.html'), 401 session.update( - nexus_token=nexus_token, + groups_token=groups_token, is_authenticated=True, user_email=user_email) From 473c285267564747fb1359901f89495f6341f365 Mon Sep 17 00:00:00 2001 From: John Conroy Date: Mon, 15 Nov 2021 11:11:29 -0500 Subject: [PATCH 2/5] Update nexus token vars --- context/.storybook/preview.js | 4 +- context/app/api/client.py | 10 ++-- context/app/api/vitessce_confs/assay_confs.py | 24 +++++----- context/app/api/vitessce_confs/base_confs.py | 48 +++++++++---------- .../fixtures/output_expected/atac_conf.json | 4 +- .../output_expected/cytokit_anndata_conf.json | 28 +++++------ .../output_expected/cytokit_json_conf.json | 20 ++++---- .../output_expected/image_pyramid_conf.json | 4 +- .../fixtures/output_expected/ims_conf.json | 4 +- .../fixtures/output_expected/rna_conf.json | 4 +- .../output_expected/rna_zarr_conf.json | 6 +-- .../output_expected/seqfish_conf.json | 16 +++---- .../spatial_rna_zarr_conf.json | 6 +-- .../output_expected/sprm_anndata_conf.json | 14 +++--- .../fixtures/output_expected/sprm_conf.json | 10 ++-- context/app/api/vitessce_confs/test_confs.py | 10 ++-- context/app/main.py | 8 ++-- context/app/routes_main.py | 6 +-- context/app/static/js/components/App.jsx | 4 +- .../Detail/VersionSelect/VersionSelect.jsx | 6 +-- .../provenance/ProvSection/ProvSection.jsx | 4 +- .../ShowDerivedEntitiesButton.jsx | 4 +- .../app/static/js/components/Providers.jsx | 4 +- .../DatasetsSelectedByExpression.jsx | 4 +- .../files/FileBrowserFile/FileBrowserFile.jsx | 4 +- .../files/GlobusLink/GlobusLink.jsx | 4 +- .../app/static/js/helpers/LookupEntity.jsx | 2 +- context/app/static/js/helpers/functions.js | 10 ++-- .../js/hooks/useImmediateDescendantProv.js | 22 ++++----- context/app/static/js/hooks/useProvData.js | 6 +-- context/app/static/js/hooks/useSearchData.js | 10 ++-- .../static/js/pages/search/CellsSearch.jsx | 12 ++--- .../app/static/js/pages/search/DevSearch.jsx | 6 +-- context/app/static/js/pages/search/Search.jsx | 10 ++-- context/app/templates/pages/base.html | 2 +- context/app/templates/pages/base_react.html | 2 +- context/app/templates/pages/ccf-eui.html | 2 +- context/app/test_routes_errors.py | 4 +- context/app/test_routes_main.py | 2 +- context/app/utils.py | 2 +- context/test-utils/functions.js | 4 +- end-to-end/artillery/README.md | 2 +- end-to-end/artillery/artillery.sh | 2 +- .../artillery/skip-scenarios/search.yml | 2 +- .../cypress/integration/portal-ui.spec.js | 2 +- 45 files changed, 182 insertions(+), 182 deletions(-) diff --git a/context/.storybook/preview.js b/context/.storybook/preview.js index 3a9e95ebd5..4af48a6408 100644 --- a/context/.storybook/preview.js +++ b/context/.storybook/preview.js @@ -13,11 +13,11 @@ export const parameters = { } const mockEndpoints = {}; -const mockNexusToken="" +const mockGroupsToken="" export const decorators = [ (Story) => ( - + ), diff --git a/context/app/api/client.py b/context/app/api/client.py index 4daaff2a16..a849ca1bad 100644 --- a/context/app/api/client.py +++ b/context/app/api/client.py @@ -19,12 +19,12 @@ class VitessceConfLiftedUUID: class ApiClient(): - def __init__(self, url_base=None, nexus_token=None): + def __init__(self, url_base=None, groups_token=None): self.url_base = url_base - self.nexus_token = nexus_token + self.groups_token = groups_token def _request(self, url, body_json=None): - headers = {'Authorization': 'Bearer ' + self.nexus_token} if self.nexus_token else {} + headers = {'Authorization': 'Bearer ' + self.groups_token} if self.groups_token else {} try: response = ( requests.post(url, headers=headers, json=body_json) @@ -109,7 +109,7 @@ def get_entity(self, uuid=None, hbm_id=None): body_json=query) hits = response_json['hits']['hits'] - return _get_entity_from_hits(hits, has_token=self.nexus_token, uuid=uuid, hbm_id=hbm_id) + return _get_entity_from_hits(hits, has_token=self.groups_token, uuid=uuid, hbm_id=hbm_id) def get_latest_entity_uuid(self, uuid, type): lowercase_type = type.lower() @@ -147,7 +147,7 @@ def get_vitessce_conf_cells_and_lifted_uuid(self, entity): if isinstance(Builder, NullViewConfBuilder): vc = Builder() else: - vc = Builder(entity, self.nexus_token) + vc = Builder(entity, self.groups_token) return VitessceConfLiftedUUID(vc.get_conf_cells(), None) except Exception: message = f'Building vitessce conf threw error: {traceback.format_exc()}' diff --git a/context/app/api/vitessce_confs/assay_confs.py b/context/app/api/vitessce_confs/assay_confs.py index 1e3f2ae17f..534882e828 100644 --- a/context/app/api/vitessce_confs/assay_confs.py +++ b/context/app/api/vitessce_confs/assay_confs.py @@ -130,7 +130,7 @@ def get_conf_cells(self): for tile in sorted(found_tiles): vc = SPRMJSONViewConfBuilder( entity=self._entity, - nexus_token=self._nexus_token, + groups_token=self._groups_token, is_mock=self._is_mock, base_name=tile, imaging_path=CODEX_TILE_DIR @@ -149,8 +149,8 @@ class RNASeqViewConfBuilder(AbstractScatterplotViewConfBuilder): from h5ad-to-arrow.cwl (August 2020 release). """ - def __init__(self, entity, nexus_token, is_mock=False): - super().__init__(entity, nexus_token, is_mock) + def __init__(self, entity, groups_token, is_mock=False): + super().__init__(entity, groups_token, is_mock) # All "file" Vitessce objects that do not have wrappers. self._files = [ { @@ -172,8 +172,8 @@ class ATACSeqViewConfBuilder(AbstractScatterplotViewConfBuilder): from h5ad-to-arrow.cwl. """ - def __init__(self, entity, nexus_token, is_mock=False): - super().__init__(entity, nexus_token, is_mock) + def __init__(self, entity, groups_token, is_mock=False): + super().__init__(entity, groups_token, is_mock) # All "file" Vitessce objects that do not have wrappers. self._files = [ { @@ -210,7 +210,7 @@ def get_conf_cells(self): for region in sorted(found_regions): vc = SPRMAnnDataViewConfBuilder( entity=self._entity, - nexus_token=self._nexus_token, + groups_token=self._groups_token, is_mock=self._is_mock, base_name=region, imaging_path=STITCHED_IMAGE_DIR, @@ -234,8 +234,8 @@ class RNASeqAnnDataZarrViewConfBuilder(ViewConfBuilder): https://portal.hubmapconsortium.org/browse/dataset/e65175561b4b17da5352e3837aa0e497 """ - def __init__(self, entity, nexus_token, is_mock=False): - super().__init__(entity, nexus_token, is_mock) + def __init__(self, entity, groups_token, is_mock=False): + super().__init__(entity, groups_token, is_mock) # Spatially resolved RNA-seq assays require some special handling, # and others do not. self._is_spatial = False @@ -290,8 +290,8 @@ class SpatialRNASeqAnnDataZarrViewConfBuilder(RNASeqAnnDataZarrViewConfBuilder): https://portal.hubmapconsortium.org/browse/dataset/e65175561b4b17da5352e3837aa0e497 """ - def __init__(self, entity, nexus_token, is_mock=False): - super().__init__(entity, nexus_token, is_mock) + def __init__(self, entity, groups_token, is_mock=False): + super().__init__(entity, groups_token, is_mock) # Spatially resolved RNA-seq assays require some special handling, # and others do not. self._is_spatial = True @@ -322,8 +322,8 @@ class IMSViewConfBuilder(ImagePyramidViewConfBuilder): of all the channels separated out. """ - def __init__(self, entity, nexus_token, is_mock=False): - super().__init__(entity, nexus_token, is_mock) + def __init__(self, entity, groups_token, is_mock=False): + super().__init__(entity, groups_token, is_mock) # Do not show the separated mass-spec images. self.image_pyramid_regex = ( re.escape(IMAGE_PYRAMID_DIR) + r"(?!/ometiffs/separate/)" diff --git a/context/app/api/vitessce_confs/base_confs.py b/context/app/api/vitessce_confs/base_confs.py index 6e22cf458d..57e40fd3cd 100644 --- a/context/app/api/vitessce_confs/base_confs.py +++ b/context/app/api/vitessce_confs/base_confs.py @@ -30,18 +30,18 @@ def get_conf_cells(self): class ViewConfBuilder: - def __init__(self, entity=None, nexus_token=None, is_mock=False): + def __init__(self, entity=None, groups_token=None, is_mock=False): """Object for building the vitessce configuration. :param dict entity: Entity response from search index (from the entity API) - :param str nexus_token: Nexus token for use in authenticating API + :param str groups_token: Groups token for use in authenticating API :param bool is_mock: Wether or not this class is being mocked. - >>> vc = ViewConfBuilder(entity={"uuid": "uuid"}, nexus_token='nexus_token', is_mock=True) + >>> vc = ViewConfBuilder(entity={"uuid": "uuid"}, groups_token='groups_token', is_mock=True) """ self._uuid = entity["uuid"] - self._nexus_token = nexus_token + self._groups_token = groups_token self._entity = entity self._is_mock = is_mock self._files = [] @@ -54,12 +54,12 @@ def _replace_url_in_file(self, file): :param dict file: File dict which will have its rel_path replaced by url :rtype: dict The file with rel_path replaced by url >>> from pprint import pprint - >>> vc = ViewConfBuilder(entity={"uuid": "uuid"}, nexus_token='nexus_token', is_mock=True) + >>> vc = ViewConfBuilder(entity={"uuid": "uuid"}, groups_token='groups_token', is_mock=True) >>> file = { 'data_type': 'CELLS', 'file_type': 'cells.json', 'rel_path': 'cells.json' } >>> pprint(vc._replace_url_in_file(file)) {'data_type': 'CELLS',\n\ 'file_type': 'cells.json',\n\ - 'url': 'https://example.com/uuid/cells.json?token=nexus_token'} + 'url': 'https://example.com/uuid/cells.json?token=groups_token'} """ return { @@ -71,12 +71,12 @@ def _replace_url_in_file(self, file): def _build_assets_url(self, rel_path, use_token=True): """Create a url for an asset. :param str rel_path: The path off of which the url should be built - :param bool use_token: Whether or not to append a nexus token to the URL, default True + :param bool use_token: Whether or not to append a groups token to the URL, default True :rtype: dict The file with rel_path replaced by url - >>> vc = ViewConfBuilder(entity={"uuid": "uuid"}, nexus_token='nexus_token', is_mock=True) + >>> vc = ViewConfBuilder(entity={"uuid": "uuid"}, groups_token='groups_token', is_mock=True) >>> vc._build_assets_url("rel_path/to/clusters.ome.tiff") - 'https://example.com/uuid/rel_path/to/clusters.ome.tiff?token=nexus_token' + 'https://example.com/uuid/rel_path/to/clusters.ome.tiff?token=groups_token' """ if not self._is_mock: @@ -84,7 +84,7 @@ def _build_assets_url(self, rel_path, use_token=True): else: assets_endpoint = MOCK_URL base_url = urllib.parse.urljoin(assets_endpoint, f"{self._uuid}/{rel_path}") - token_param = urllib.parse.urlencode({"token": self._nexus_token}) + token_param = urllib.parse.urlencode({"token": self._groups_token}) return f"{base_url}?{token_param}" if use_token else base_url def _get_request_init(self): @@ -93,14 +93,14 @@ def _get_request_init(self): not the above _build_assets_url function. >>> entity = {"uuid": "uuid", "status": "QA"} - >>> vc = ViewConfBuilder(entity=entity, nexus_token='nexus_token', is_mock=True) + >>> vc = ViewConfBuilder(entity=entity, groups_token='groups_token', is_mock=True) >>> vc._get_request_init() - {'headers': {'Authorization': 'Bearer nexus_token'}} + {'headers': {'Authorization': 'Bearer groups_token'}} >>> entity = {"uuid": "uuid", "status": "Published"} - >>> vc = ViewConfBuilder(entity=entity, nexus_token='nexus_token', is_mock=True) + >>> vc = ViewConfBuilder(entity=entity, groups_token='groups_token', is_mock=True) >>> assert vc._get_request_init() is None # None because dataset is Published (public) """ - request_init = {"headers": {"Authorization": f"Bearer {self._nexus_token}"}} + request_init = {"headers": {"Authorization": f"Bearer {self._groups_token}"}} # Extra headers outside of a select few cause extra CORS-preflight requests which # can slow down the webpage. If the dataset is published, we don't need to use # heaeder to authenticate access to the assets API. @@ -113,7 +113,7 @@ def _get_file_paths(self): >>> files = [{ "rel_path": "path/to/file" }, { "rel_path": "path/to/other_file" }] >>> entity = {"uuid": "uuid", "files": files} - >>> vc = ViewConfBuilder(entity=entity, nexus_token='nexus_token', is_mock=True) + >>> vc = ViewConfBuilder(entity=entity, groups_token='groups_token', is_mock=True) >>> vc._get_file_paths() ['path/to/file', 'path/to/other_file'] """ @@ -130,11 +130,11 @@ def _get_img_and_offset_url(self, img_path, img_dir): >>> from pprint import pprint >>> vc = AbstractImagingViewConfBuilder(entity={ "uuid": "uuid" },\ - nexus_token='nexus_token', is_mock=True) + groups_token='groups_token', is_mock=True) >>> pprint(vc._get_img_and_offset_url("rel_path/to/clusters.ome.tiff",\ "rel_path/to")) - ('https://example.com/uuid/rel_path/to/clusters.ome.tiff?token=nexus_token',\n\ - 'https://example.com/uuid/output_offsets/clusters.offsets.json?token=nexus_token') + ('https://example.com/uuid/rel_path/to/clusters.ome.tiff?token=groups_token',\n\ + 'https://example.com/uuid/output_offsets/clusters.offsets.json?token=groups_token') """ img_url = self._build_assets_url(img_path) @@ -159,13 +159,13 @@ def _setup_view_config_raster(self, vc, dataset, disable_3d=[]): class ImagePyramidViewConfBuilder(AbstractImagingViewConfBuilder): - def __init__(self, entity, nexus_token, is_mock=False): + def __init__(self, entity, groups_token, is_mock=False): """Wrapper class for creating a standard view configuration for image pyramids, i.e for high resolution viz-lifted imaging datasets like https://portal.hubmapconsortium.org/browse/dataset/dc289471333309925e46ceb9bafafaf4 """ self.image_pyramid_regex = IMAGE_PYRAMID_DIR - super().__init__(entity, nexus_token, is_mock) + super().__init__(entity, groups_token, is_mock) def get_conf_cells(self): file_paths_found = self._get_file_paths() @@ -269,9 +269,9 @@ class SPRMJSONViewConfBuilder(SPRMViewConfBuilder): https://portal.hubmapconsortium.org/browse/dataset/dc31a6d06daa964299224e9c8d6cafb3 """ - def __init__(self, entity, nexus_token, is_mock=False, **kwargs): + def __init__(self, entity, groups_token, is_mock=False, **kwargs): # All "file" Vitessce objects that do not have wrappers. - super().__init__(entity, nexus_token, is_mock) + super().__init__(entity, groups_token, is_mock) # These are both something like R001_X009_Y009 because # there is no mask used here or shared name with the mask data. self._base_name = kwargs["base_name"] @@ -348,8 +348,8 @@ class SPRMAnnDataViewConfBuilder(SPRMViewConfBuilder): of the image and mask relative to image_pyramid_regex """ - def __init__(self, entity, nexus_token, is_mock=False, **kwargs): - super().__init__(entity, nexus_token, is_mock) + def __init__(self, entity, groups_token, is_mock=False, **kwargs): + super().__init__(entity, groups_token, is_mock) self._base_name = kwargs["base_name"] self._mask_name = kwargs["mask_name"] self._image_name = kwargs["image_name"] diff --git a/context/app/api/vitessce_confs/fixtures/output_expected/atac_conf.json b/context/app/api/vitessce_confs/fixtures/output_expected/atac_conf.json index 919d1f928f..d09b5bf84e 100644 --- a/context/app/api/vitessce_confs/fixtures/output_expected/atac_conf.json +++ b/context/app/api/vitessce_confs/fixtures/output_expected/atac_conf.json @@ -8,12 +8,12 @@ "name": "Visualization Files", "files": [ { - "url": "https://example.com/210d118a14c8624b6bb9610a9062656e/output/umap_coords_clusters.cells.json?token=nexus_token", + "url": "https://example.com/210d118a14c8624b6bb9610a9062656e/output/umap_coords_clusters.cells.json?token=groups_token", "type": "cells", "fileType": "cells.json" }, { - "url": "https://example.com/210d118a14c8624b6bb9610a9062656e/output/umap_coords_clusters.cell-sets.json?token=nexus_token", + "url": "https://example.com/210d118a14c8624b6bb9610a9062656e/output/umap_coords_clusters.cell-sets.json?token=groups_token", "type": "cell-sets", "fileType": "cell-sets.json" } diff --git a/context/app/api/vitessce_confs/fixtures/output_expected/cytokit_anndata_conf.json b/context/app/api/vitessce_confs/fixtures/output_expected/cytokit_anndata_conf.json index 8547a78a33..7937bdfa0e 100644 --- a/context/app/api/vitessce_confs/fixtures/output_expected/cytokit_anndata_conf.json +++ b/context/app/api/vitessce_confs/fixtures/output_expected/cytokit_anndata_conf.json @@ -27,7 +27,7 @@ }, "requestInit": { "headers": { - "Authorization": "Bearer nexus_token" + "Authorization": "Bearer groups_token" } } }, @@ -67,7 +67,7 @@ ], "requestInit": { "headers": { - "Authorization": "Bearer nexus_token" + "Authorization": "Bearer groups_token" } } }, @@ -80,7 +80,7 @@ }, "requestInit": { "headers": { - "Authorization": "Bearer nexus_token" + "Authorization": "Bearer groups_token" } } }, @@ -95,19 +95,19 @@ { "name": "reg1_stitched_expressions", "type": "ome-tiff", - "url": "https://example.com/2f8d43199ca3167e991b320038024b77/ometiff-pyramids/stitched/expressions/reg1_stitched_expressions.ome.tiff?token=nexus_token", + "url": "https://example.com/2f8d43199ca3167e991b320038024b77/ometiff-pyramids/stitched/expressions/reg1_stitched_expressions.ome.tiff?token=groups_token", "metadata": { "isBitmask": false, - "omeTiffOffsetsUrl": "https://example.com/2f8d43199ca3167e991b320038024b77/output_offsets/stitched/expressions/reg1_stitched_expressions.offsets.json?token=nexus_token" + "omeTiffOffsetsUrl": "https://example.com/2f8d43199ca3167e991b320038024b77/output_offsets/stitched/expressions/reg1_stitched_expressions.offsets.json?token=groups_token" } }, { "name": "reg1_stitched_mask", "type": "ome-tiff", - "url": "https://example.com/2f8d43199ca3167e991b320038024b77/ometiff-pyramids/stitched/mask/reg1_stitched_mask.ome.tiff?token=nexus_token", + "url": "https://example.com/2f8d43199ca3167e991b320038024b77/ometiff-pyramids/stitched/mask/reg1_stitched_mask.ome.tiff?token=groups_token", "metadata": { "isBitmask": true, - "omeTiffOffsetsUrl": "https://example.com/2f8d43199ca3167e991b320038024b77/output_offsets/stitched/mask/reg1_stitched_mask.offsets.json?token=nexus_token" + "omeTiffOffsetsUrl": "https://example.com/2f8d43199ca3167e991b320038024b77/output_offsets/stitched/mask/reg1_stitched_mask.offsets.json?token=groups_token" } } ] @@ -229,7 +229,7 @@ }, "requestInit": { "headers": { - "Authorization": "Bearer nexus_token" + "Authorization": "Bearer groups_token" } } }, @@ -269,7 +269,7 @@ ], "requestInit": { "headers": { - "Authorization": "Bearer nexus_token" + "Authorization": "Bearer groups_token" } } }, @@ -282,7 +282,7 @@ }, "requestInit": { "headers": { - "Authorization": "Bearer nexus_token" + "Authorization": "Bearer groups_token" } } }, @@ -297,19 +297,19 @@ { "name": "reg2_stitched_expressions", "type": "ome-tiff", - "url": "https://example.com/2f8d43199ca3167e991b320038024b77/ometiff-pyramids/stitched/expressions/reg2_stitched_expressions.ome.tiff?token=nexus_token", + "url": "https://example.com/2f8d43199ca3167e991b320038024b77/ometiff-pyramids/stitched/expressions/reg2_stitched_expressions.ome.tiff?token=groups_token", "metadata": { "isBitmask": false, - "omeTiffOffsetsUrl": "https://example.com/2f8d43199ca3167e991b320038024b77/output_offsets/stitched/expressions/reg2_stitched_expressions.offsets.json?token=nexus_token" + "omeTiffOffsetsUrl": "https://example.com/2f8d43199ca3167e991b320038024b77/output_offsets/stitched/expressions/reg2_stitched_expressions.offsets.json?token=groups_token" } }, { "name": "reg2_stitched_mask", "type": "ome-tiff", - "url": "https://example.com/2f8d43199ca3167e991b320038024b77/ometiff-pyramids/stitched/mask/reg2_stitched_mask.ome.tiff?token=nexus_token", + "url": "https://example.com/2f8d43199ca3167e991b320038024b77/ometiff-pyramids/stitched/mask/reg2_stitched_mask.ome.tiff?token=groups_token", "metadata": { "isBitmask": true, - "omeTiffOffsetsUrl": "https://example.com/2f8d43199ca3167e991b320038024b77/output_offsets/stitched/mask/reg2_stitched_mask.offsets.json?token=nexus_token" + "omeTiffOffsetsUrl": "https://example.com/2f8d43199ca3167e991b320038024b77/output_offsets/stitched/mask/reg2_stitched_mask.offsets.json?token=groups_token" } } ] diff --git a/context/app/api/vitessce_confs/fixtures/output_expected/cytokit_json_conf.json b/context/app/api/vitessce_confs/fixtures/output_expected/cytokit_json_conf.json index 2aa9d8826a..b470f92d89 100644 --- a/context/app/api/vitessce_confs/fixtures/output_expected/cytokit_json_conf.json +++ b/context/app/api/vitessce_confs/fixtures/output_expected/cytokit_json_conf.json @@ -9,17 +9,17 @@ "name": "SPRM", "files": [ { - "url": "https://example.com/2f8d43199ca3167e991b320038024b77/output_json/R001_X001_Y001.cells.json?token=nexus_token", + "url": "https://example.com/2f8d43199ca3167e991b320038024b77/output_json/R001_X001_Y001.cells.json?token=groups_token", "type": "cells", "fileType": "cells.json" }, { - "url": "https://example.com/2f8d43199ca3167e991b320038024b77/output_json/R001_X001_Y001.cell-sets.json?token=nexus_token", + "url": "https://example.com/2f8d43199ca3167e991b320038024b77/output_json/R001_X001_Y001.cell-sets.json?token=groups_token", "type": "cell-sets", "fileType": "cell-sets.json" }, { - "url": "https://example.com/2f8d43199ca3167e991b320038024b77/output_json/R001_X001_Y001.clusters.json?token=nexus_token", + "url": "https://example.com/2f8d43199ca3167e991b320038024b77/output_json/R001_X001_Y001.clusters.json?token=groups_token", "type": "expression-matrix", "fileType": "clusters.json" }, @@ -32,10 +32,10 @@ { "name": "R001_X001_Y001", "type": "ome-tiff", - "url": "https://example.com/2f8d43199ca3167e991b320038024b77/output/extract/expressions/ome-tiff/R001_X001_Y001.ome.tiff?token=nexus_token", + "url": "https://example.com/2f8d43199ca3167e991b320038024b77/output/extract/expressions/ome-tiff/R001_X001_Y001.ome.tiff?token=groups_token", "metadata": { "isBitmask": false, - "omeTiffOffsetsUrl": "https://example.com/2f8d43199ca3167e991b320038024b77/output_offsets/R001_X001_Y001.offsets.json?token=nexus_token" + "omeTiffOffsetsUrl": "https://example.com/2f8d43199ca3167e991b320038024b77/output_offsets/R001_X001_Y001.offsets.json?token=groups_token" } } ] @@ -133,17 +133,17 @@ "name": "SPRM", "files": [ { - "url": "https://example.com/2f8d43199ca3167e991b320038024b77/output_json/R001_X001_Y002.cells.json?token=nexus_token", + "url": "https://example.com/2f8d43199ca3167e991b320038024b77/output_json/R001_X001_Y002.cells.json?token=groups_token", "type": "cells", "fileType": "cells.json" }, { - "url": "https://example.com/2f8d43199ca3167e991b320038024b77/output_json/R001_X001_Y002.cell-sets.json?token=nexus_token", + "url": "https://example.com/2f8d43199ca3167e991b320038024b77/output_json/R001_X001_Y002.cell-sets.json?token=groups_token", "type": "cell-sets", "fileType": "cell-sets.json" }, { - "url": "https://example.com/2f8d43199ca3167e991b320038024b77/output_json/R001_X001_Y002.clusters.json?token=nexus_token", + "url": "https://example.com/2f8d43199ca3167e991b320038024b77/output_json/R001_X001_Y002.clusters.json?token=groups_token", "type": "expression-matrix", "fileType": "clusters.json" }, @@ -156,10 +156,10 @@ { "name": "R001_X001_Y002", "type": "ome-tiff", - "url": "https://example.com/2f8d43199ca3167e991b320038024b77/output/extract/expressions/ome-tiff/R001_X001_Y002.ome.tiff?token=nexus_token", + "url": "https://example.com/2f8d43199ca3167e991b320038024b77/output/extract/expressions/ome-tiff/R001_X001_Y002.ome.tiff?token=groups_token", "metadata": { "isBitmask": false, - "omeTiffOffsetsUrl": "https://example.com/2f8d43199ca3167e991b320038024b77/output_offsets/R001_X001_Y002.offsets.json?token=nexus_token" + "omeTiffOffsetsUrl": "https://example.com/2f8d43199ca3167e991b320038024b77/output_offsets/R001_X001_Y002.offsets.json?token=groups_token" } } ] diff --git a/context/app/api/vitessce_confs/fixtures/output_expected/image_pyramid_conf.json b/context/app/api/vitessce_confs/fixtures/output_expected/image_pyramid_conf.json index d7cb73c655..2ed95a522b 100644 --- a/context/app/api/vitessce_confs/fixtures/output_expected/image_pyramid_conf.json +++ b/context/app/api/vitessce_confs/fixtures/output_expected/image_pyramid_conf.json @@ -17,10 +17,10 @@ { "name": "VAN0003-LK-33-2-PAS_FFPE.ome.tif", "type": "ome-tiff", - "url": "https://example.com/f9ae931b8b49252f150d7f8bf1d2d13f/ometiff-pyramids/processedMicroscopy/VAN0003-LK-33-2-PAS_FFPE.ome.tif?token=nexus_token", + "url": "https://example.com/f9ae931b8b49252f150d7f8bf1d2d13f/ometiff-pyramids/processedMicroscopy/VAN0003-LK-33-2-PAS_FFPE.ome.tif?token=groups_token", "metadata": { "isBitmask": false, - "omeTiffOffsetsUrl": "https://example.com/f9ae931b8b49252f150d7f8bf1d2d13f/output_offsets/processedMicroscopy/VAN0003-LK-33-2-PAS_FFPE.offsets.json?token=nexus_token" + "omeTiffOffsetsUrl": "https://example.com/f9ae931b8b49252f150d7f8bf1d2d13f/output_offsets/processedMicroscopy/VAN0003-LK-33-2-PAS_FFPE.offsets.json?token=groups_token" } } ] diff --git a/context/app/api/vitessce_confs/fixtures/output_expected/ims_conf.json b/context/app/api/vitessce_confs/fixtures/output_expected/ims_conf.json index b20fe28802..a43baf50a6 100644 --- a/context/app/api/vitessce_confs/fixtures/output_expected/ims_conf.json +++ b/context/app/api/vitessce_confs/fixtures/output_expected/ims_conf.json @@ -17,10 +17,10 @@ { "name": "VAN0003-LK-32-21-IMS_NegMode_multilayer.ome.tif", "type": "ome-tiff", - "url": "https://example.com/954281e9fd8732adfa4479e0d238ce8d/ometiff-pyramids/ometiffs/VAN0003-LK-32-21-IMS_NegMode_multilayer.ome.tif?token=nexus_token", + "url": "https://example.com/954281e9fd8732adfa4479e0d238ce8d/ometiff-pyramids/ometiffs/VAN0003-LK-32-21-IMS_NegMode_multilayer.ome.tif?token=groups_token", "metadata": { "isBitmask": false, - "omeTiffOffsetsUrl": "https://example.com/954281e9fd8732adfa4479e0d238ce8d/output_offsets/ometiffs/VAN0003-LK-32-21-IMS_NegMode_multilayer.offsets.json?token=nexus_token" + "omeTiffOffsetsUrl": "https://example.com/954281e9fd8732adfa4479e0d238ce8d/output_offsets/ometiffs/VAN0003-LK-32-21-IMS_NegMode_multilayer.offsets.json?token=groups_token" } } ] diff --git a/context/app/api/vitessce_confs/fixtures/output_expected/rna_conf.json b/context/app/api/vitessce_confs/fixtures/output_expected/rna_conf.json index f34bffb843..8739bb00cf 100644 --- a/context/app/api/vitessce_confs/fixtures/output_expected/rna_conf.json +++ b/context/app/api/vitessce_confs/fixtures/output_expected/rna_conf.json @@ -8,12 +8,12 @@ "name": "Visualization Files", "files": [ { - "url": "https://example.com/14946a8eb12f2d787302f818b72fdc4e/cluster-marker-genes/output/cluster_marker_genes.cells.json?token=nexus_token", + "url": "https://example.com/14946a8eb12f2d787302f818b72fdc4e/cluster-marker-genes/output/cluster_marker_genes.cells.json?token=groups_token", "type": "cells", "fileType": "cells.json" }, { - "url": "https://example.com/14946a8eb12f2d787302f818b72fdc4e/cluster-marker-genes/output/cluster_marker_genes.cell-sets.json?token=nexus_token", + "url": "https://example.com/14946a8eb12f2d787302f818b72fdc4e/cluster-marker-genes/output/cluster_marker_genes.cell-sets.json?token=groups_token", "type": "cell-sets", "fileType": "cell-sets.json" } diff --git a/context/app/api/vitessce_confs/fixtures/output_expected/rna_zarr_conf.json b/context/app/api/vitessce_confs/fixtures/output_expected/rna_zarr_conf.json index 5e314bafd7..a0d4ac3917 100644 --- a/context/app/api/vitessce_confs/fixtures/output_expected/rna_zarr_conf.json +++ b/context/app/api/vitessce_confs/fixtures/output_expected/rna_zarr_conf.json @@ -21,21 +21,21 @@ "obs/marker_gene_4" ] }, - "requestInit": { "headers": { "Authorization": "Bearer nexus_token" } } + "requestInit": { "headers": { "Authorization": "Bearer groups_token" } } }, { "type": "cell-sets", "fileType": "anndata-cell-sets.zarr", "url": "https://example.com/3b066aa664e1a32eaea957927baf92e2/hubmap_ui/anndata-zarr/secondary_analysis.zarr", "options": [{ "groupName": "Leiden", "setName": "obs/leiden" }], - "requestInit": { "headers": { "Authorization": "Bearer nexus_token" } } + "requestInit": { "headers": { "Authorization": "Bearer groups_token" } } }, { "type": "expression-matrix", "fileType": "anndata-expression-matrix.zarr", "url": "https://example.com/3b066aa664e1a32eaea957927baf92e2/hubmap_ui/anndata-zarr/secondary_analysis.zarr", "options": { "matrix": "X", "matrixGeneFilter": "var/marker_genes_for_heatmap" }, - "requestInit": { "headers": { "Authorization": "Bearer nexus_token" } } + "requestInit": { "headers": { "Authorization": "Bearer groups_token" } } } ] } diff --git a/context/app/api/vitessce_confs/fixtures/output_expected/seqfish_conf.json b/context/app/api/vitessce_confs/fixtures/output_expected/seqfish_conf.json index e3bd46c51b..7c234cf64d 100644 --- a/context/app/api/vitessce_confs/fixtures/output_expected/seqfish_conf.json +++ b/context/app/api/vitessce_confs/fixtures/output_expected/seqfish_conf.json @@ -18,19 +18,19 @@ { "name": "HybCycle_12", "type": "ome-tiff", - "url": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/ometiff-pyramids/HybCycle_12/MMStack_Pos12.ome.tif?token=nexus_token", + "url": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/ometiff-pyramids/HybCycle_12/MMStack_Pos12.ome.tif?token=groups_token", "metadata": { "isBitmask": false, - "omeTiffOffsetsUrl": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/output_offsets/HybCycle_12/MMStack_Pos12.offsets.json?token=nexus_token" + "omeTiffOffsetsUrl": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/output_offsets/HybCycle_12/MMStack_Pos12.offsets.json?token=groups_token" } }, { "name": "final_mRNA_background", "type": "ome-tiff", - "url": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/ometiff-pyramids/final_mRNA_background/MMStack_Pos12.ome.tif?token=nexus_token", + "url": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/ometiff-pyramids/final_mRNA_background/MMStack_Pos12.ome.tif?token=groups_token", "metadata": { "isBitmask": false, - "omeTiffOffsetsUrl": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/output_offsets/final_mRNA_background/MMStack_Pos12.offsets.json?token=nexus_token" + "omeTiffOffsetsUrl": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/output_offsets/final_mRNA_background/MMStack_Pos12.offsets.json?token=groups_token" } } ] @@ -100,19 +100,19 @@ { "name": "HybCycle_12", "type": "ome-tiff", - "url": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/ometiff-pyramids/HybCycle_12/MMStack_Pos13.ome.tif?token=nexus_token", + "url": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/ometiff-pyramids/HybCycle_12/MMStack_Pos13.ome.tif?token=groups_token", "metadata": { "isBitmask": false, - "omeTiffOffsetsUrl": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/output_offsets/HybCycle_12/MMStack_Pos13.offsets.json?token=nexus_token" + "omeTiffOffsetsUrl": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/output_offsets/HybCycle_12/MMStack_Pos13.offsets.json?token=groups_token" } }, { "name": "final_mRNA_background", "type": "ome-tiff", - "url": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/ometiff-pyramids/final_mRNA_background/MMStack_Pos13.ome.tif?token=nexus_token", + "url": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/ometiff-pyramids/final_mRNA_background/MMStack_Pos13.ome.tif?token=groups_token", "metadata": { "isBitmask": false, - "omeTiffOffsetsUrl": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/output_offsets/final_mRNA_background/MMStack_Pos13.offsets.json?token=nexus_token" + "omeTiffOffsetsUrl": "https://example.com/9db61adfc017670a196ea9b3ca1852a0/output_offsets/final_mRNA_background/MMStack_Pos13.offsets.json?token=groups_token" } } ] diff --git a/context/app/api/vitessce_confs/fixtures/output_expected/spatial_rna_zarr_conf.json b/context/app/api/vitessce_confs/fixtures/output_expected/spatial_rna_zarr_conf.json index a1026552c8..69e72e6b5a 100644 --- a/context/app/api/vitessce_confs/fixtures/output_expected/spatial_rna_zarr_conf.json +++ b/context/app/api/vitessce_confs/fixtures/output_expected/spatial_rna_zarr_conf.json @@ -22,21 +22,21 @@ "obs/marker_gene_4" ] }, - "requestInit": { "headers": { "Authorization": "Bearer nexus_token" } } + "requestInit": { "headers": { "Authorization": "Bearer groups_token" } } }, { "type": "cell-sets", "fileType": "anndata-cell-sets.zarr", "url": "https://example.com/3b066aa664e1a32eaea957927baf92e2/hubmap_ui/anndata-zarr/secondary_analysis.zarr", "options": [{ "groupName": "Leiden", "setName": "obs/leiden" }], - "requestInit": { "headers": { "Authorization": "Bearer nexus_token" } } + "requestInit": { "headers": { "Authorization": "Bearer groups_token" } } }, { "type": "expression-matrix", "fileType": "anndata-expression-matrix.zarr", "url": "https://example.com/3b066aa664e1a32eaea957927baf92e2/hubmap_ui/anndata-zarr/secondary_analysis.zarr", "options": { "matrix": "X", "matrixGeneFilter": "var/marker_genes_for_heatmap" }, - "requestInit": { "headers": { "Authorization": "Bearer nexus_token" } } + "requestInit": { "headers": { "Authorization": "Bearer groups_token" } } } ] } diff --git a/context/app/api/vitessce_confs/fixtures/output_expected/sprm_anndata_conf.json b/context/app/api/vitessce_confs/fixtures/output_expected/sprm_anndata_conf.json index 33b5962139..e2caccb0e4 100644 --- a/context/app/api/vitessce_confs/fixtures/output_expected/sprm_anndata_conf.json +++ b/context/app/api/vitessce_confs/fixtures/output_expected/sprm_anndata_conf.json @@ -26,7 +26,7 @@ }, "requestInit": { "headers": { - "Authorization": "Bearer nexus_token" + "Authorization": "Bearer groups_token" } } }, @@ -66,7 +66,7 @@ ], "requestInit": { "headers": { - "Authorization": "Bearer nexus_token" + "Authorization": "Bearer groups_token" } } }, @@ -79,7 +79,7 @@ }, "requestInit": { "headers": { - "Authorization": "Bearer nexus_token" + "Authorization": "Bearer groups_token" } } }, @@ -94,19 +94,19 @@ { "name": "expressions", "type": "ome-tiff", - "url": "https://example.com/2f8d43199ca3167e991b320038024b77/ometiff-pyramids/imaging_path/expressions.ome.tiff?token=nexus_token", + "url": "https://example.com/2f8d43199ca3167e991b320038024b77/ometiff-pyramids/imaging_path/expressions.ome.tiff?token=groups_token", "metadata": { "isBitmask": false, - "omeTiffOffsetsUrl": "https://example.com/2f8d43199ca3167e991b320038024b77/output_offsets/imaging_path/expressions.offsets.json?token=nexus_token" + "omeTiffOffsetsUrl": "https://example.com/2f8d43199ca3167e991b320038024b77/output_offsets/imaging_path/expressions.offsets.json?token=groups_token" } }, { "name": "mask", "type": "ome-tiff", - "url": "https://example.com/2f8d43199ca3167e991b320038024b77/ometiff-pyramids/imaging_path/mask.ome.tiff?token=nexus_token", + "url": "https://example.com/2f8d43199ca3167e991b320038024b77/ometiff-pyramids/imaging_path/mask.ome.tiff?token=groups_token", "metadata": { "isBitmask": true, - "omeTiffOffsetsUrl": "https://example.com/2f8d43199ca3167e991b320038024b77/output_offsets/imaging_path/mask.offsets.json?token=nexus_token" + "omeTiffOffsetsUrl": "https://example.com/2f8d43199ca3167e991b320038024b77/output_offsets/imaging_path/mask.offsets.json?token=groups_token" } } ] diff --git a/context/app/api/vitessce_confs/fixtures/output_expected/sprm_conf.json b/context/app/api/vitessce_confs/fixtures/output_expected/sprm_conf.json index 5f81e29be5..a4df5b5a02 100644 --- a/context/app/api/vitessce_confs/fixtures/output_expected/sprm_conf.json +++ b/context/app/api/vitessce_confs/fixtures/output_expected/sprm_conf.json @@ -8,17 +8,17 @@ "name": "SPRM", "files": [ { - "url": "https://example.com/2f8d43199ca3167e991b320038024b77/output_json/BASE_NAME.cells.json?token=nexus_token", + "url": "https://example.com/2f8d43199ca3167e991b320038024b77/output_json/BASE_NAME.cells.json?token=groups_token", "type": "cells", "fileType": "cells.json" }, { - "url": "https://example.com/2f8d43199ca3167e991b320038024b77/output_json/BASE_NAME.cell-sets.json?token=nexus_token", + "url": "https://example.com/2f8d43199ca3167e991b320038024b77/output_json/BASE_NAME.cell-sets.json?token=groups_token", "type": "cell-sets", "fileType": "cell-sets.json" }, { - "url": "https://example.com/2f8d43199ca3167e991b320038024b77/output_json/BASE_NAME.clusters.json?token=nexus_token", + "url": "https://example.com/2f8d43199ca3167e991b320038024b77/output_json/BASE_NAME.clusters.json?token=groups_token", "type": "expression-matrix", "fileType": "clusters.json" }, @@ -31,10 +31,10 @@ { "name": "BASE_NAME", "type": "ome-tiff", - "url": "https://example.com/2f8d43199ca3167e991b320038024b77/imaging_path/BASE_NAME.ome.tiff?token=nexus_token", + "url": "https://example.com/2f8d43199ca3167e991b320038024b77/imaging_path/BASE_NAME.ome.tiff?token=groups_token", "metadata": { "isBitmask": false, - "omeTiffOffsetsUrl": "https://example.com/2f8d43199ca3167e991b320038024b77/output_offsets/BASE_NAME.offsets.json?token=nexus_token" + "omeTiffOffsetsUrl": "https://example.com/2f8d43199ca3167e991b320038024b77/output_offsets/BASE_NAME.offsets.json?token=groups_token" } } ] diff --git a/context/app/api/vitessce_confs/test_confs.py b/context/app/api/vitessce_confs/test_confs.py index 2e0acb3aca..ad2eafbb2f 100644 --- a/context/app/api/vitessce_confs/test_confs.py +++ b/context/app/api/vitessce_confs/test_confs.py @@ -17,7 +17,7 @@ StitchedCytokitSPRMViewConfBuilder ) -MOCK_NEXUS_TOKEN = "nexus_token" +MOCK_GROUPS_TOKEN = "groups_token" FIXTURES_INPUT_DIR = "fixtures/input_entity" FIXTURES_EXPECTED_OUTPUT_DIR = "fixtures/output_expected" @@ -55,7 +55,7 @@ def test_assays(): if assay in ["sprm", "sprm_anndata"]: vc = AssayViewConfClass( entity=entity, - nexus_token=MOCK_NEXUS_TOKEN, + groups_token=MOCK_GROUPS_TOKEN, is_mock=True, base_name=BASE_NAME_FOR_SPRM, imaging_path="imaging_path", @@ -65,7 +65,7 @@ def test_assays(): ) else: vc = AssayViewConfClass( - entity=entity, nexus_token=MOCK_NEXUS_TOKEN, is_mock=True + entity=entity, groups_token=MOCK_GROUPS_TOKEN, is_mock=True ) conf = vc.get_conf_cells().conf conf_expected = json.loads( @@ -81,7 +81,7 @@ def test_assays(): if assay in ["sprm", "sprm_anndata"]: vc = AssayViewConfClass( entity=malformed_entity, - nexus_token=MOCK_NEXUS_TOKEN, + groups_token=MOCK_GROUPS_TOKEN, is_mock=True, base_name=BASE_NAME_FOR_SPRM, imaging_path="imaging_path", @@ -91,7 +91,7 @@ def test_assays(): ) else: vc = AssayViewConfClass( - entity=malformed_entity, nexus_token=MOCK_NEXUS_TOKEN, is_mock=True + entity=malformed_entity, groups_token=MOCK_GROUPS_TOKEN, is_mock=True ) with pytest.raises(FileNotFoundError): vc.get_conf_cells().conf diff --git a/context/app/main.py b/context/app/main.py index 0639c0a24b..e3509e1294 100755 --- a/context/app/main.py +++ b/context/app/main.py @@ -72,15 +72,15 @@ def create_app(testing=False): def inject_template_globals(): return { 'is_authenticated': session.get('is_authenticated'), - 'nexus_token': session.get('nexus_token'), + 'groups_token': session.get('groups_token'), 'user_email': session.get('user_email') } @app.before_request - def set_default_nexus_token(): - if 'nexus_token' not in session: + def set_default_groups_token(): + if 'groups_token' not in session: session.update( - nexus_token='', + groups_token='', user_email='', is_authenticated=False) diff --git a/context/app/routes_main.py b/context/app/routes_main.py index 93db73783b..9bc2e3b17f 100644 --- a/context/app/routes_main.py +++ b/context/app/routes_main.py @@ -34,9 +34,9 @@ def ccf_eui(): 'pages/ccf-eui.html', config=current_app.config, url_root=request.url_root, - nexus_token=( - session['nexus_token'] - if 'nexus_token' in session + groups_token=( + session['groups_token'] + if 'groups_token' in session else '' ) ) diff --git a/context/app/static/js/components/App.jsx b/context/app/static/js/components/App.jsx index 8356ffe243..f5a4bb1989 100644 --- a/context/app/static/js/components/App.jsx +++ b/context/app/static/js/components/App.jsx @@ -20,9 +20,9 @@ function App(props) { ReactGA.initialize('UA-133341631-3'); return ( - // nexus_token is injected as a global in the flask template. + // groups_token is injected as a global in the flask template. // eslint-disable-next-line no-undef - +
{globalAlertMd && ( diff --git a/context/app/static/js/components/Detail/VersionSelect/VersionSelect.jsx b/context/app/static/js/components/Detail/VersionSelect/VersionSelect.jsx index 8a1d4c997d..18782ac471 100644 --- a/context/app/static/js/components/Detail/VersionSelect/VersionSelect.jsx +++ b/context/app/static/js/components/Detail/VersionSelect/VersionSelect.jsx @@ -7,7 +7,7 @@ import { getAuthHeader } from 'js/helpers/functions'; import { StyledButton, OverflowEllipsis, EmptyFullWidthDiv } from './style'; function VersionSelect({ uuid }) { - const { entityEndpoint, nexusToken } = useContext(AppContext); + const { entityEndpoint, groupsToken } = useContext(AppContext); const [versions, setVersions] = useState([]); const [selectedVersionIndex, setSelectedVersionIndex] = useState(0); @@ -16,7 +16,7 @@ function VersionSelect({ uuid }) { useEffect(() => { async function fetchVersions() { - const authHeader = getAuthHeader(nexusToken); + const authHeader = getAuthHeader(groupsToken); const response = await fetch(`${entityEndpoint}/${lowerCaseEntityType}s/${uuid}/revisions`, { headers: { 'Content-Type': 'application/json', @@ -32,7 +32,7 @@ function VersionSelect({ uuid }) { setSelectedVersionIndex(results.findIndex((version) => version[uuidKey] === uuid)); } fetchVersions(); - }, [entityEndpoint, uuid, lowerCaseEntityType, uuidKey, nexusToken]); + }, [entityEndpoint, uuid, lowerCaseEntityType, uuidKey, groupsToken]); function visitNewVersion({ i }) { window.location.href = `/browse/dataset/${versions[i][uuidKey]}`; diff --git a/context/app/static/js/components/Detail/provenance/ProvSection/ProvSection.jsx b/context/app/static/js/components/Detail/provenance/ProvSection/ProvSection.jsx index 9f7f476086..18579b9d77 100644 --- a/context/app/static/js/components/Detail/provenance/ProvSection/ProvSection.jsx +++ b/context/app/static/js/components/Detail/provenance/ProvSection/ProvSection.jsx @@ -11,8 +11,8 @@ import ProvTabs from '../ProvTabs'; function ProvSection(props) { const { uuid, assayMetadata } = props; const { entity_type } = assayMetadata; - const { nexusToken, entityEndpoint } = useContext(AppContext); - const { provData, isLoading } = useProvData(uuid, entityEndpoint, nexusToken); + const { groupsToken, entityEndpoint } = useContext(AppContext); + const { provData, isLoading } = useProvData(uuid, entityEndpoint, groupsToken); if (isLoading) { return ( diff --git a/context/app/static/js/components/Detail/provenance/ShowDerivedEntitiesButton/ShowDerivedEntitiesButton.jsx b/context/app/static/js/components/Detail/provenance/ShowDerivedEntitiesButton/ShowDerivedEntitiesButton.jsx index fa5a136d22..59558bede9 100644 --- a/context/app/static/js/components/Detail/provenance/ShowDerivedEntitiesButton/ShowDerivedEntitiesButton.jsx +++ b/context/app/static/js/components/Detail/provenance/ShowDerivedEntitiesButton/ShowDerivedEntitiesButton.jsx @@ -14,7 +14,7 @@ function getUniqueNewSteps(steps, newSteps) { const useProvenanceStoreSelector = (state) => ({ steps: state.steps, addDescendantSteps: state.addDescendantSteps }); function ShowDerivedEntitiesButton({ id, getNameForActivity, getNameForEntity }) { - const { elasticsearchEndpoint, entityEndpoint, nexusToken } = useContext(AppContext); + const { elasticsearchEndpoint, entityEndpoint, groupsToken } = useContext(AppContext); const { steps, addDescendantSteps } = useProvenanceStore(useProvenanceStoreSelector); const [newSteps, setNewSteps] = useState([]); @@ -22,7 +22,7 @@ function ShowDerivedEntitiesButton({ id, getNameForActivity, getNameForEntity }) id, elasticsearchEndpoint, entityEndpoint, - nexusToken, + groupsToken, ); useEffect(() => { diff --git a/context/app/static/js/components/Providers.jsx b/context/app/static/js/components/Providers.jsx index 1e3f9473f2..5997132942 100644 --- a/context/app/static/js/components/Providers.jsx +++ b/context/app/static/js/components/Providers.jsx @@ -17,14 +17,14 @@ const generateClassName = createGenerateClassName({ const AppContext = React.createContext({}); function Providers(props) { - const { endpoints, nexusToken, children } = props; + const { endpoints, groupsToken, children } = props; // injectFirst ensures styled-components takes priority over mui for styling return ( - + {children} diff --git a/context/app/static/js/components/cells/DatasetsSelectedByExpression/DatasetsSelectedByExpression.jsx b/context/app/static/js/components/cells/DatasetsSelectedByExpression/DatasetsSelectedByExpression.jsx index badd0cf1a6..4f643d95f1 100644 --- a/context/app/static/js/components/cells/DatasetsSelectedByExpression/DatasetsSelectedByExpression.jsx +++ b/context/app/static/js/components/cells/DatasetsSelectedByExpression/DatasetsSelectedByExpression.jsx @@ -72,7 +72,7 @@ function DatasetsSelectedByExpression({ setIsLoading, }) { const [message, setMessage] = useState(null); - const { elasticsearchEndpoint, nexusToken } = useContext(AppContext); + const { elasticsearchEndpoint, groupsToken } = useContext(AppContext); const [genomicModality, setGenomicModality] = useState('rna'); function handleSelectModality(event) { @@ -99,7 +99,7 @@ function DatasetsSelectedByExpression({ , ); const serviceResults = await new CellsService().getDatasets(queryParams); - const searchResults = await fetchSearchData(getSearchQuery(serviceResults), elasticsearchEndpoint, nexusToken); + const searchResults = await fetchSearchData(getSearchQuery(serviceResults), elasticsearchEndpoint, groupsToken); setResults(searchResults.hits.hits); setIsLoading(false); } catch (e) { diff --git a/context/app/static/js/components/files/FileBrowserFile/FileBrowserFile.jsx b/context/app/static/js/components/files/FileBrowserFile/FileBrowserFile.jsx index 99388f00b5..2b05a3c4c2 100644 --- a/context/app/static/js/components/files/FileBrowserFile/FileBrowserFile.jsx +++ b/context/app/static/js/components/files/FileBrowserFile/FileBrowserFile.jsx @@ -15,9 +15,9 @@ function FileBrowserFile(props) { const { fileObj, depth } = props; const { hasAgreedToDUA, openDUA } = useContext(FilesContext); const { uuid } = useContext(DetailContext); - const { assetsEndpoint, nexusToken } = useContext(AppContext); + const { assetsEndpoint, groupsToken } = useContext(AppContext); - const tokenParam = getTokenParam(nexusToken); + const tokenParam = getTokenParam(groupsToken); const fileUrl = `${assetsEndpoint}/${uuid}/${fileObj.rel_path}${tokenParam}`; diff --git a/context/app/static/js/components/files/GlobusLink/GlobusLink.jsx b/context/app/static/js/components/files/GlobusLink/GlobusLink.jsx index 15f717e693..f4b272a62d 100644 --- a/context/app/static/js/components/files/GlobusLink/GlobusLink.jsx +++ b/context/app/static/js/components/files/GlobusLink/GlobusLink.jsx @@ -11,9 +11,9 @@ function GlobusLink(props) { const { uuid, hubmap_id, isSupport } = props; const [globusUrlStatus, setGlobusUrlStatus] = React.useState({ url: '', statusCode: null }); - const { entityEndpoint, nexusToken } = useContext(AppContext); + const { entityEndpoint, groupsToken } = useContext(AppContext); - const requestHeaders = getAuthHeader(nexusToken); + const requestHeaders = getAuthHeader(groupsToken); useAbortableEffect( (status) => { async function getAndSetGlobusUrlStatus() { diff --git a/context/app/static/js/helpers/LookupEntity.jsx b/context/app/static/js/helpers/LookupEntity.jsx index 41423890d3..e300ec7d78 100644 --- a/context/app/static/js/helpers/LookupEntity.jsx +++ b/context/app/static/js/helpers/LookupEntity.jsx @@ -11,7 +11,7 @@ function LookupEntity({ uuid, children }) { LookupEntity.propTypes = { uuid: PropTypes.string.isRequired, elasticsearchEndpoint: PropTypes.string.isRequired, - nexusToken: PropTypes.string.isRequired, + groupsToken: PropTypes.string.isRequired, }; export default LookupEntity; diff --git a/context/app/static/js/helpers/functions.js b/context/app/static/js/helpers/functions.js index f4fd796a0a..1d08365cd4 100644 --- a/context/app/static/js/helpers/functions.js +++ b/context/app/static/js/helpers/functions.js @@ -28,14 +28,14 @@ export function readCookie(name) { return null; } -export function getTokenParam(nexusToken) { - return nexusToken ? `?token=${nexusToken}` : ''; +export function getTokenParam(groupsToken) { + return groupsToken ? `?token=${groupsToken}` : ''; } -export function getAuthHeader(nexusToken) { - return nexusToken +export function getAuthHeader(groupsToken) { + return groupsToken ? { - Authorization: `Bearer ${nexusToken}`, + Authorization: `Bearer ${groupsToken}`, } : {}; } diff --git a/context/app/static/js/hooks/useImmediateDescendantProv.js b/context/app/static/js/hooks/useImmediateDescendantProv.js index aad512e912..c108a101fe 100644 --- a/context/app/static/js/hooks/useImmediateDescendantProv.js +++ b/context/app/static/js/hooks/useImmediateDescendantProv.js @@ -1,8 +1,8 @@ import React, { useState } from 'react'; import { getAuthHeader } from 'js/helpers/functions'; -async function getEntityData(hubmapID, elasticsearchEndpoint, nexusToken) { - const authHeader = getAuthHeader(nexusToken); +async function getEntityData(hubmapID, elasticsearchEndpoint, groupsToken) { + const authHeader = getAuthHeader(groupsToken); const response = await fetch(elasticsearchEndpoint, { method: 'POST', body: JSON.stringify({ query: { match: { 'hubmap_id.keyword': hubmapID } } }), @@ -20,24 +20,24 @@ async function getEntityData(hubmapID, elasticsearchEndpoint, nexusToken) { return results.hits.hits[0]._source; } -function getProvRequest(uuid, entityEndpoint, nexusToken) { - const headers = getAuthHeader(nexusToken); +function getProvRequest(uuid, entityEndpoint, groupsToken) { + const headers = getAuthHeader(groupsToken); return { url: `${entityEndpoint}/entities/${uuid}/provenance`, options: { headers } }; } -function useImmediateDescendantProv(hubmap_id, elasticsearchEndpoint, entityEndpoint, nexusToken) { +function useImmediateDescendantProv(hubmap_id, elasticsearchEndpoint, entityEndpoint, groupsToken) { const [immediateDescendantsProvData, setImmediateDescendantsProvData] = useState(undefined); const [isLoading, setIsLoading] = React.useState(true); React.useEffect(() => { async function getAndSetProvData() { const hubmapID = hubmap_id; - const entityData = await getEntityData(hubmapID, elasticsearchEndpoint, nexusToken); + const entityData = await getEntityData(hubmapID, elasticsearchEndpoint, groupsToken); const immediateDescendants = entityData?.immediate_descendants; const results = await Promise.all( immediateDescendants.map((descendant) => { - const { url, options } = getProvRequest(descendant.uuid, entityEndpoint, nexusToken); + const { url, options } = getProvRequest(descendant.uuid, entityEndpoint, groupsToken); const result = fetch(url, options).then((res) => res.json()); return result; }), @@ -46,18 +46,18 @@ function useImmediateDescendantProv(hubmap_id, elasticsearchEndpoint, entityEndp setIsLoading(false); } getAndSetProvData(); - }, [nexusToken, elasticsearchEndpoint, entityEndpoint, hubmap_id]); + }, [groupsToken, elasticsearchEndpoint, entityEndpoint, hubmap_id]); return { immediateDescendantsProvData, isLoading }; } -async function getImmediateDescendantProv(hubmap_id, elasticsearchEndpoint, entityEndpoint, nexusToken) { +async function getImmediateDescendantProv(hubmap_id, elasticsearchEndpoint, entityEndpoint, groupsToken) { const hubmapID = hubmap_id; - const entityData = await getEntityData(hubmapID, elasticsearchEndpoint, nexusToken); + const entityData = await getEntityData(hubmapID, elasticsearchEndpoint, groupsToken); const immediateDescendants = entityData?.immediate_descendants; const results = await Promise.all( immediateDescendants.map((descendant) => { - const { url, options } = getProvRequest(descendant.uuid, entityEndpoint, nexusToken); + const { url, options } = getProvRequest(descendant.uuid, entityEndpoint, groupsToken); const result = fetch(url, options).then((res) => res.json()); return result; }), diff --git a/context/app/static/js/hooks/useProvData.js b/context/app/static/js/hooks/useProvData.js index 3934933349..c27b8ea271 100644 --- a/context/app/static/js/hooks/useProvData.js +++ b/context/app/static/js/hooks/useProvData.js @@ -2,13 +2,13 @@ import React from 'react'; import { getAuthHeader } from 'js/helpers/functions'; -function useProvData(uuid, entityEndpoint, nexusToken) { +function useProvData(uuid, entityEndpoint, groupsToken) { const [provData, setProvData] = React.useState(undefined); const [isLoading, setIsLoading] = React.useState(true); React.useEffect(() => { async function getAndSetProvData() { - const headers = getAuthHeader(nexusToken); + const headers = getAuthHeader(groupsToken); const response = await fetch(`${entityEndpoint}/entities/${uuid}/provenance`, { headers }); @@ -22,7 +22,7 @@ function useProvData(uuid, entityEndpoint, nexusToken) { setIsLoading(false); } getAndSetProvData(); - }, [nexusToken, entityEndpoint, uuid]); + }, [groupsToken, entityEndpoint, uuid]); return { provData, isLoading }; } diff --git a/context/app/static/js/hooks/useSearchData.js b/context/app/static/js/hooks/useSearchData.js index 9f3f49b58e..6cfccf3ee7 100644 --- a/context/app/static/js/hooks/useSearchData.js +++ b/context/app/static/js/hooks/useSearchData.js @@ -2,8 +2,8 @@ import { useState, useEffect, useContext } from 'react'; import { getAuthHeader, addRestrictionsToQuery } from 'js/helpers/functions'; import { AppContext } from 'js/components/Providers'; -async function fetchSearchData(query, elasticsearchEndpoint, nexusToken, useDefaultQuery = true) { - const authHeader = getAuthHeader(nexusToken); +async function fetchSearchData(query, elasticsearchEndpoint, groupsToken, useDefaultQuery = true) { + const authHeader = getAuthHeader(groupsToken); const response = await fetch(elasticsearchEndpoint, { method: 'POST', body: JSON.stringify(useDefaultQuery ? addRestrictionsToQuery(query) : query), @@ -24,16 +24,16 @@ async function fetchSearchData(query, elasticsearchEndpoint, nexusToken, useDefa function useSearchData(query, useDefaultQuery) { const [searchData, setSearchData] = useState({}); const [isLoading, setIsLoading] = useState(true); - const { elasticsearchEndpoint, nexusToken } = useContext(AppContext); + const { elasticsearchEndpoint, groupsToken } = useContext(AppContext); useEffect(() => { async function getAndSetSearchHits() { - const results = await fetchSearchData(query, elasticsearchEndpoint, nexusToken, useDefaultQuery); + const results = await fetchSearchData(query, elasticsearchEndpoint, groupsToken, useDefaultQuery); setSearchData(results); setIsLoading(false); } getAndSetSearchHits(); - }, [elasticsearchEndpoint, nexusToken, query, useDefaultQuery]); + }, [elasticsearchEndpoint, groupsToken, query, useDefaultQuery]); return { searchData, isLoading }; } diff --git a/context/app/static/js/pages/search/CellsSearch.jsx b/context/app/static/js/pages/search/CellsSearch.jsx index 40621963d6..8813ee5ac5 100644 --- a/context/app/static/js/pages/search/CellsSearch.jsx +++ b/context/app/static/js/pages/search/CellsSearch.jsx @@ -24,7 +24,7 @@ const searchDatasetTutorialSelector = (state) => ({ function Search(props) { const { title } = props; - const { elasticsearchEndpoint, nexusToken } = useContext(AppContext); + const { elasticsearchEndpoint, groupsToken } = useContext(AppContext); const { runSearchDatasetTutorial, @@ -66,7 +66,7 @@ function Search(props) { { urlSearchParam: 'descendant_ids[0]', label: 'Ancestor of' }, ].filter((note) => searchParams.has(note.urlSearchParam)); - const httpHeaders = getAuthHeader(nexusToken); + const httpHeaders = getAuthHeader(groupsToken); const resultFields = resultFieldsByType[type]; const searchProps = { // The default behavior is to add a "_search" path. @@ -87,7 +87,7 @@ function Search(props) { // Sidebar facet configuration: filters: filtersByType[type], queryFields: ['all_text', ...fieldsToHighlight], - isLoggedIn: Boolean(nexusToken), + isLoggedIn: Boolean(groupsToken), apiUrl: elasticsearchEndpoint, defaultQuery: getDefaultQuery(), }; @@ -113,7 +113,7 @@ function Search(props) { @@ -125,11 +125,11 @@ function Search(props) { Search.propTypes = { title: PropTypes.string.isRequired, - nexusToken: PropTypes.string, + groupsToken: PropTypes.string, }; Search.defaultProps = { - nexusToken: '', + groupsToken: '', }; export default Search; diff --git a/context/app/static/js/pages/search/DevSearch.jsx b/context/app/static/js/pages/search/DevSearch.jsx index b002c564c6..2b0ee27c5c 100644 --- a/context/app/static/js/pages/search/DevSearch.jsx +++ b/context/app/static/js/pages/search/DevSearch.jsx @@ -10,8 +10,8 @@ import DevResults from 'js/components/Search/DevResults'; import { SearchHeader } from './style'; function DevSearch() { - const { elasticsearchEndpoint, nexusToken } = useContext(AppContext); - const httpHeaders = getAuthHeader(nexusToken); + const { elasticsearchEndpoint, groupsToken } = useContext(AppContext); + const httpHeaders = getAuthHeader(groupsToken); const searchProps = { // The default behavior is to add a "_search" path. @@ -79,7 +79,7 @@ function DevSearch() { ], }, queryFields: ['all_text', ...fieldsToHighlight], - isLoggedIn: Boolean(nexusToken), + isLoggedIn: Boolean(groupsToken), }; const allProps = { ...searchProps, apiUrl: elasticsearchEndpoint }; diff --git a/context/app/static/js/pages/search/Search.jsx b/context/app/static/js/pages/search/Search.jsx index 57579a0185..a55897dde3 100644 --- a/context/app/static/js/pages/search/Search.jsx +++ b/context/app/static/js/pages/search/Search.jsx @@ -24,7 +24,7 @@ const searchDatasetTutorialSelector = (state) => ({ function Search(props) { const { title } = props; - const { elasticsearchEndpoint, nexusToken } = useContext(AppContext); + const { elasticsearchEndpoint, groupsToken } = useContext(AppContext); const { runSearchDatasetTutorial, @@ -66,7 +66,7 @@ function Search(props) { { urlSearchParam: 'descendant_ids[0]', label: 'Ancestor of' }, ].filter((note) => searchParams.has(note.urlSearchParam)); - const httpHeaders = getAuthHeader(nexusToken); + const httpHeaders = getAuthHeader(groupsToken); const resultFields = resultFieldsByType[type]; const searchProps = { // The default behavior is to add a "_search" path. @@ -87,7 +87,7 @@ function Search(props) { // Sidebar facet configuration: filters: filtersByType[type], queryFields: ['all_text', ...fieldsToHighlight], - isLoggedIn: Boolean(nexusToken), + isLoggedIn: Boolean(groupsToken), apiUrl: elasticsearchEndpoint, defaultQuery: getDefaultQuery(), }; @@ -127,11 +127,11 @@ function Search(props) { Search.propTypes = { title: PropTypes.string.isRequired, - nexusToken: PropTypes.string, + groupsToken: PropTypes.string, }; Search.defaultProps = { - nexusToken: '', + groupsToken: '', }; export default Search; diff --git a/context/app/templates/pages/base.html b/context/app/templates/pages/base.html index 5dd28cb477..83b900cdbd 100644 --- a/context/app/templates/pages/base.html +++ b/context/app/templates/pages/base.html @@ -11,7 +11,7 @@ {% block title_text %}{% endblock %} | HuBMAP diff --git a/context/app/templates/pages/base_react.html b/context/app/templates/pages/base_react.html index cfa01b3397..1b4c47d64c 100644 --- a/context/app/templates/pages/base_react.html +++ b/context/app/templates/pages/base_react.html @@ -14,7 +14,7 @@ {% block title_text %}{{ title }}{% endblock %}{{' | HuBMAP' if not is_home_page}} diff --git a/context/app/templates/pages/ccf-eui.html b/context/app/templates/pages/ccf-eui.html index 773acdfb22..01c957ec61 100644 --- a/context/app/templates/pages/ccf-eui.html +++ b/context/app/templates/pages/ccf-eui.html @@ -19,7 +19,7 @@ hubmap-portal-url="{{ url_root }}" hubmap-data-url="{{ config['ELASTICSEARCH_ENDPOINT'] + config['CCF_INDEX_PATH'] }}" hubmap-assets-url="{{ config['ASSETS_ENDPOINT'] }}" - hubmap-token="{{ nexus_token }}" + hubmap-token="{{ groups_token }}" > diff --git a/context/app/test_routes_errors.py b/context/app/test_routes_errors.py index e36dbc17e5..803c1f5ff8 100644 --- a/context/app/test_routes_errors.py +++ b/context/app/test_routes_errors.py @@ -13,7 +13,7 @@ def client(): assert 'IS_MOCK' not in app.config with app.test_client() as client: with client.session_transaction() as session: - session['nexus_token'] = '{}' + session['groups_token'] = '{}' yield client @@ -55,7 +55,7 @@ def test_401_html_page(client, mocker): def client_not_logged_in(): app = create_app(testing=True) with app.test_client() as client: - # No nexus_token! + # No groups_token! yield client diff --git a/context/app/test_routes_main.py b/context/app/test_routes_main.py index 2bb830530b..89cfc24318 100644 --- a/context/app/test_routes_main.py +++ b/context/app/test_routes_main.py @@ -14,7 +14,7 @@ def client(): app = create_app(testing=True) with app.test_client() as client: with client.session_transaction() as session: - session['nexus_token'] = '{}' + session['groups_token'] = '{}' yield client diff --git a/context/app/utils.py b/context/app/utils.py index 98eba97325..5e79341278 100644 --- a/context/app/utils.py +++ b/context/app/utils.py @@ -9,7 +9,7 @@ def get_client(): return MockApiClient() return ApiClient( current_app.config['ENTITY_API_BASE'], - session['nexus_token'] + session['groups_token'] ) diff --git a/context/test-utils/functions.js b/context/test-utils/functions.js index 1ab9a6d904..f02fca06b6 100644 --- a/context/test-utils/functions.js +++ b/context/test-utils/functions.js @@ -10,11 +10,11 @@ const appProviderEndpoints = { assetsEndpoint: 'fakeAssetsEndpoint', }; -const appProviderToken = 'fakeNexusToken'; +const appProviderToken = 'fakeGroupsToken'; const AllTheProviders = ({ children }) => { return ( - + {children} ); diff --git a/end-to-end/artillery/README.md b/end-to-end/artillery/README.md index 6f9eafa391..b3712d4e02 100644 --- a/end-to-end/artillery/README.md +++ b/end-to-end/artillery/README.md @@ -1,5 +1,5 @@ A small suite of load tests hardcoded to run against the stage environment. `artillery.sh` wraps calls to artillery, and summarizes the output. -You will be prompted to set `NEXUS_TOKEN` as an envvar. +You will be prompted to set `GROUPS_TOKEN` as an envvar. - Tests to be run are under [`scenarios/`](scenarios/). - Tests that *could be* run are under [`skip-scenarios/`](skip-scenarios/). diff --git a/end-to-end/artillery/artillery.sh b/end-to-end/artillery/artillery.sh index 580e4622f7..40bbf141bf 100755 --- a/end-to-end/artillery/artillery.sh +++ b/end-to-end/artillery/artillery.sh @@ -3,7 +3,7 @@ set -o errexit die() { set +v; echo "$*" 1>&2 ; exit 1; } -[ -z "$NEXUS_TOKEN" ] && die "NEXUS_TOKEN needs to be defined." +[ -z "$GROUPS_TOKEN" ] && die "GROUPS_TOKEN needs to be defined." cd `dirname $0` diff --git a/end-to-end/artillery/skip-scenarios/search.yml b/end-to-end/artillery/skip-scenarios/search.yml index 1887d60096..4912357d7c 100644 --- a/end-to-end/artillery/skip-scenarios/search.yml +++ b/end-to-end/artillery/skip-scenarios/search.yml @@ -24,7 +24,7 @@ scenarios: url: "/portal/search" headers: 'Content-Type': application/json - 'Authorization': "Bearer {{ $processEnvironment.NEXUS_TOKEN }}" + 'Authorization': "Bearer {{ $processEnvironment.GROUPS_TOKEN }}" body: "{{ $processEnvironment.DATASETS_QUERY }}" gzip: true afterResponse: "printStatus" \ No newline at end of file diff --git a/end-to-end/cypress/integration/portal-ui.spec.js b/end-to-end/cypress/integration/portal-ui.spec.js index a4f8415611..f983fcc23e 100644 --- a/end-to-end/cypress/integration/portal-ui.spec.js +++ b/end-to-end/cypress/integration/portal-ui.spec.js @@ -32,7 +32,7 @@ describe('portal-ui', () => { cy.contains('login'); // Don't click! We shouldn't depend on Globus in tests. - // TODO: nexus_token is now required for search results, so we can pass it + // TODO: groups_token is now required for search results, so we can pass it // back to the client to make the Elasticsearch request. I don't want to go // too far into mocking server state, since it would be tricky, // and much of this may be moving to the client, in any case. From 534599f2b52e60305d355cb2e2d1aae7712a9cb1 Mon Sep 17 00:00:00 2001 From: John Conroy Date: Mon, 15 Nov 2021 11:15:57 -0500 Subject: [PATCH 3/5] Update comment --- context/app/routes_auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/context/app/routes_auth.py b/context/app/routes_auth.py index bde6c3b3b8..36c273e5ea 100644 --- a/context/app/routes_auth.py +++ b/context/app/routes_auth.py @@ -23,7 +23,7 @@ def load_app_client(): def has_hubmap_group(groups_token): # Mostly copy-and-paste from - # https://github.com/hubmapconsortium/commons/blob/dc69f4/hubmap_commons/hm_auth.py#L347-L355 + # https://github.com/hubmapconsortium/commons/blob/641d03b0dc/hubmap_commons/hm_auth.py#L626-L646 headers = { 'Content-Type': 'application/json', 'Accept': 'application/json', From 642233f10c9ba75fc2deb255449e5facc45f4ff5 Mon Sep 17 00:00:00 2001 From: John Conroy Date: Mon, 15 Nov 2021 11:21:27 -0500 Subject: [PATCH 4/5] Add changelog --- CHANGELOG-switch-auth-globus-groups.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 CHANGELOG-switch-auth-globus-groups.md diff --git a/CHANGELOG-switch-auth-globus-groups.md b/CHANGELOG-switch-auth-globus-groups.md new file mode 100644 index 0000000000..aa19b6b290 --- /dev/null +++ b/CHANGELOG-switch-auth-globus-groups.md @@ -0,0 +1 @@ +- Switch Globus authentication from Globus Nexus to Globus Groups. \ No newline at end of file From e2941b4d472ab8fc230fdeb61a5e681a75234d9c Mon Sep 17 00:00:00 2001 From: John Conroy Date: Mon, 15 Nov 2021 11:34:28 -0500 Subject: [PATCH 5/5] Fix flake8 --- context/app/api/vitessce_confs/base_confs.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/context/app/api/vitessce_confs/base_confs.py b/context/app/api/vitessce_confs/base_confs.py index 57e40fd3cd..727e9ee135 100644 --- a/context/app/api/vitessce_confs/base_confs.py +++ b/context/app/api/vitessce_confs/base_confs.py @@ -36,7 +36,8 @@ def __init__(self, entity=None, groups_token=None, is_mock=False): :param str groups_token: Groups token for use in authenticating API :param bool is_mock: Wether or not this class is being mocked. - >>> vc = ViewConfBuilder(entity={"uuid": "uuid"}, groups_token='groups_token', is_mock=True) + >>> vc = ViewConfBuilder( + ... entity={"uuid": "uuid"}, groups_token='groups_token', is_mock=True) """ @@ -54,7 +55,8 @@ def _replace_url_in_file(self, file): :param dict file: File dict which will have its rel_path replaced by url :rtype: dict The file with rel_path replaced by url >>> from pprint import pprint - >>> vc = ViewConfBuilder(entity={"uuid": "uuid"}, groups_token='groups_token', is_mock=True) + >>> vc = ViewConfBuilder( + ... entity={"uuid": "uuid"}, groups_token='groups_token', is_mock=True) >>> file = { 'data_type': 'CELLS', 'file_type': 'cells.json', 'rel_path': 'cells.json' } >>> pprint(vc._replace_url_in_file(file)) {'data_type': 'CELLS',\n\ @@ -74,7 +76,8 @@ def _build_assets_url(self, rel_path, use_token=True): :param bool use_token: Whether or not to append a groups token to the URL, default True :rtype: dict The file with rel_path replaced by url - >>> vc = ViewConfBuilder(entity={"uuid": "uuid"}, groups_token='groups_token', is_mock=True) + >>> vc = ViewConfBuilder( + ... entity={"uuid": "uuid"}, groups_token='groups_token', is_mock=True) >>> vc._build_assets_url("rel_path/to/clusters.ome.tiff") 'https://example.com/uuid/rel_path/to/clusters.ome.tiff?token=groups_token'