diff --git a/.cruft.json b/.cruft.json index 0bc1c0d..a9b8b83 100644 --- a/.cruft.json +++ b/.cruft.json @@ -8,8 +8,8 @@ "author_email": "cloud-service@elixir-europe.org", "development_status": "1 - Planning", "short_description": "File handler utilizing TUS and MinIO with DRS-Filer integration.", - "project_name": "tus_storagehandler", - "project_slug": "tus_storagehandler", + "project_name": "cloud-storage-handler", + "project_slug": "cloud_storage_handler", "github_username": "elixir-cloud-aai", "python_version": "3.11", "add_script": "y", diff --git a/.github/ISSUE_TEMPLATE/general-purpose.md b/.github/ISSUE_TEMPLATE/general-purpose.md index 21868c7..77d834f 100644 --- a/.github/ISSUE_TEMPLATE/general-purpose.md +++ b/.github/ISSUE_TEMPLATE/general-purpose.md @@ -46,4 +46,4 @@ bug in --> - Operating System and version (desktop or mobile): - Link to your project: -[issue-tracker]: https://github.com/elixir-cloud-aai/tus_storagehandler/issues +[issue-tracker]: https://github.com/elixir-cloud-aai/cloud-storage-handler/issues diff --git a/.github/workflows/code_quality.yaml b/.github/workflows/code_quality.yaml index 135cd7a..d19a1ee 100644 --- a/.github/workflows/code_quality.yaml +++ b/.github/workflows/code_quality.yaml @@ -80,5 +80,5 @@ jobs: poetry-export-options: "--with=code_quality --with=types" - name: Check types - run: poetry run mypy tus_storagehandler/ + run: poetry run mypy cloud_storage_handler/ ... diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 7b528f2..78fcb32 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -29,7 +29,7 @@ jobs: run: | poetry run sphinx-apidoc \ -o /tmp/docs/source/pages \ - tus_storagehandler/ + cloud_storage_handler/ - name: Compare current docs with latest docs id: check_docs_diff diff --git a/.github/workflows/run-application.yaml b/.github/workflows/run-application.yaml index 509b034..dbbe270 100644 --- a/.github/workflows/run-application.yaml +++ b/.github/workflows/run-application.yaml @@ -35,7 +35,7 @@ jobs: - name: Start server in the background run: | - tus_storagehandler & + cloud_storage_handler & echo $! > server.pid - name: Run tests diff --git a/.github/workflows/vulnerability.yaml b/.github/workflows/vulnerability.yaml index ff4db16..7b6a82b 100644 --- a/.github/workflows/vulnerability.yaml +++ b/.github/workflows/vulnerability.yaml @@ -26,7 +26,7 @@ jobs: poetry-export-options: "--only=vulnerability" - name: Check code vulnerabilities with bandit - run: poetry run bandit -c pyproject.toml -r tus_storagehandler/ + run: poetry run bandit -c pyproject.toml -r cloud_storage_handler/ dependency-vulnerabilities: name: Dependencies diff --git a/Makefile b/Makefile index 428044c..59187f2 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ help: @echo "Environment Management --------------------------------------------------------" @echo " \033[1m\033[35mclean-venv\033[0m \033[37m(cv)\033[0m: \033[36mRemove virtual environment.\033[0m" - @echo " \033[1m\033[35minstall\033[0m \033[37m(i)\033[0m: \033[36mInstall dependencies and tus_storagehandler.\033[0m" + @echo " \033[1m\033[35minstall\033[0m \033[37m(i)\033[0m: \033[36mInstall dependencies and cloud_storage_handler.\033[0m" @echo " \033[1m\033[35mvenv\033[0m \033[37m(v)\033[0m: \033[36mCreate virtual environment.\033[0m\n" @echo "Miscellaneous -----------------------------------------------------------------" @@ -50,7 +50,7 @@ cv: clean-venv .PHONY: docs docs: @echo "\nGenerating project documentation ++++++++++++++++++++++++++++++++++++++++++++++\n" - @poetry run sphinx-apidoc -f -o docs/source/pages tus_storagehandler + @poetry run sphinx-apidoc -f -o docs/source/pages cloud_storage_handler @cd docs && make html @echo "\nSummary ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n" @echo "Documentation generated successfully." @@ -90,7 +90,7 @@ pc: precommit-check security: @echo "\nRunning security scans using bandit and safety ++++++++++++++++++++++++++++++++\n" @poetry run safety check --full-report - @poetry run bandit -c pyproject.toml -r tus_storagehandler + @poetry run bandit -c pyproject.toml -r cloud_storage_handler .PHONY: s s: security @@ -106,7 +106,7 @@ t: test .PHONY: type-check type-check: @echo "\nPerforming type checking with mypy ++++++++++++++++++++++++++++++++++++++++++++\n" - @poetry run mypy tus_storagehandler + @poetry run mypy cloud_storage_handler .PHONY: tc tc: type-check diff --git a/README.md b/README.md index 7d619c2..360720a 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ [![Bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://bandit.readthedocs.io/en/latest/) -[![codecov](https://codecov.io/gh/elixir-cloud-aai/tus-storagehandler/branch/main/graph/badge.svg)](https://codecov.io/gh/elixir-cloud-aai/tus-storagehandler) +[![codecov](https://codecov.io/gh/elixir-cloud-aai/cloud-storage-handler/branch/main/graph/badge.svg)](https://codecov.io/gh/elixir-cloud-aai/cloud-storage-handler) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)][code-of-conduct] -[![Documentation Status](https://readthedocs.org/projects/tus_storagehandler/badge/?version=latest)](https://tus_storagehandler.readthedocs.io/en/latest/?badge=latest) +[![Documentation Status](https://readthedocs.org/projects/cloud-storage-handler/badge/?version=latest)](https://cloud-storage-handler.readthedocs.io/en/latest/?badge=latest) [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](./LICENSE) [![Python 3.11](https://img.shields.io/badge/python-3.11-blue.svg)](https://www.python.org/) -[![GitHub contributors](https://img.shields.io/github/contributors/elixir-cloud-aai/tus-storagehandler)](https://github.com/elixir-cloud-aai/tus-storagehandler/graphs/contributors) +[![GitHub contributors](https://img.shields.io/github/contributors/elixir-cloud-aai/cloud-storage-handler)](https://github.com/elixir-cloud-aai/cloud-storage-handler/graphs/contributors) [![Ruff](https://img.shields.io/badge/linter%20&%20formatter-ruff-000000.svg)](https://docs.astral.sh/ruff/) [![Safety](https://img.shields.io/badge/security-safety-orange.svg)](https://safetycli.com/product/safety-cli) -# tus-storagehandler +# Cloud Storage Handler File handler utilizing TUS and MinIO with DRS-Filer integration. @@ -54,15 +54,15 @@ minio server /data --console-address ":9001" To get started, first, clone the repository using the following command: ```sh - git clone https://github.com/elixir-cloud-aai/tus-storagehandler.git + git clone https://github.com/elixir-cloud-aai/cloud-storage-handler.git ``` 1. **Navigate to the package folder** - Navigate to the folder `tus_storagehandler`: + Navigate to the folder `cloud-storage-handler`: ```sh - cd tus_storagehandler + cd cloud-storage-handler ``` 1. **Install Poetry** @@ -185,8 +185,11 @@ make u | **Environment Variable** | **Description** | **Usage** | **Error Handling** | -|--|--|--|--| -| `CSH_FOCA_CONFIG_PATH` | Specifies the path to the configuration file for the FOCA app. | The FOCA app uses this environment variable to locate the configuration file. If not set, it defaults to `dev`. | If the configuration file is not found at the specified or default path, a `FileNotFoundError` will be raised. | +|--|--|--|--| | `CSH_FOCA_CONFIG_PATH` | Specifies the path to the configuration +file for the FOCA app. | The FOCA app uses this environment variable to locate +the configuration file. If not set, it defaults to `dev`. | If the configuration +file is not found at the specified or default path, a `FileNotFoundError` will +be raised. | @@ -242,7 +245,7 @@ To get in touch with us, please use one of the following routes: [elixir-compute]: https://elixir-europe.org/platforms/compute [email]: mailto:cloud-service@elixir-europe.org [ga4gh]: https://ga4gh.org/ -[issue-tracker]: https://github.com/elixir-cloud-aai/tus-storagehandler/issues +[issue-tracker]: https://github.com/elixir-cloud-aai/cloud-storage-handler/issues [license]: LICENSE [logo-elixir]: images/logo-elixir.svg [logo-elixir-cloud-aai]: images/logo-elixir-cloud-aai.svg diff --git a/tus_storagehandler/__init__.py b/cloud_storage_handler/__init__.py similarity index 100% rename from tus_storagehandler/__init__.py rename to cloud_storage_handler/__init__.py diff --git a/tus_storagehandler/api/__init__.py b/cloud_storage_handler/api/__init__.py similarity index 100% rename from tus_storagehandler/api/__init__.py rename to cloud_storage_handler/api/__init__.py diff --git a/tus_storagehandler/api/elixircloud/__init__.py b/cloud_storage_handler/api/elixircloud/__init__.py similarity index 100% rename from tus_storagehandler/api/elixircloud/__init__.py rename to cloud_storage_handler/api/elixircloud/__init__.py diff --git a/tus_storagehandler/api/elixircloud/csh/__init__.py b/cloud_storage_handler/api/elixircloud/csh/__init__.py similarity index 100% rename from tus_storagehandler/api/elixircloud/csh/__init__.py rename to cloud_storage_handler/api/elixircloud/csh/__init__.py diff --git a/tus_storagehandler/api/elixircloud/csh/controllers.py b/cloud_storage_handler/api/elixircloud/csh/controllers.py similarity index 84% rename from tus_storagehandler/api/elixircloud/csh/controllers.py rename to cloud_storage_handler/api/elixircloud/csh/controllers.py index b70a045..fb23a34 100644 --- a/tus_storagehandler/api/elixircloud/csh/controllers.py +++ b/cloud_storage_handler/api/elixircloud/csh/controllers.py @@ -1,4 +1,4 @@ -"""Cloud Storage Handler controllers.""" +"""ELIXIR's Cloud Storage Handler controllers.""" import logging from http import HTTPStatus diff --git a/tus_storagehandler/api/specs/specs.yaml b/cloud_storage_handler/api/specs/specs.yaml similarity index 88% rename from tus_storagehandler/api/specs/specs.yaml rename to cloud_storage_handler/api/specs/specs.yaml index cf3af80..2c61d7f 100644 --- a/tus_storagehandler/api/specs/specs.yaml +++ b/cloud_storage_handler/api/specs/specs.yaml @@ -11,7 +11,7 @@ info: name: Apache 2.0 url: > https://github.com/elixir-cloud-aai/ - tus_storagehandler/blob/main/LICENSE + cloud-storage-handler/blob/main/LICENSE servers: - url: /elixircoud/csh/v1 paths: @@ -30,7 +30,7 @@ paths: properties: message: type: string - example: "Welcome to Tus Storage Handler API" + example: "Welcome to Cloud Storage Handler API" '400': description: The request is malformed. '500': diff --git a/tus_storagehandler/exceptions.py b/cloud_storage_handler/exceptions.py similarity index 82% rename from tus_storagehandler/exceptions.py rename to cloud_storage_handler/exceptions.py index 26b784b..f5fb8c5 100644 --- a/tus_storagehandler/exceptions.py +++ b/cloud_storage_handler/exceptions.py @@ -1,4 +1,4 @@ -"""Tus Storage Handler exceptions.""" +"""ELIXIR's Cloud Storage Handler exceptions.""" from http import HTTPStatus @@ -18,7 +18,7 @@ "code": HTTPStatus.NOT_FOUND, # 404 }, InternalServerError: { - "message": "An internal server error occurred in the tus storage handler", + "message": "An internal server error occurred in the cloud storage handler", "code": HTTPStatus.INTERNAL_SERVER_ERROR, # 500 }, } diff --git a/tus_storagehandler/app.py b/cloud_storage_handler/main.py similarity index 100% rename from tus_storagehandler/app.py rename to cloud_storage_handler/main.py diff --git a/deployment/config.yaml b/deployment/config.yaml index abd7679..2d1329f 100644 --- a/deployment/config.yaml +++ b/deployment/config.yaml @@ -24,10 +24,10 @@ security: api: specs: - - path: tus_storagehandler/api/specs/specs.yaml + - path: cloud_storage_handler/api/specs/specs.yaml append: null add_operation_fields: - x-openapi-router-controller: tus_storagehandler.api.elixircloud.csh.controllers + x-openapi-router-controller: cloud_storage_handler.api.elixircloud.csh.controllers connexion: strict_validation: true validate_responses: false @@ -38,5 +38,5 @@ api: exceptions: required_members: [['message'], ['code']] status_member: ['code'] - exceptions: tus_storagehandler.exceptions.exceptions + exceptions: cloud_storage_handler.exceptions.exceptions ... diff --git a/docs/source/index.rst b/docs/source/index.rst index f51987b..64004cc 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,4 +1,4 @@ -Welcome to tus_storagehandler's documentation! +Welcome to cloud_storage_handler's documentation! =========================================================== .. toctree:: diff --git a/docs/source/pages/cloud_storage_handler.api.elixircloud.csh.rst b/docs/source/pages/cloud_storage_handler.api.elixircloud.csh.rst new file mode 100644 index 0000000..2222742 --- /dev/null +++ b/docs/source/pages/cloud_storage_handler.api.elixircloud.csh.rst @@ -0,0 +1,21 @@ +cloud\_storage\_handler.api.elixircloud.csh package +=================================================== + +Submodules +---------- + +cloud\_storage\_handler.api.elixircloud.csh.controllers module +-------------------------------------------------------------- + +.. automodule:: cloud_storage_handler.api.elixircloud.csh.controllers + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: cloud_storage_handler.api.elixircloud.csh + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/pages/cloud_storage_handler.api.elixircloud.rst b/docs/source/pages/cloud_storage_handler.api.elixircloud.rst new file mode 100644 index 0000000..beed776 --- /dev/null +++ b/docs/source/pages/cloud_storage_handler.api.elixircloud.rst @@ -0,0 +1,18 @@ +cloud\_storage\_handler.api.elixircloud package +=============================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + cloud_storage_handler.api.elixircloud.csh + +Module contents +--------------- + +.. automodule:: cloud_storage_handler.api.elixircloud + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/pages/cloud_storage_handler.api.rst b/docs/source/pages/cloud_storage_handler.api.rst new file mode 100644 index 0000000..78a26d7 --- /dev/null +++ b/docs/source/pages/cloud_storage_handler.api.rst @@ -0,0 +1,18 @@ +cloud\_storage\_handler.api package +=================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + cloud_storage_handler.api.elixircloud + +Module contents +--------------- + +.. automodule:: cloud_storage_handler.api + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/pages/cloud_storage_handler.rst b/docs/source/pages/cloud_storage_handler.rst new file mode 100644 index 0000000..dd44edb --- /dev/null +++ b/docs/source/pages/cloud_storage_handler.rst @@ -0,0 +1,37 @@ +cloud\_storage\_handler package +=============================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + cloud_storage_handler.api + +Submodules +---------- + +cloud\_storage\_handler.exceptions module +----------------------------------------- + +.. automodule:: cloud_storage_handler.exceptions + :members: + :undoc-members: + :show-inheritance: + +cloud\_storage\_handler.main module +----------------------------------- + +.. automodule:: cloud_storage_handler.main + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: cloud_storage_handler + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/pages/modules.rst b/docs/source/pages/modules.rst index 66ab2b8..94887db 100644 --- a/docs/source/pages/modules.rst +++ b/docs/source/pages/modules.rst @@ -1,7 +1,7 @@ -tus_storagehandler -================== +cloud_storage_handler +===================== .. toctree:: :maxdepth: 4 - tus_storagehandler + cloud_storage_handler diff --git a/docs/source/pages/tus_storagehandler.api.elixircloud.csh.rst b/docs/source/pages/tus_storagehandler.api.elixircloud.csh.rst deleted file mode 100644 index 5f59f96..0000000 --- a/docs/source/pages/tus_storagehandler.api.elixircloud.csh.rst +++ /dev/null @@ -1,21 +0,0 @@ -tus\_storagehandler.api.elixircloud.csh package -=============================================== - -Submodules ----------- - -tus\_storagehandler.api.elixircloud.csh.controllers module ----------------------------------------------------------- - -.. automodule:: tus_storagehandler.api.elixircloud.csh.controllers - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: tus_storagehandler.api.elixircloud.csh - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/pages/tus_storagehandler.api.elixircloud.rst b/docs/source/pages/tus_storagehandler.api.elixircloud.rst deleted file mode 100644 index 013bba5..0000000 --- a/docs/source/pages/tus_storagehandler.api.elixircloud.rst +++ /dev/null @@ -1,18 +0,0 @@ -tus\_storagehandler.api.elixircloud package -=========================================== - -Subpackages ------------ - -.. toctree:: - :maxdepth: 4 - - tus_storagehandler.api.elixircloud.csh - -Module contents ---------------- - -.. automodule:: tus_storagehandler.api.elixircloud - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/pages/tus_storagehandler.api.rst b/docs/source/pages/tus_storagehandler.api.rst deleted file mode 100644 index b645718..0000000 --- a/docs/source/pages/tus_storagehandler.api.rst +++ /dev/null @@ -1,18 +0,0 @@ -tus\_storagehandler.api package -=============================== - -Subpackages ------------ - -.. toctree:: - :maxdepth: 4 - - tus_storagehandler.api.elixircloud - -Module contents ---------------- - -.. automodule:: tus_storagehandler.api - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/pages/tus_storagehandler.rst b/docs/source/pages/tus_storagehandler.rst deleted file mode 100644 index 8dc0616..0000000 --- a/docs/source/pages/tus_storagehandler.rst +++ /dev/null @@ -1,37 +0,0 @@ -tus\_storagehandler package -=========================== - -Subpackages ------------ - -.. toctree:: - :maxdepth: 4 - - tus_storagehandler.api - -Submodules ----------- - -tus\_storagehandler.app module ------------------------------- - -.. automodule:: tus_storagehandler.app - :members: - :undoc-members: - :show-inheritance: - -tus\_storagehandler.exceptions module -------------------------------------- - -.. automodule:: tus_storagehandler.exceptions - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: tus_storagehandler - :members: - :undoc-members: - :show-inheritance: diff --git a/pyproject.toml b/pyproject.toml index 6a11168..d5c83ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,9 +24,9 @@ classifiers = [ description = "File handler utilizing TUS and MinIO with DRS-Filer integration." license = "Apache-2.0" maintainers = ["ELIXIR Cloud AAI "] -name = "tus_storagehandler" +name = "cloud_storage_handler" readme = "README.md" -repository = "https://github.com/elixir-cloud-aai/tus_storagehandler" +repository = "https://github.com/elixir-cloud-aai/cloud-storage-handler" version = "0.1.0" [tool.poetry.dependencies] @@ -84,7 +84,7 @@ bandit = ">=1.7.8,<2.0.0" safety = ">=3.2.0,<4.0.0" [tool.poetry.scripts] -tus_storagehandler = "tus_storagehandler.app:main" +cloud-storage-handler = "cloud_storage_handler.main:main" [tool.ruff] indent-width = 4 diff --git a/tests/test_integration/test_init.py b/tests/test_integration/test_init.py index 120ea30..75d226d 100644 --- a/tests/test_integration/test_init.py +++ b/tests/test_integration/test_init.py @@ -5,5 +5,7 @@ def test_init_file_exists(): """Check if the __init__.py file exists.""" - path_to_init_file = Path(__file__).parents[2] / "tus_storagehandler" / "__init__.py" + path_to_init_file = ( + Path(__file__).parents[2] / "cloud_storage_handler" / "__init__.py" + ) assert path_to_init_file.exists(), f"File {path_to_init_file} does not exist." diff --git a/tests/test_integration/test_operations.py b/tests/test_integration/test_operations.py index 51b6d3c..949cb18 100644 --- a/tests/test_integration/test_operations.py +++ b/tests/test_integration/test_operations.py @@ -1,4 +1,4 @@ -"""Test operations for the tus-storagehandler service.""" +"""Test operations for the cloud storage handler service.""" from http import HTTPStatus from unittest import mock diff --git a/tests/test_unit/test_init.py b/tests/test_unit/test_init.py index 9698931..6b4c489 100644 --- a/tests/test_unit/test_init.py +++ b/tests/test_unit/test_init.py @@ -5,5 +5,7 @@ def test_init_file_exists(): """Check if the __init__.py file exists.""" - path_to_init_file = Path(__file__).parents[2] / "tus_storagehandler" / "__init__.py" + path_to_init_file = ( + Path(__file__).parents[2] / "cloud_storage_handler" / "__init__.py" + ) assert path_to_init_file.exists(), f"File {path_to_init_file} does not exist."