{"id":24641168,"url":"https://github.com/elixir-cloud-aai/protes-middleware-crypt4gh","last_synced_at":"2025-10-06T02:14:57.371Z","repository":{"id":241157793,"uuid":"798436591","full_name":"elixir-cloud-aai/protes-middleware-crypt4gh","owner":"elixir-cloud-aai","description":"proTES middleware adding support for Crypt4GH","archived":false,"fork":false,"pushed_at":"2024-09-06T21:34:32.000Z","size":291,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":22,"default_branch":"main","last_synced_at":"2025-03-20T11:49:04.209Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elixir-cloud-aai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-09T19:17:30.000Z","updated_at":"2024-09-06T21:34:33.000Z","dependencies_parsed_at":"2024-05-22T18:47:15.593Z","dependency_job_id":"3a2cf00c-40ec-482e-bc3e-90e9236711c4","html_url":"https://github.com/elixir-cloud-aai/protes-middleware-crypt4gh","commit_stats":null,"previous_names":["elixir-cloud-aai/protes-middleware-crypt4gh"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/elixir-cloud-aai/protes-middleware-crypt4gh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-cloud-aai%2Fprotes-middleware-crypt4gh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-cloud-aai%2Fprotes-middleware-crypt4gh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-cloud-aai%2Fprotes-middleware-crypt4gh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-cloud-aai%2Fprotes-middleware-crypt4gh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elixir-cloud-aai","download_url":"https://codeload.github.com/elixir-cloud-aai/protes-middleware-crypt4gh/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-cloud-aai%2Fprotes-middleware-crypt4gh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278547821,"owners_count":26004775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-25T12:12:31.485Z","updated_at":"2025-10-06T02:14:57.357Z","avatar_url":"https://github.com/elixir-cloud-aai.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Crypt4GH Middleware for proTES\n[![license][badge-license]][badge-url-license]\n[![chat][badge-chat]][badge-url-chat]\n\n## Synopsis\nThis proof-of-concept middleware enables the use of [Crypt4GH][crypt4gh] files as inputs for tasks that are \nrun in [TES][tes] implementations (e.g., [funnel][funnel], [TESK][tesk]).\n\n## Description\nCurrently, there are no implementations of TES that natively support the use of files encrypted with Crypt4GH.\nThis middleware supports the use of Crypt4GH files by prepending the list of executors in a TES request with a\ndecryption executor. This decryption executor decrypts the contents of any Crypt4GH files and places them in a volume\nso that subsequent executors can work on the decrypted contents.\n\n## Implementation Details\n\n### Middleware\nThe middleware alters the initial TES request such that a decryption executor and a new volume (`/vol/crypt/`) are added \nto the request. Since the decryption executor places all input files in `/vol/crypt/`, all input paths in subsequent\nexecutors are altered to `/vol/crypt/{filename}`.\n\n\u003cimg alt=\"request-diagram\" src=\"images/request.png\" height=\"600\"\u003e\n\n### Decryption\nThe functionality of the decryption executor lies in [`decrypt.py`][decrypt]. This script moves all input files to a\nspecified output directory (in this case, `/vol/crypt/`). If a Crypt4GH file is detected and the secret key used to\nencrypt it is provided, the executor decrypts the contents of the Crypt4GH file and places it in `/vol/crypt/`.\nSubsequent executors then refer to the files in `/vol/crypt/`, not their original locations.\n\n\u003cimg alt=\"workflow-diagram\" src=\"images/workflow.png\" height=\"400\"\u003e\n\n## Important Considerations\nYou __should not use this middleware in untrusted environments__, as it requires transmission of secret keys and stores\nthe decrypted contents of Crypt4GH files on disk. This middleware is meant to be used with a [Trusted Execution \nEnvironment (TEE)][TEE], which allows for the secure transmission and storage of data. Integration with TEEs is a work\nin progress.\n\n## Installation\n```bash\n pip install poetry\n poetry install\n```\n\n## Testing\n### Requirements\nTests require a running TES instance and an S3 bucket containing the input files. Instances of [Funnel][funnel] \nand [MinIO][minio] were used in development. `TES_URL` in `tests/tasks/test_tasks.py` can be altered depending on the\nTES instance being used.\n\n### Run Tests\nRun tests using pytest.\n```bash\npoetry run pytest tests\n```\n\n## Contributing\nThis project is a community effort and lives off your contributions, be it in the form of bug reports, feature requests,\ndiscussions, ideas, fixes, or other code changes. Please read these [guidelines][guidelines] if you want to contribute. \nAnd please mind the [code of conduct][code-of-conduct] for all interactions with the community.\n\n## License\nThis project is distributed under the [Apache License 2.0][badge-license], a\ncopy of which is also available in [`LICENSE`][license].\n\n## Contact\nThe project is maintained by [ELIXIR Cloud \u0026 AAI][elixir-cloud-aai], a Driver\nProject of the [Global Alliance for Genomics and Health (GA4GH)][ga4gh], under\nthe umbrella of the [ELIXIR][elixir] [Compute Platform][elixir-compute]. For filing bug reports, feature requests or other code-related issues, please\n  make use of the project's [issue tracker](https://github.com/elixir-cloud-aai/protes-middleware-crypt4gh/issues).\n\n[![GA4GH logo](images/logo-ga4gh.png)](https://www.ga4gh.org/)\n[![ELIXIR logo](images/logo-elixir.png)](https://www.elixir-europe.org/)\n[![ELIXIR Cloud \u0026 AAI logo](images/logo-elixir-cloud.png)](https://elixir-europe.github.io/cloud/)\n\n[badge-license]: https://img.shields.io/badge/license-Apache%202.0-blue.svg\n[badge-chat]: https://img.shields.io/static/v1?label=chat\u0026message=Slack\u0026color=ff6994\n[badge-url-license]: \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e\n[badge-url-chat]: https://elixir-cloud.slack.com/archives/C04RLFJNF7U\n[code-of-conduct]: https://github.com/elixir-cloud-aai/elixir-cloud-aai/blob/dev/CODE_OF_CONDUCT.md\n[crypt4gh]: https://www.ga4gh.org/news_item/crypt4gh-a-secure-method-for-sharing-human-genetic-data/\n[decrypt]: https://github.com/elixir-cloud-aai/protes-middleware-crypt4gh/blob/main/crypt4gh_middleware/decrypt.py\n[elixir]: https://elixir-europe.org/\n[elixir-cloud-aai]: https://elixir-cloud.dcc.sib.swiss/\n[elixir-compute]: https://elixir-europe.org/platforms/compute\n[funnel]: https://ohsu-comp-bio.github.io/funnel/\n[ga4gh]: https://ga4gh.org/\n[guidelines]: https://elixir-cloud-aai.github.io/guides/guide-contributor/\n[license]: LICENSE\n[minio]: https://min.io/\n[request]: \u003cimages/request.png\u003e\n[tes]: https://github.com/ga4gh/task-execution-schemas\n[tesk]: https://github.com/elixir-cloud-aai/TESK\n[TEE]: https://f1000research.com/posters/13-194\n[workflow]: \u003cimages/workflow.png\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-cloud-aai%2Fprotes-middleware-crypt4gh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felixir-cloud-aai%2Fprotes-middleware-crypt4gh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-cloud-aai%2Fprotes-middleware-crypt4gh/lists"}