diff --git a/README.md b/README.md index 1317d7f..6088af1 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ HTTP requests to the following APIs will be proxied to this gateway service for And following are the APIs and UI applications that only use this gateway as reverse proxy without any authentication/authoriztion involved: - [Antibody API](https://github.com/hubmapconsortium/antibody-api) -- [Ontology API](https://github.com/hubmapconsortium/ontology-api) - [Ingest UI](https://github.com/hubmapconsortium/ingest-ui) - [Portal UI](https://github.com/hubmapconsortium/portal-ui) (not for localhost build) @@ -24,8 +23,6 @@ Different from the above use cases, the following APIs are protected by AWS API - [Search API](https://github.com/hubmapconsortium/search-api) - [UUID API](https://github.com/hubmapconsortium/uuid-api) - [Workspaces API](https://github.com/hubmapconsortium/user_workspaces_server) (only the REST API part on DEV and PROD) -- [Spatial API](https://github.com/hubmapconsortium/spatial-api) -- [Files API](https://github.com/hubmapconsortium/files-api) More details are described in the [aws-api-gateway](https://github.com/hubmapconsortium/aws-api-gateway) repository. @@ -53,9 +50,9 @@ Note: the following instructions with docker commands are based on managing Dock There are a few configurable environment variables to keep in mind: -- `COMMONS_BRANCH`: build argument only to be used during image creation when we need to use a branch of commons from github rather than the published PyPI package. Default to main branch if not set or null. -- `HOST_UID`: the user id on the host machine to be mapped to the container. Default to 1001 if not set or null. -- `HOST_GID`: the user's group id on the host machine to be mapped to the container. Default to 1001 if not set or null. +- `COMMONS_BRANCH`: build argument only to be used during image creation when we need to use a branch of commons from github rather than the published PyPI package. Default to master branch if not set or null. +- `HOST_UID`: the user id on the host machine to be mapped to the container. Default to 1000 if not set or null. +- `HOST_GID`: the user's group id on the host machine to be mapped to the container. Default to 1000 if not set or null. We can set and verify the environment variable like below: diff --git a/VERSION b/VERSION index b88e1c8..3361edc 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.1.27 +2.1.27 \ No newline at end of file diff --git a/api_endpoints.dev.json b/api_endpoints.dev.json index 32cf080..6b76efb 100644 --- a/api_endpoints.dev.json +++ b/api_endpoints.dev.json @@ -94,13 +94,13 @@ "auth": false }, { - "method": "POST", - "endpoint": "/dataset/begin-extract-cell-count-from-secondary-analysis-files-async", + "method": "GET", + "endpoint": "/uploads/<*>/file-system-abs-path", "auth": false }, { - "method": "GET", - "endpoint": "/uploads/<*>/file-system-abs-path", + "method": "POST", + "endpoint": "/dataset/begin-extract-cell-count-from-secondary-analysis-files-async", "auth": false }, { @@ -147,7 +147,7 @@ "groups": [ "5777527e-ec11-11e8-ab41-0af86edb4424" ] - }, + }, { "method": "PUT", "endpoint": "/datasets/<*>/unpublish", @@ -214,6 +214,14 @@ "endpoint": "/logout", "auth": false }, + { + "method": "POST", + "endpoint": "/datasets/components", + "auth": true, + "groups": [ + "5777527e-ec11-11e8-ab41-0af86edb4424" + ] + }, { "method": "POST", "endpoint": "/file-upload", @@ -260,7 +268,7 @@ "auth": true, "groups": [ "89a69625-99d7-11ea-9366-0e98982705c1" - ] + ] }, { "method": "PUT", @@ -410,7 +418,7 @@ "groups": [ "5777527e-ec11-11e8-ab41-0af86edb4424" ] - }, + }, { "method": "GET", "endpoint": "/specimens/<*>", @@ -505,11 +513,27 @@ }, { "method": "POST", - "endpoint": "/datasets/components", + "endpoint": "/assaytype", "auth": true, "groups": [ "5777527e-ec11-11e8-ab41-0af86edb4424" ] + }, + { + "method": "GET", + "endpoint": "/assaytype/<*>", + "auth": true, + "groups": [ + "5777527e-ec11-11e8-ab41-0af86edb4424" + ] + }, + { + "method": "PUT", + "endpoint": "/reload-assaytypes", + "auth": true, + "groups": [ + "89a69625-99d7-11ea-9366-0e98982705c1" + ] } ], "avr.dev.hubmapconsortium.org": [ diff --git a/api_endpoints.prod.json b/api_endpoints.prod.json index 1c98d0b..bf89b88 100644 --- a/api_endpoints.prod.json +++ b/api_endpoints.prod.json @@ -214,6 +214,14 @@ "endpoint": "/logout", "auth": false }, + { + "method": "POST", + "endpoint": "/datasets/components", + "auth": true, + "groups": [ + "5777527e-ec11-11e8-ab41-0af86edb4424" + ] + }, { "method": "POST", "endpoint": "/file-upload", @@ -505,11 +513,27 @@ }, { "method": "POST", - "endpoint": "/datasets/components", + "endpoint": "/assaytype", "auth": true, "groups": [ "5777527e-ec11-11e8-ab41-0af86edb4424" ] + }, + { + "method": "GET", + "endpoint": "/assaytype/<*>", + "auth": true, + "groups": [ + "5777527e-ec11-11e8-ab41-0af86edb4424" + ] + }, + { + "method": "PUT", + "endpoint": "/reload-assaytypes", + "auth": true, + "groups": [ + "89a69625-99d7-11ea-9366-0e98982705c1" + ] } ], "avr.hubmapconsortium.org": [ diff --git a/api_endpoints.stage.json b/api_endpoints.stage.json index 13b06ec..9bb576b 100644 --- a/api_endpoints.stage.json +++ b/api_endpoints.stage.json @@ -94,13 +94,13 @@ "auth": false }, { - "method": "POST", - "endpoint": "/dataset/begin-extract-cell-count-from-secondary-analysis-files-async", + "method": "GET", + "endpoint": "/uploads/<*>/file-system-abs-path", "auth": false }, { - "method": "GET", - "endpoint": "/uploads/<*>/file-system-abs-path", + "method": "POST", + "endpoint": "/dataset/begin-extract-cell-count-from-secondary-analysis-files-async", "auth": false }, { @@ -214,26 +214,6 @@ "endpoint": "/logout", "auth": false }, - { - "method": "GET", - "endpoint": "/datasets/data-status", - "auth": false - }, - { - "method": "GET", - "endpoint": "/uploads/data-status", - "auth": false - }, - { - "method": "GET", - "endpoint": "/data-ingest-board-login", - "auth": false - }, - { - "method": "GET", - "endpoint": "/data-ingest-board-logout", - "auth": false - }, { "method": "POST", "endpoint": "/datasets/components", @@ -288,7 +268,7 @@ "auth": true, "groups": [ "89a69625-99d7-11ea-9366-0e98982705c1" - ] + ] }, { "method": "PUT", @@ -510,6 +490,50 @@ "groups": [ "5777527e-ec11-11e8-ab41-0af86edb4424" ] + }, + { + "method": "GET", + "endpoint": "/datasets/data-status", + "auth": false + }, + { + "method": "GET", + "endpoint": "/uploads/data-status", + "auth": false + }, + { + "method": "GET", + "endpoint": "/data-ingest-board-login", + "auth": false + }, + { + "method": "GET", + "endpoint": "/data-ingest-board-logout", + "auth": false + }, + { + "method": "POST", + "endpoint": "/assaytype", + "auth": true, + "groups": [ + "5777527e-ec11-11e8-ab41-0af86edb4424" + ] + }, + { + "method": "GET", + "endpoint": "/assaytype/<*>", + "auth": true, + "groups": [ + "5777527e-ec11-11e8-ab41-0af86edb4424" + ] + }, + { + "method": "PUT", + "endpoint": "/reload-assaytypes", + "auth": true, + "groups": [ + "89a69625-99d7-11ea-9366-0e98982705c1" + ] } ] } diff --git a/api_endpoints.test.json b/api_endpoints.test.json index c406020..0c74bc4 100644 --- a/api_endpoints.test.json +++ b/api_endpoints.test.json @@ -89,13 +89,13 @@ "auth": false }, { - "method": "GET", - "endpoint": "/uploads/<*>/file-system-abs-path", + "method": "POST", + "endpoint": "/entities/file-system-rel-path", "auth": false }, { - "method": "POST", - "endpoint": "/entities/file-system-rel-path", + "method": "GET", + "endpoint": "/uploads/<*>/file-system-abs-path", "auth": false }, { @@ -214,26 +214,6 @@ "endpoint": "/logout", "auth": false }, - { - "method": "GET", - "endpoint": "/datasets/data-status", - "auth": false - }, - { - "method": "GET", - "endpoint": "/uploads/data-status", - "auth": false - }, - { - "method": "GET", - "endpoint": "/data-ingest-board-login", - "auth": false - }, - { - "method": "GET", - "endpoint": "/data-ingest-board-logout", - "auth": false - }, { "method": "POST", "endpoint": "/datasets/components", @@ -288,7 +268,7 @@ "auth": true, "groups": [ "89a69625-99d7-11ea-9366-0e98982705c1" - ] + ] }, { "method": "PUT", @@ -510,6 +490,50 @@ "groups": [ "5777527e-ec11-11e8-ab41-0af86edb4424" ] + }, + { + "method": "GET", + "endpoint": "/datasets/data-status", + "auth": false + }, + { + "method": "GET", + "endpoint": "/uploads/data-status", + "auth": false + }, + { + "method": "GET", + "endpoint": "/data-ingest-board-login", + "auth": false + }, + { + "method": "GET", + "endpoint": "/data-ingest-board-logout", + "auth": false + }, + { + "method": "POST", + "endpoint": "/assaytype", + "auth": true, + "groups": [ + "5777527e-ec11-11e8-ab41-0af86edb4424" + ] + }, + { + "method": "GET", + "endpoint": "/assaytype/<*>", + "auth": true, + "groups": [ + "5777527e-ec11-11e8-ab41-0af86edb4424" + ] + }, + { + "method": "PUT", + "endpoint": "/reload-assaytypes", + "auth": true, + "groups": [ + "89a69625-99d7-11ea-9366-0e98982705c1" + ] } ] } diff --git a/hubmap-auth/src/app.py b/hubmap-auth/src/app.py index c95ecf8..0f30156 100644 --- a/hubmap-auth/src/app.py +++ b/hubmap-auth/src/app.py @@ -40,6 +40,7 @@ app.config['FILE_ASSETS_STATUS_URL'] = app.config['FILE_ASSETS_STATUS_URL'].strip('/') app.config['CELLS_API_STATUS_URL'] = app.config['CELLS_API_STATUS_URL'].strip('/') app.config['WORKSPACES_API_STATUS_URL'] = app.config['WORKSPACES_API_STATUS_URL'].strip('/') +app.config['ONTOLOGY_API_STATUS_URL'] = app.config['ONTOLOGY_API_STATUS_URL'].strip('/') # LRU Cache implementation with per-item time-to-live (TTL) value # with a memoizing callable that saves up to maxsize results based on a Least Frequently Used (LFU) algorithm @@ -331,6 +332,7 @@ def get_status_data(): FILE_ASSETS = 'file_assets' CELLS_API = 'cells_api' WORKSPACES_API = 'workspaces_api' + ONTOLOGY_API = 'ontology_api' MYSQL_CONNECTION = 'mysql_connection' NEO4J_CONNECTION = 'neo4j_connection' @@ -355,7 +357,8 @@ def get_status_data(): SEARCH_API: {}, FILE_ASSETS: {}, CELLS_API: {}, - WORKSPACES_API: {} + WORKSPACES_API: {}, + ONTOLOGY_API: {} } # uuid-api @@ -472,6 +475,19 @@ def get_status_data(): # Set build status_data[WORKSPACES_API][BUILD] = response_json[BUILD] + # ontology API + ontology_api_response = status_request(app.config["ONTOLOGY_API_STATUS_URL"]) + if ontology_api_response.status_code == 200: + response_json = ontology_api_response.json() + if VERSION in response_json: + # Set version + status_data[ONTOLOGY_API][VERSION] = response_json[VERSION] + if BUILD in response_json: + # Set build + status_data[ONTOLOGY_API][BUILD] = response_json[BUILD] + if NEO4J_CONNECTION in response_json: + # Set Neo4j connection + status_data[ONTOLOGY_API][NEO4J_CONNECTION] = response_json[NEO4J_CONNECTION] # Final result return status_data diff --git a/hubmap-auth/src/instance/app.cfg.example b/hubmap-auth/src/instance/app.cfg.example index 8066a6a..97140a9 100644 --- a/hubmap-auth/src/instance/app.cfg.example +++ b/hubmap-auth/src/instance/app.cfg.example @@ -33,10 +33,9 @@ SEARCH_API_STATUS_URL = 'https://search-api.dev.hubmapconsortium.org/status' FILE_ASSETS_STATUS_URL = 'https://assets.dev.hubmapconsortium.org/status/file_assets_status.json' CELLS_API_STATUS_URL = 'https://cells.dev.hubmapconsortium.org/api/status' WORKSPACES_API_STATUS_URL = 'https://workspaces-api.dev.hubmapconsortium.org/status' +ONTOLOGY_API_STATUS_URL = 'https://ontology-api.dev.hubmapconsortium.org/status' # The maximum integer number of entries in the cache queue CACHE_MAXSIZE = 1024 # Expire the cache after the time-to-live (seconds) CACHE_TTL = 7200 - -