diff --git a/.env.example b/.env.example index f170bfc..a48b73f 100644 --- a/.env.example +++ b/.env.example @@ -1,17 +1,15 @@ -# Local MinIO instance +# Hub endpoints +HUB__API_BASE_URL=https://api.privateaim.net +HUB__AUTH_BASE_URL=https://auth.privateaim.net +HUB__AUTH_USERNAME=foobar +HUB__AUTH_PASSWORD=sup3r_s3cr3t +# MinIO instance MINIO__ENDPOINT=localhost:9000 MINIO__ACCESS_KEY=admin MINIO__SECRET_KEY=s3cr3t_p4ssw0rd MINIO__REGION=us-east-1 MINIO__BUCKET=flame MINIO__USE_SSL=0 -# Remote MinIO instance (should be different from local in productive setting) -REMOTE__ENDPOINT=localhost:9000 -REMOTE__ACCESS_KEY=admin -REMOTE__SECRET_KEY=s3cr3t_p4ssw0rd -REMOTE__REGION=us-east-1 -REMOTE__BUCKET=upload -REMOTE__USE_SSL=0 # OIDC config OIDC__CERTS_URL=http://localhost:8080/realms/flame/protocol/openid-connect/certs OIDC__CLIENT_ID_CLAIM_NAME=client_id diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 180f42f..aa24840 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -30,8 +30,6 @@ jobs: run: poetry install - name: Create local bucket run: poetry run flame-result migrate --no-verify "$MINIO_ROOT_USER" "$MINIO_ROOT_PASSWORD" "$MINIO_LOCAL_BUCKET_NAME" - - name: Create remote bucket - run: poetry run flame-result migrate --no-verify "$MINIO_ROOT_USER" "$MINIO_ROOT_PASSWORD" "$MINIO_REMOTE_BUCKET_NAME" - name: Run tests run: poetry run pytest env: @@ -39,10 +37,8 @@ jobs: PYTEST__MINIO__SECRET_KEY: ${{env.MINIO_ROOT_PASSWORD}} PYTEST__MINIO__BUCKET: ${{env.MINIO_LOCAL_BUCKET_NAME}} PYTEST__MINIO__ENDPOINT: localhost:9000 - PYTEST__REMOTE__ACCESS_KEY: ${{env.MINIO_ROOT_USER}} - PYTEST__REMOTE__SECRET_KEY: ${{env.MINIO_ROOT_PASSWORD}} - PYTEST__REMOTE__BUCKET: ${{env.MINIO_REMOTE_BUCKET_NAME}} - PYTEST__REMOTE__ENDPOINT: localhost:9000 + PYTEST__HUB__AUTH_USERNAME: ${{secrets.HUB_AUTH_USERNAME}} + PYTEST__HUB__AUTH_PASSWORD: ${{secrets.HUB_AUTH_PASSWORD}} services: minio: diff --git a/README.md b/README.md index b22c9ee..37e644b 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,8 @@ $ PYTEST__MINIO__ENDPOINT="localhost:9000" \ PYTEST__MINIO__ACCESS_KEY="admin" \ PYTEST__MINIO__SECRET_KEY="s3cr3t_p4ssw0rd" \ PYTEST__MINIO__BUCKET="flame" \ - PYTEST__REMOTE__ENDPOINT="localhost:9000" \ - PYTEST__REMOTE__ACCESS_KEY="admin" \ - PYTEST__REMOTE__SECRET_KEY="s3cr3t_p4ssw0rd" \ - PYTEST__REMOTE__BUCKET="upload" pytest + PYTEST__HUB__AUTH_USERNAME="XXXXXXXX" \ + PYTEST__HUB__AUTH_PASSWORD="XXXXXXXX" pytest ``` OIDC does not need to be configured. diff --git a/poetry.lock b/poetry.lock index 9a224a2..5688582 100644 --- a/poetry.lock +++ b/poetry.lock @@ -13,13 +13,13 @@ files = [ [[package]] name = "anyio" -version = "4.2.0" +version = "4.3.0" description = "High level compatibility layer for multiple asynchronous event loop implementations" optional = false python-versions = ">=3.8" files = [ - {file = "anyio-4.2.0-py3-none-any.whl", hash = "sha256:745843b39e829e108e518c489b31dc757de7d2131d53fac32bd8df268227bfee"}, - {file = "anyio-4.2.0.tar.gz", hash = "sha256:e1875bb4b4e2de1669f4bc7869b6d3f54231cdced71605e6e64c9be77e3be50f"}, + {file = "anyio-4.3.0-py3-none-any.whl", hash = "sha256:048e05d0f6caeed70d731f3db756d35dcc1f35747c8c403364a8332c630441b8"}, + {file = "anyio-4.3.0.tar.gz", hash = "sha256:f75253795a87df48568485fd18cdd2a3fa5c4f7c5be8e5e36637733fce06fed6"}, ] [package.dependencies] @@ -203,43 +203,43 @@ files = [ [[package]] name = "cryptography" -version = "42.0.4" +version = "42.0.5" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." optional = false python-versions = ">=3.7" files = [ - {file = "cryptography-42.0.4-cp37-abi3-macosx_10_12_universal2.whl", hash = "sha256:ffc73996c4fca3d2b6c1c8c12bfd3ad00def8621da24f547626bf06441400449"}, - {file = "cryptography-42.0.4-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:db4b65b02f59035037fde0998974d84244a64c3265bdef32a827ab9b63d61b18"}, - {file = "cryptography-42.0.4-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dad9c385ba8ee025bb0d856714f71d7840020fe176ae0229de618f14dae7a6e2"}, - {file = "cryptography-42.0.4-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:69b22ab6506a3fe483d67d1ed878e1602bdd5912a134e6202c1ec672233241c1"}, - {file = "cryptography-42.0.4-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:e09469a2cec88fb7b078e16d4adec594414397e8879a4341c6ace96013463d5b"}, - {file = "cryptography-42.0.4-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:3e970a2119507d0b104f0a8e281521ad28fc26f2820687b3436b8c9a5fcf20d1"}, - {file = "cryptography-42.0.4-cp37-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:e53dc41cda40b248ebc40b83b31516487f7db95ab8ceac1f042626bc43a2f992"}, - {file = "cryptography-42.0.4-cp37-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:c3a5cbc620e1e17009f30dd34cb0d85c987afd21c41a74352d1719be33380885"}, - {file = "cryptography-42.0.4-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:6bfadd884e7280df24d26f2186e4e07556a05d37393b0f220a840b083dc6a824"}, - {file = "cryptography-42.0.4-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:01911714117642a3f1792c7f376db572aadadbafcd8d75bb527166009c9f1d1b"}, - {file = "cryptography-42.0.4-cp37-abi3-win32.whl", hash = "sha256:fb0cef872d8193e487fc6bdb08559c3aa41b659a7d9be48b2e10747f47863925"}, - {file = "cryptography-42.0.4-cp37-abi3-win_amd64.whl", hash = "sha256:c1f25b252d2c87088abc8bbc4f1ecbf7c919e05508a7e8628e6875c40bc70923"}, - {file = "cryptography-42.0.4-cp39-abi3-macosx_10_12_universal2.whl", hash = "sha256:15a1fb843c48b4a604663fa30af60818cd28f895572386e5f9b8a665874c26e7"}, - {file = "cryptography-42.0.4-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a1327f280c824ff7885bdeef8578f74690e9079267c1c8bd7dc5cc5aa065ae52"}, - {file = "cryptography-42.0.4-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6ffb03d419edcab93b4b19c22ee80c007fb2d708429cecebf1dd3258956a563a"}, - {file = "cryptography-42.0.4-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:1df6fcbf60560d2113b5ed90f072dc0b108d64750d4cbd46a21ec882c7aefce9"}, - {file = "cryptography-42.0.4-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:44a64043f743485925d3bcac548d05df0f9bb445c5fcca6681889c7c3ab12764"}, - {file = "cryptography-42.0.4-cp39-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:3c6048f217533d89f2f8f4f0fe3044bf0b2090453b7b73d0b77db47b80af8dff"}, - {file = "cryptography-42.0.4-cp39-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:6d0fbe73728c44ca3a241eff9aefe6496ab2656d6e7a4ea2459865f2e8613257"}, - {file = "cryptography-42.0.4-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:887623fe0d70f48ab3f5e4dbf234986b1329a64c066d719432d0698522749929"}, - {file = "cryptography-42.0.4-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:ce8613beaffc7c14f091497346ef117c1798c202b01153a8cc7b8e2ebaaf41c0"}, - {file = "cryptography-42.0.4-cp39-abi3-win32.whl", hash = "sha256:810bcf151caefc03e51a3d61e53335cd5c7316c0a105cc695f0959f2c638b129"}, - {file = "cryptography-42.0.4-cp39-abi3-win_amd64.whl", hash = "sha256:a0298bdc6e98ca21382afe914c642620370ce0470a01e1bef6dd9b5354c36854"}, - {file = "cryptography-42.0.4-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5f8907fcf57392cd917892ae83708761c6ff3c37a8e835d7246ff0ad251d9298"}, - {file = "cryptography-42.0.4-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:12d341bd42cdb7d4937b0cabbdf2a94f949413ac4504904d0cdbdce4a22cbf88"}, - {file = "cryptography-42.0.4-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:1cdcdbd117681c88d717437ada72bdd5be9de117f96e3f4d50dab3f59fd9ab20"}, - {file = "cryptography-42.0.4-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:0e89f7b84f421c56e7ff69f11c441ebda73b8a8e6488d322ef71746224c20fce"}, - {file = "cryptography-42.0.4-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:f1e85a178384bf19e36779d91ff35c7617c885da487d689b05c1366f9933ad74"}, - {file = "cryptography-42.0.4-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:d2a27aca5597c8a71abbe10209184e1a8e91c1fd470b5070a2ea60cafec35bcd"}, - {file = "cryptography-42.0.4-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:4e36685cb634af55e0677d435d425043967ac2f3790ec652b2b88ad03b85c27b"}, - {file = "cryptography-42.0.4-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:f47be41843200f7faec0683ad751e5ef11b9a56a220d57f300376cd8aba81660"}, - {file = "cryptography-42.0.4.tar.gz", hash = "sha256:831a4b37accef30cccd34fcb916a5d7b5be3cbbe27268a02832c3e450aea39cb"}, + {file = "cryptography-42.0.5-cp37-abi3-macosx_10_12_universal2.whl", hash = "sha256:a30596bae9403a342c978fb47d9b0ee277699fa53bbafad14706af51fe543d16"}, + {file = "cryptography-42.0.5-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:b7ffe927ee6531c78f81aa17e684e2ff617daeba7f189f911065b2ea2d526dec"}, + {file = "cryptography-42.0.5-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2424ff4c4ac7f6b8177b53c17ed5d8fa74ae5955656867f5a8affaca36a27abb"}, + {file = "cryptography-42.0.5-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:329906dcc7b20ff3cad13c069a78124ed8247adcac44b10bea1130e36caae0b4"}, + {file = "cryptography-42.0.5-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:b03c2ae5d2f0fc05f9a2c0c997e1bc18c8229f392234e8a0194f202169ccd278"}, + {file = "cryptography-42.0.5-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:f8837fe1d6ac4a8052a9a8ddab256bc006242696f03368a4009be7ee3075cdb7"}, + {file = "cryptography-42.0.5-cp37-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:0270572b8bd2c833c3981724b8ee9747b3ec96f699a9665470018594301439ee"}, + {file = "cryptography-42.0.5-cp37-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:b8cac287fafc4ad485b8a9b67d0ee80c66bf3574f655d3b97ef2e1082360faf1"}, + {file = "cryptography-42.0.5-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:16a48c23a62a2f4a285699dba2e4ff2d1cff3115b9df052cdd976a18856d8e3d"}, + {file = "cryptography-42.0.5-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:2bce03af1ce5a5567ab89bd90d11e7bbdff56b8af3acbbec1faded8f44cb06da"}, + {file = "cryptography-42.0.5-cp37-abi3-win32.whl", hash = "sha256:b6cd2203306b63e41acdf39aa93b86fb566049aeb6dc489b70e34bcd07adca74"}, + {file = "cryptography-42.0.5-cp37-abi3-win_amd64.whl", hash = "sha256:98d8dc6d012b82287f2c3d26ce1d2dd130ec200c8679b6213b3c73c08b2b7940"}, + {file = "cryptography-42.0.5-cp39-abi3-macosx_10_12_universal2.whl", hash = "sha256:5e6275c09d2badf57aea3afa80d975444f4be8d3bc58f7f80d2a484c6f9485c8"}, + {file = "cryptography-42.0.5-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e4985a790f921508f36f81831817cbc03b102d643b5fcb81cd33df3fa291a1a1"}, + {file = "cryptography-42.0.5-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7cde5f38e614f55e28d831754e8a3bacf9ace5d1566235e39d91b35502d6936e"}, + {file = "cryptography-42.0.5-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:7367d7b2eca6513681127ebad53b2582911d1736dc2ffc19f2c3ae49997496bc"}, + {file = "cryptography-42.0.5-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:cd2030f6650c089aeb304cf093f3244d34745ce0cfcc39f20c6fbfe030102e2a"}, + {file = "cryptography-42.0.5-cp39-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:a2913c5375154b6ef2e91c10b5720ea6e21007412f6437504ffea2109b5a33d7"}, + {file = "cryptography-42.0.5-cp39-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:c41fb5e6a5fe9ebcd58ca3abfeb51dffb5d83d6775405305bfa8715b76521922"}, + {file = "cryptography-42.0.5-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:3eaafe47ec0d0ffcc9349e1708be2aaea4c6dd4978d76bf6eb0cb2c13636c6fc"}, + {file = "cryptography-42.0.5-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:1b95b98b0d2af784078fa69f637135e3c317091b615cd0905f8b8a087e86fa30"}, + {file = "cryptography-42.0.5-cp39-abi3-win32.whl", hash = "sha256:1f71c10d1e88467126f0efd484bd44bca5e14c664ec2ede64c32f20875c0d413"}, + {file = "cryptography-42.0.5-cp39-abi3-win_amd64.whl", hash = "sha256:a011a644f6d7d03736214d38832e030d8268bcff4a41f728e6030325fea3e400"}, + {file = "cryptography-42.0.5-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:9481ffe3cf013b71b2428b905c4f7a9a4f76ec03065b05ff499bb5682a8d9ad8"}, + {file = "cryptography-42.0.5-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:ba334e6e4b1d92442b75ddacc615c5476d4ad55cc29b15d590cc6b86efa487e2"}, + {file = "cryptography-42.0.5-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:ba3e4a42397c25b7ff88cdec6e2a16c2be18720f317506ee25210f6d31925f9c"}, + {file = "cryptography-42.0.5-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:111a0d8553afcf8eb02a4fea6ca4f59d48ddb34497aa8706a6cf536f1a5ec576"}, + {file = "cryptography-42.0.5-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:cd65d75953847815962c84a4654a84850b2bb4aed3f26fadcc1c13892e1e29f6"}, + {file = "cryptography-42.0.5-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:e807b3188f9eb0eaa7bbb579b462c5ace579f1cedb28107ce8b48a9f7ad3679e"}, + {file = "cryptography-42.0.5-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:f12764b8fffc7a123f641d7d049d382b73f96a34117e0b637b80643169cec8ac"}, + {file = "cryptography-42.0.5-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:37dd623507659e08be98eec89323469e8c7b4c1407c85112634ae3dbdb926fdd"}, + {file = "cryptography-42.0.5.tar.gz", hash = "sha256:6fe07eec95dfd477eb9530aef5bead34fec819b3aaf6c5bd6d20565da607bfe1"}, ] [package.dependencies] @@ -328,13 +328,13 @@ files = [ [[package]] name = "httpcore" -version = "1.0.2" +version = "1.0.4" description = "A minimal low-level HTTP client." optional = false python-versions = ">=3.8" files = [ - {file = "httpcore-1.0.2-py3-none-any.whl", hash = "sha256:096cc05bca73b8e459a1fc3dcf585148f63e534eae4339559c9b8a8d6399acc7"}, - {file = "httpcore-1.0.2.tar.gz", hash = "sha256:9fc092e4799b26174648e54b74ed5f683132a464e95643b226e00c2ed2fa6535"}, + {file = "httpcore-1.0.4-py3-none-any.whl", hash = "sha256:ac418c1db41bade2ad53ae2f3834a3a0f5ae76b56cf5aa497d2d033384fc7d73"}, + {file = "httpcore-1.0.4.tar.gz", hash = "sha256:cb2839ccfcba0d2d3c1131d3c3e26dfc327326fbe7a5dc0dbfe9f6c9151bb022"}, ] [package.dependencies] @@ -345,7 +345,7 @@ h11 = ">=0.13,<0.15" asyncio = ["anyio (>=4.0,<5.0)"] http2 = ["h2 (>=3,<5)"] socks = ["socksio (==1.*)"] -trio = ["trio (>=0.22.0,<0.23.0)"] +trio = ["trio (>=0.22.0,<0.25.0)"] [[package]] name = "httptools" @@ -421,13 +421,13 @@ socks = ["socksio (==1.*)"] [[package]] name = "identify" -version = "2.5.34" +version = "2.5.35" description = "File identification library for Python" optional = false python-versions = ">=3.8" files = [ - {file = "identify-2.5.34-py2.py3-none-any.whl", hash = "sha256:a4316013779e433d08b96e5eabb7f641e6c7942e4ab5d4c509ebd2e7a8994aed"}, - {file = "identify-2.5.34.tar.gz", hash = "sha256:ee17bc9d499899bc9eaec1ac7bf2dc9eedd480db9d88b96d123d3b64a9d34f5d"}, + {file = "identify-2.5.35-py2.py3-none-any.whl", hash = "sha256:c4de0081837b211594f8e877a6b4fad7ca32bbfc1a9307fdd61c28bfe923f13e"}, + {file = "identify-2.5.35.tar.gz", hash = "sha256:10a7ca245cfcd756a554a7288159f72ff105ad233c7c4b9c6f0f4d108f5f6791"}, ] [package.extras] @@ -457,27 +457,28 @@ files = [ [[package]] name = "jwcrypto" -version = "1.5.4" +version = "1.5.6" description = "Implementation of JOSE Web standards" optional = false python-versions = ">= 3.8" files = [ - {file = "jwcrypto-1.5.4.tar.gz", hash = "sha256:0815fbab613db99bad85691da5f136f8860423396667728a264bcfa6e1db36b0"}, + {file = "jwcrypto-1.5.6-py3-none-any.whl", hash = "sha256:150d2b0ebbdb8f40b77f543fb44ffd2baeff48788be71f67f03566692fd55789"}, + {file = "jwcrypto-1.5.6.tar.gz", hash = "sha256:771a87762a0c081ae6166958a954f80848820b2ab066937dc8b8379d65b1b039"}, ] [package.dependencies] cryptography = ">=3.4" -typing_extensions = ">=4.5.0" +typing-extensions = ">=4.5.0" [[package]] name = "minio" -version = "7.2.4" +version = "7.2.5" description = "MinIO Python SDK for Amazon S3 Compatible Cloud Storage" optional = false python-versions = "*" files = [ - {file = "minio-7.2.4-py3-none-any.whl", hash = "sha256:91b51c21d25e3ee6d51f52eab126d6c974371add0d77951e42c322a59c5533e7"}, - {file = "minio-7.2.4.tar.gz", hash = "sha256:d504d8464e5198fb74dd9b572cc88b185ae7997c17705e8c09f3fef2f439d984"}, + {file = "minio-7.2.5-py3-none-any.whl", hash = "sha256:ed9176c96d4271cb1022b9ecb8a538b1e55b32ae06add6de16425cab99ef2304"}, + {file = "minio-7.2.5.tar.gz", hash = "sha256:59d8906e2da248a9caac34d4958a859cc3a44abbe6447910c82b5abfa9d6a2e1"}, ] [package.dependencies] @@ -544,13 +545,13 @@ testing = ["pytest", "pytest-benchmark"] [[package]] name = "pre-commit" -version = "3.6.1" +version = "3.6.2" description = "A framework for managing and maintaining multi-language pre-commit hooks." optional = false python-versions = ">=3.9" files = [ - {file = "pre_commit-3.6.1-py2.py3-none-any.whl", hash = "sha256:9fe989afcf095d2c4796ce7c553cf28d4d4a9b9346de3cda079bcf40748454a4"}, - {file = "pre_commit-3.6.1.tar.gz", hash = "sha256:c90961d8aa706f75d60935aba09469a6b0bcb8345f127c3fbee4bdc5f114cf4b"}, + {file = "pre_commit-3.6.2-py2.py3-none-any.whl", hash = "sha256:ba637c2d7a670c10daedc059f5c49b5bd0aadbccfcd7ec15592cf9665117532c"}, + {file = "pre_commit-3.6.2.tar.gz", hash = "sha256:c3ef34f463045c88658c5b99f38c1e297abdcc0ff13f98d3370055fbbfabc67e"}, ] [package.dependencies] @@ -614,18 +615,18 @@ files = [ [[package]] name = "pydantic" -version = "2.6.1" +version = "2.6.3" description = "Data validation using Python type hints" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic-2.6.1-py3-none-any.whl", hash = "sha256:0b6a909df3192245cb736509a92ff69e4fef76116feffec68e93a567347bae6f"}, - {file = "pydantic-2.6.1.tar.gz", hash = "sha256:4fd5c182a2488dc63e6d32737ff19937888001e2a6d86e94b3f233104a5d1fa9"}, + {file = "pydantic-2.6.3-py3-none-any.whl", hash = "sha256:72c6034df47f46ccdf81869fddb81aade68056003900a8724a4f160700016a2a"}, + {file = "pydantic-2.6.3.tar.gz", hash = "sha256:e07805c4c7f5c6826e33a1d4c9d47950d7eaf34868e2690f8594d2e30241f11f"}, ] [package.dependencies] annotated-types = ">=0.4.0" -pydantic-core = "2.16.2" +pydantic-core = "2.16.3" typing-extensions = ">=4.6.1" [package.extras] @@ -633,90 +634,90 @@ email = ["email-validator (>=2.0.0)"] [[package]] name = "pydantic-core" -version = "2.16.2" +version = "2.16.3" description = "" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic_core-2.16.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:3fab4e75b8c525a4776e7630b9ee48aea50107fea6ca9f593c98da3f4d11bf7c"}, - {file = "pydantic_core-2.16.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8bde5b48c65b8e807409e6f20baee5d2cd880e0fad00b1a811ebc43e39a00ab2"}, - {file = "pydantic_core-2.16.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2924b89b16420712e9bb8192396026a8fbd6d8726224f918353ac19c4c043d2a"}, - {file = "pydantic_core-2.16.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:16aa02e7a0f539098e215fc193c8926c897175d64c7926d00a36188917717a05"}, - {file = "pydantic_core-2.16.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:936a787f83db1f2115ee829dd615c4f684ee48ac4de5779ab4300994d8af325b"}, - {file = "pydantic_core-2.16.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:459d6be6134ce3b38e0ef76f8a672924460c455d45f1ad8fdade36796df1ddc8"}, - {file = "pydantic_core-2.16.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4f9ee4febb249c591d07b2d4dd36ebcad0ccd128962aaa1801508320896575ef"}, - {file = "pydantic_core-2.16.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:40a0bd0bed96dae5712dab2aba7d334a6c67cbcac2ddfca7dbcc4a8176445990"}, - {file = "pydantic_core-2.16.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:870dbfa94de9b8866b37b867a2cb37a60c401d9deb4a9ea392abf11a1f98037b"}, - {file = "pydantic_core-2.16.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:308974fdf98046db28440eb3377abba274808bf66262e042c412eb2adf852731"}, - {file = "pydantic_core-2.16.2-cp310-none-win32.whl", hash = "sha256:a477932664d9611d7a0816cc3c0eb1f8856f8a42435488280dfbf4395e141485"}, - {file = "pydantic_core-2.16.2-cp310-none-win_amd64.whl", hash = "sha256:8f9142a6ed83d90c94a3efd7af8873bf7cefed2d3d44387bf848888482e2d25f"}, - {file = "pydantic_core-2.16.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:406fac1d09edc613020ce9cf3f2ccf1a1b2f57ab00552b4c18e3d5276c67eb11"}, - {file = "pydantic_core-2.16.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:ce232a6170dd6532096cadbf6185271e4e8c70fc9217ebe105923ac105da9978"}, - {file = "pydantic_core-2.16.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a90fec23b4b05a09ad988e7a4f4e081711a90eb2a55b9c984d8b74597599180f"}, - {file = "pydantic_core-2.16.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8aafeedb6597a163a9c9727d8a8bd363a93277701b7bfd2749fbefee2396469e"}, - {file = "pydantic_core-2.16.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9957433c3a1b67bdd4c63717eaf174ebb749510d5ea612cd4e83f2d9142f3fc8"}, - {file = "pydantic_core-2.16.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b0d7a9165167269758145756db43a133608a531b1e5bb6a626b9ee24bc38a8f7"}, - {file = "pydantic_core-2.16.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dffaf740fe2e147fedcb6b561353a16243e654f7fe8e701b1b9db148242e1272"}, - {file = "pydantic_core-2.16.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f8ed79883b4328b7f0bd142733d99c8e6b22703e908ec63d930b06be3a0e7113"}, - {file = "pydantic_core-2.16.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:cf903310a34e14651c9de056fcc12ce090560864d5a2bb0174b971685684e1d8"}, - {file = "pydantic_core-2.16.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:46b0d5520dbcafea9a8645a8164658777686c5c524d381d983317d29687cce97"}, - {file = "pydantic_core-2.16.2-cp311-none-win32.whl", hash = "sha256:70651ff6e663428cea902dac297066d5c6e5423fda345a4ca62430575364d62b"}, - {file = "pydantic_core-2.16.2-cp311-none-win_amd64.whl", hash = "sha256:98dc6f4f2095fc7ad277782a7c2c88296badcad92316b5a6e530930b1d475ebc"}, - {file = "pydantic_core-2.16.2-cp311-none-win_arm64.whl", hash = "sha256:ef6113cd31411eaf9b39fc5a8848e71c72656fd418882488598758b2c8c6dfa0"}, - {file = "pydantic_core-2.16.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:88646cae28eb1dd5cd1e09605680c2b043b64d7481cdad7f5003ebef401a3039"}, - {file = "pydantic_core-2.16.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7b883af50eaa6bb3299780651e5be921e88050ccf00e3e583b1e92020333304b"}, - {file = "pydantic_core-2.16.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7bf26c2e2ea59d32807081ad51968133af3025c4ba5753e6a794683d2c91bf6e"}, - {file = "pydantic_core-2.16.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:99af961d72ac731aae2a1b55ccbdae0733d816f8bfb97b41909e143de735f522"}, - {file = "pydantic_core-2.16.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:02906e7306cb8c5901a1feb61f9ab5e5c690dbbeaa04d84c1b9ae2a01ebe9379"}, - {file = "pydantic_core-2.16.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d5362d099c244a2d2f9659fb3c9db7c735f0004765bbe06b99be69fbd87c3f15"}, - {file = "pydantic_core-2.16.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ac426704840877a285d03a445e162eb258924f014e2f074e209d9b4ff7bf380"}, - {file = "pydantic_core-2.16.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b94cbda27267423411c928208e89adddf2ea5dd5f74b9528513f0358bba019cb"}, - {file = "pydantic_core-2.16.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:6db58c22ac6c81aeac33912fb1af0e930bc9774166cdd56eade913d5f2fff35e"}, - {file = "pydantic_core-2.16.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:396fdf88b1b503c9c59c84a08b6833ec0c3b5ad1a83230252a9e17b7dfb4cffc"}, - {file = "pydantic_core-2.16.2-cp312-none-win32.whl", hash = "sha256:7c31669e0c8cc68400ef0c730c3a1e11317ba76b892deeefaf52dcb41d56ed5d"}, - {file = "pydantic_core-2.16.2-cp312-none-win_amd64.whl", hash = "sha256:a3b7352b48fbc8b446b75f3069124e87f599d25afb8baa96a550256c031bb890"}, - {file = "pydantic_core-2.16.2-cp312-none-win_arm64.whl", hash = "sha256:a9e523474998fb33f7c1a4d55f5504c908d57add624599e095c20fa575b8d943"}, - {file = "pydantic_core-2.16.2-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:ae34418b6b389d601b31153b84dce480351a352e0bb763684a1b993d6be30f17"}, - {file = "pydantic_core-2.16.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:732bd062c9e5d9582a30e8751461c1917dd1ccbdd6cafb032f02c86b20d2e7ec"}, - {file = "pydantic_core-2.16.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e4b52776a2e3230f4854907a1e0946eec04d41b1fc64069ee774876bbe0eab55"}, - {file = "pydantic_core-2.16.2-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ef551c053692b1e39e3f7950ce2296536728871110e7d75c4e7753fb30ca87f4"}, - {file = "pydantic_core-2.16.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ebb892ed8599b23fa8f1799e13a12c87a97a6c9d0f497525ce9858564c4575a4"}, - {file = "pydantic_core-2.16.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:aa6c8c582036275997a733427b88031a32ffa5dfc3124dc25a730658c47a572f"}, - {file = "pydantic_core-2.16.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e4ba0884a91f1aecce75202473ab138724aa4fb26d7707f2e1fa6c3e68c84fbf"}, - {file = "pydantic_core-2.16.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:7924e54f7ce5d253d6160090ddc6df25ed2feea25bfb3339b424a9dd591688bc"}, - {file = "pydantic_core-2.16.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:69a7b96b59322a81c2203be537957313b07dd333105b73db0b69212c7d867b4b"}, - {file = "pydantic_core-2.16.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:7e6231aa5bdacda78e96ad7b07d0c312f34ba35d717115f4b4bff6cb87224f0f"}, - {file = "pydantic_core-2.16.2-cp38-none-win32.whl", hash = "sha256:41dac3b9fce187a25c6253ec79a3f9e2a7e761eb08690e90415069ea4a68ff7a"}, - {file = "pydantic_core-2.16.2-cp38-none-win_amd64.whl", hash = "sha256:f685dbc1fdadb1dcd5b5e51e0a378d4685a891b2ddaf8e2bba89bd3a7144e44a"}, - {file = "pydantic_core-2.16.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:55749f745ebf154c0d63d46c8c58594d8894b161928aa41adbb0709c1fe78b77"}, - {file = "pydantic_core-2.16.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:b30b0dd58a4509c3bd7eefddf6338565c4905406aee0c6e4a5293841411a1286"}, - {file = "pydantic_core-2.16.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:18de31781cdc7e7b28678df7c2d7882f9692ad060bc6ee3c94eb15a5d733f8f7"}, - {file = "pydantic_core-2.16.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5864b0242f74b9dd0b78fd39db1768bc3f00d1ffc14e596fd3e3f2ce43436a33"}, - {file = "pydantic_core-2.16.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b8f9186ca45aee030dc8234118b9c0784ad91a0bb27fc4e7d9d6608a5e3d386c"}, - {file = "pydantic_core-2.16.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cc6f6c9be0ab6da37bc77c2dda5f14b1d532d5dbef00311ee6e13357a418e646"}, - {file = "pydantic_core-2.16.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa057095f621dad24a1e906747179a69780ef45cc8f69e97463692adbcdae878"}, - {file = "pydantic_core-2.16.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6ad84731a26bcfb299f9eab56c7932d46f9cad51c52768cace09e92a19e4cf55"}, - {file = "pydantic_core-2.16.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:3b052c753c4babf2d1edc034c97851f867c87d6f3ea63a12e2700f159f5c41c3"}, - {file = "pydantic_core-2.16.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:e0f686549e32ccdb02ae6f25eee40cc33900910085de6aa3790effd391ae10c2"}, - {file = "pydantic_core-2.16.2-cp39-none-win32.whl", hash = "sha256:7afb844041e707ac9ad9acad2188a90bffce2c770e6dc2318be0c9916aef1469"}, - {file = "pydantic_core-2.16.2-cp39-none-win_amd64.whl", hash = "sha256:9da90d393a8227d717c19f5397688a38635afec89f2e2d7af0df037f3249c39a"}, - {file = "pydantic_core-2.16.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5f60f920691a620b03082692c378661947d09415743e437a7478c309eb0e4f82"}, - {file = "pydantic_core-2.16.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:47924039e785a04d4a4fa49455e51b4eb3422d6eaacfde9fc9abf8fdef164e8a"}, - {file = "pydantic_core-2.16.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e6294e76b0380bb7a61eb8a39273c40b20beb35e8c87ee101062834ced19c545"}, - {file = "pydantic_core-2.16.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fe56851c3f1d6f5384b3051c536cc81b3a93a73faf931f404fef95217cf1e10d"}, - {file = "pydantic_core-2.16.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9d776d30cde7e541b8180103c3f294ef7c1862fd45d81738d156d00551005784"}, - {file = "pydantic_core-2.16.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:72f7919af5de5ecfaf1eba47bf9a5d8aa089a3340277276e5636d16ee97614d7"}, - {file = "pydantic_core-2.16.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:4bfcbde6e06c56b30668a0c872d75a7ef3025dc3c1823a13cf29a0e9b33f67e8"}, - {file = "pydantic_core-2.16.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:ff7c97eb7a29aba230389a2661edf2e9e06ce616c7e35aa764879b6894a44b25"}, - {file = "pydantic_core-2.16.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:9b5f13857da99325dcabe1cc4e9e6a3d7b2e2c726248ba5dd4be3e8e4a0b6d0e"}, - {file = "pydantic_core-2.16.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:a7e41e3ada4cca5f22b478c08e973c930e5e6c7ba3588fb8e35f2398cdcc1545"}, - {file = "pydantic_core-2.16.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:60eb8ceaa40a41540b9acae6ae7c1f0a67d233c40dc4359c256ad2ad85bdf5e5"}, - {file = "pydantic_core-2.16.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7beec26729d496a12fd23cf8da9944ee338c8b8a17035a560b585c36fe81af20"}, - {file = "pydantic_core-2.16.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:22c5f022799f3cd6741e24f0443ead92ef42be93ffda0d29b2597208c94c3753"}, - {file = "pydantic_core-2.16.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:eca58e319f4fd6df004762419612122b2c7e7d95ffafc37e890252f869f3fb2a"}, - {file = "pydantic_core-2.16.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:ed957db4c33bc99895f3a1672eca7e80e8cda8bd1e29a80536b4ec2153fa9804"}, - {file = "pydantic_core-2.16.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:459c0d338cc55d099798618f714b21b7ece17eb1a87879f2da20a3ff4c7628e2"}, - {file = "pydantic_core-2.16.2.tar.gz", hash = "sha256:0ba503850d8b8dcc18391f10de896ae51d37fe5fe43dbfb6a35c5c5cad271a06"}, + {file = "pydantic_core-2.16.3-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:75b81e678d1c1ede0785c7f46690621e4c6e63ccd9192af1f0bd9d504bbb6bf4"}, + {file = "pydantic_core-2.16.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9c865a7ee6f93783bd5d781af5a4c43dadc37053a5b42f7d18dc019f8c9d2bd1"}, + {file = "pydantic_core-2.16.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:162e498303d2b1c036b957a1278fa0899d02b2842f1ff901b6395104c5554a45"}, + {file = "pydantic_core-2.16.3-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2f583bd01bbfbff4eaee0868e6fc607efdfcc2b03c1c766b06a707abbc856187"}, + {file = "pydantic_core-2.16.3-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b926dd38db1519ed3043a4de50214e0d600d404099c3392f098a7f9d75029ff8"}, + {file = "pydantic_core-2.16.3-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:716b542728d4c742353448765aa7cdaa519a7b82f9564130e2b3f6766018c9ec"}, + {file = "pydantic_core-2.16.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fc4ad7f7ee1a13d9cb49d8198cd7d7e3aa93e425f371a68235f784e99741561f"}, + {file = "pydantic_core-2.16.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:bd87f48924f360e5d1c5f770d6155ce0e7d83f7b4e10c2f9ec001c73cf475c99"}, + {file = "pydantic_core-2.16.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:0df446663464884297c793874573549229f9eca73b59360878f382a0fc085979"}, + {file = "pydantic_core-2.16.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:4df8a199d9f6afc5ae9a65f8f95ee52cae389a8c6b20163762bde0426275b7db"}, + {file = "pydantic_core-2.16.3-cp310-none-win32.whl", hash = "sha256:456855f57b413f077dff513a5a28ed838dbbb15082ba00f80750377eed23d132"}, + {file = "pydantic_core-2.16.3-cp310-none-win_amd64.whl", hash = "sha256:732da3243e1b8d3eab8c6ae23ae6a58548849d2e4a4e03a1924c8ddf71a387cb"}, + {file = "pydantic_core-2.16.3-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:519ae0312616026bf4cedc0fe459e982734f3ca82ee8c7246c19b650b60a5ee4"}, + {file = "pydantic_core-2.16.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b3992a322a5617ded0a9f23fd06dbc1e4bd7cf39bc4ccf344b10f80af58beacd"}, + {file = "pydantic_core-2.16.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8d62da299c6ecb04df729e4b5c52dc0d53f4f8430b4492b93aa8de1f541c4aac"}, + {file = "pydantic_core-2.16.3-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2acca2be4bb2f2147ada8cac612f8a98fc09f41c89f87add7256ad27332c2fda"}, + {file = "pydantic_core-2.16.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1b662180108c55dfbf1280d865b2d116633d436cfc0bba82323554873967b340"}, + {file = "pydantic_core-2.16.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e7c6ed0dc9d8e65f24f5824291550139fe6f37fac03788d4580da0d33bc00c97"}, + {file = "pydantic_core-2.16.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a6b1bb0827f56654b4437955555dc3aeeebeddc47c2d7ed575477f082622c49e"}, + {file = "pydantic_core-2.16.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e56f8186d6210ac7ece503193ec84104da7ceb98f68ce18c07282fcc2452e76f"}, + {file = "pydantic_core-2.16.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:936e5db01dd49476fa8f4383c259b8b1303d5dd5fb34c97de194560698cc2c5e"}, + {file = "pydantic_core-2.16.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:33809aebac276089b78db106ee692bdc9044710e26f24a9a2eaa35a0f9fa70ba"}, + {file = "pydantic_core-2.16.3-cp311-none-win32.whl", hash = "sha256:ded1c35f15c9dea16ead9bffcde9bb5c7c031bff076355dc58dcb1cb436c4721"}, + {file = "pydantic_core-2.16.3-cp311-none-win_amd64.whl", hash = "sha256:d89ca19cdd0dd5f31606a9329e309d4fcbb3df860960acec32630297d61820df"}, + {file = "pydantic_core-2.16.3-cp311-none-win_arm64.whl", hash = "sha256:6162f8d2dc27ba21027f261e4fa26f8bcb3cf9784b7f9499466a311ac284b5b9"}, + {file = "pydantic_core-2.16.3-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:0f56ae86b60ea987ae8bcd6654a887238fd53d1384f9b222ac457070b7ac4cff"}, + {file = "pydantic_core-2.16.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:c9bd22a2a639e26171068f8ebb5400ce2c1bc7d17959f60a3b753ae13c632975"}, + {file = "pydantic_core-2.16.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4204e773b4b408062960e65468d5346bdfe139247ee5f1ca2a378983e11388a2"}, + {file = "pydantic_core-2.16.3-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f651dd19363c632f4abe3480a7c87a9773be27cfe1341aef06e8759599454120"}, + {file = "pydantic_core-2.16.3-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:aaf09e615a0bf98d406657e0008e4a8701b11481840be7d31755dc9f97c44053"}, + {file = "pydantic_core-2.16.3-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8e47755d8152c1ab5b55928ab422a76e2e7b22b5ed8e90a7d584268dd49e9c6b"}, + {file = "pydantic_core-2.16.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:500960cb3a0543a724a81ba859da816e8cf01b0e6aaeedf2c3775d12ee49cade"}, + {file = "pydantic_core-2.16.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:cf6204fe865da605285c34cf1172879d0314ff267b1c35ff59de7154f35fdc2e"}, + {file = "pydantic_core-2.16.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:d33dd21f572545649f90c38c227cc8631268ba25c460b5569abebdd0ec5974ca"}, + {file = "pydantic_core-2.16.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:49d5d58abd4b83fb8ce763be7794d09b2f50f10aa65c0f0c1696c677edeb7cbf"}, + {file = "pydantic_core-2.16.3-cp312-none-win32.whl", hash = "sha256:f53aace168a2a10582e570b7736cc5bef12cae9cf21775e3eafac597e8551fbe"}, + {file = "pydantic_core-2.16.3-cp312-none-win_amd64.whl", hash = "sha256:0d32576b1de5a30d9a97f300cc6a3f4694c428d956adbc7e6e2f9cad279e45ed"}, + {file = "pydantic_core-2.16.3-cp312-none-win_arm64.whl", hash = "sha256:ec08be75bb268473677edb83ba71e7e74b43c008e4a7b1907c6d57e940bf34b6"}, + {file = "pydantic_core-2.16.3-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:b1f6f5938d63c6139860f044e2538baeee6f0b251a1816e7adb6cbce106a1f01"}, + {file = "pydantic_core-2.16.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:2a1ef6a36fdbf71538142ed604ad19b82f67b05749512e47f247a6ddd06afdc7"}, + {file = "pydantic_core-2.16.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:704d35ecc7e9c31d48926150afada60401c55efa3b46cd1ded5a01bdffaf1d48"}, + {file = "pydantic_core-2.16.3-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d937653a696465677ed583124b94a4b2d79f5e30b2c46115a68e482c6a591c8a"}, + {file = "pydantic_core-2.16.3-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c9803edf8e29bd825f43481f19c37f50d2b01899448273b3a7758441b512acf8"}, + {file = "pydantic_core-2.16.3-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:72282ad4892a9fb2da25defeac8c2e84352c108705c972db82ab121d15f14e6d"}, + {file = "pydantic_core-2.16.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f752826b5b8361193df55afcdf8ca6a57d0232653494ba473630a83ba50d8c9"}, + {file = "pydantic_core-2.16.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4384a8f68ddb31a0b0c3deae88765f5868a1b9148939c3f4121233314ad5532c"}, + {file = "pydantic_core-2.16.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:a4b2bf78342c40b3dc830880106f54328928ff03e357935ad26c7128bbd66ce8"}, + {file = "pydantic_core-2.16.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:13dcc4802961b5f843a9385fc821a0b0135e8c07fc3d9949fd49627c1a5e6ae5"}, + {file = "pydantic_core-2.16.3-cp38-none-win32.whl", hash = "sha256:e3e70c94a0c3841e6aa831edab1619ad5c511199be94d0c11ba75fe06efe107a"}, + {file = "pydantic_core-2.16.3-cp38-none-win_amd64.whl", hash = "sha256:ecdf6bf5f578615f2e985a5e1f6572e23aa632c4bd1dc67f8f406d445ac115ed"}, + {file = "pydantic_core-2.16.3-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:bda1ee3e08252b8d41fa5537413ffdddd58fa73107171a126d3b9ff001b9b820"}, + {file = "pydantic_core-2.16.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:21b888c973e4f26b7a96491c0965a8a312e13be108022ee510248fe379a5fa23"}, + {file = "pydantic_core-2.16.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:be0ec334369316fa73448cc8c982c01e5d2a81c95969d58b8f6e272884df0074"}, + {file = "pydantic_core-2.16.3-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b5b6079cc452a7c53dd378c6f881ac528246b3ac9aae0f8eef98498a75657805"}, + {file = "pydantic_core-2.16.3-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7ee8d5f878dccb6d499ba4d30d757111847b6849ae07acdd1205fffa1fc1253c"}, + {file = "pydantic_core-2.16.3-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7233d65d9d651242a68801159763d09e9ec96e8a158dbf118dc090cd77a104c9"}, + {file = "pydantic_core-2.16.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c6119dc90483a5cb50a1306adb8d52c66e447da88ea44f323e0ae1a5fcb14256"}, + {file = "pydantic_core-2.16.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:578114bc803a4c1ff9946d977c221e4376620a46cf78da267d946397dc9514a8"}, + {file = "pydantic_core-2.16.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:d8f99b147ff3fcf6b3cc60cb0c39ea443884d5559a30b1481e92495f2310ff2b"}, + {file = "pydantic_core-2.16.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:4ac6b4ce1e7283d715c4b729d8f9dab9627586dafce81d9eaa009dd7f25dd972"}, + {file = "pydantic_core-2.16.3-cp39-none-win32.whl", hash = "sha256:e7774b570e61cb998490c5235740d475413a1f6de823169b4cf94e2fe9e9f6b2"}, + {file = "pydantic_core-2.16.3-cp39-none-win_amd64.whl", hash = "sha256:9091632a25b8b87b9a605ec0e61f241c456e9248bfdcf7abdf344fdb169c81cf"}, + {file = "pydantic_core-2.16.3-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:36fa178aacbc277bc6b62a2c3da95226520da4f4e9e206fdf076484363895d2c"}, + {file = "pydantic_core-2.16.3-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:dcca5d2bf65c6fb591fff92da03f94cd4f315972f97c21975398bd4bd046854a"}, + {file = "pydantic_core-2.16.3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2a72fb9963cba4cd5793854fd12f4cfee731e86df140f59ff52a49b3552db241"}, + {file = "pydantic_core-2.16.3-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b60cc1a081f80a2105a59385b92d82278b15d80ebb3adb200542ae165cd7d183"}, + {file = "pydantic_core-2.16.3-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:cbcc558401de90a746d02ef330c528f2e668c83350f045833543cd57ecead1ad"}, + {file = "pydantic_core-2.16.3-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:fee427241c2d9fb7192b658190f9f5fd6dfe41e02f3c1489d2ec1e6a5ab1e04a"}, + {file = "pydantic_core-2.16.3-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f4cb85f693044e0f71f394ff76c98ddc1bc0953e48c061725e540396d5c8a2e1"}, + {file = "pydantic_core-2.16.3-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:b29eeb887aa931c2fcef5aa515d9d176d25006794610c264ddc114c053bf96fe"}, + {file = "pydantic_core-2.16.3-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:a425479ee40ff021f8216c9d07a6a3b54b31c8267c6e17aa88b70d7ebd0e5e5b"}, + {file = "pydantic_core-2.16.3-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:5c5cbc703168d1b7a838668998308018a2718c2130595e8e190220238addc96f"}, + {file = "pydantic_core-2.16.3-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:99b6add4c0b39a513d323d3b93bc173dac663c27b99860dd5bf491b240d26137"}, + {file = "pydantic_core-2.16.3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:75f76ee558751746d6a38f89d60b6228fa174e5172d143886af0f85aa306fd89"}, + {file = "pydantic_core-2.16.3-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:00ee1c97b5364b84cb0bd82e9bbf645d5e2871fb8c58059d158412fee2d33d8a"}, + {file = "pydantic_core-2.16.3-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:287073c66748f624be4cef893ef9174e3eb88fe0b8a78dc22e88eca4bc357ca6"}, + {file = "pydantic_core-2.16.3-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:ed25e1835c00a332cb10c683cd39da96a719ab1dfc08427d476bce41b92531fc"}, + {file = "pydantic_core-2.16.3-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:86b3d0033580bd6bbe07590152007275bd7af95f98eaa5bd36f3da219dcd93da"}, + {file = "pydantic_core-2.16.3.tar.gz", hash = "sha256:1cac689f80a3abab2d3c0048b29eea5751114054f032a941a32de4c852c59cad"}, ] [package.dependencies] @@ -724,19 +725,23 @@ typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" [[package]] name = "pydantic-settings" -version = "2.1.0" +version = "2.2.1" description = "Settings management using Pydantic" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic_settings-2.1.0-py3-none-any.whl", hash = "sha256:7621c0cb5d90d1140d2f0ef557bdf03573aac7035948109adf2574770b77605a"}, - {file = "pydantic_settings-2.1.0.tar.gz", hash = "sha256:26b1492e0a24755626ac5e6d715e9077ab7ad4fb5f19a8b7ed7011d52f36141c"}, + {file = "pydantic_settings-2.2.1-py3-none-any.whl", hash = "sha256:0235391d26db4d2190cb9b31051c4b46882d28a51533f97440867f012d4da091"}, + {file = "pydantic_settings-2.2.1.tar.gz", hash = "sha256:00b9f6a5e95553590434c0fa01ead0b216c3e10bc54ae02e37f359948643c5ed"}, ] [package.dependencies] pydantic = ">=2.3.0" python-dotenv = ">=0.21.0" +[package.extras] +toml = ["tomli (>=2.0.1)"] +yaml = ["pyyaml (>=6.0.1)"] + [[package]] name = "pytest" version = "7.4.4" @@ -875,29 +880,29 @@ files = [ [[package]] name = "setuptools" -version = "69.1.0" +version = "69.1.1" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "setuptools-69.1.0-py3-none-any.whl", hash = "sha256:c054629b81b946d63a9c6e732bc8b2513a7c3ea645f11d0139a2191d735c60c6"}, - {file = "setuptools-69.1.0.tar.gz", hash = "sha256:850894c4195f09c4ed30dba56213bf7c3f21d86ed6bdaafb5df5972593bfc401"}, + {file = "setuptools-69.1.1-py3-none-any.whl", hash = "sha256:02fa291a0471b3a18b2b2481ed902af520c69e8ae0919c13da936542754b4c56"}, + {file = "setuptools-69.1.1.tar.gz", hash = "sha256:5c0806c7d9af348e6dd3777b4f4dbb42c7ad85b190104837488eab9a7c945cf8"}, ] [package.extras] docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff (>=0.2.1)", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] -testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.1)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] +testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.2)", "pip (>=19.1)", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff (>=0.2.1)", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.2)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] [[package]] name = "sniffio" -version = "1.3.0" +version = "1.3.1" description = "Sniff out which async library your code is running under" optional = false python-versions = ">=3.7" files = [ - {file = "sniffio-1.3.0-py3-none-any.whl", hash = "sha256:eecefdce1e5bbfb7ad2eeaabf7c1eeb404d7757c379bd1f7e5cce9d8bf425384"}, - {file = "sniffio-1.3.0.tar.gz", hash = "sha256:e60305c5e5d314f5389259b7f22aaa33d8f7dee49763119234af3755c55b9101"}, + {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"}, + {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, ] [[package]] @@ -930,24 +935,24 @@ files = [ [[package]] name = "typing-extensions" -version = "4.9.0" +version = "4.10.0" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" files = [ - {file = "typing_extensions-4.9.0-py3-none-any.whl", hash = "sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd"}, - {file = "typing_extensions-4.9.0.tar.gz", hash = "sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783"}, + {file = "typing_extensions-4.10.0-py3-none-any.whl", hash = "sha256:69b1a937c3a517342112fb4c6df7e72fc39a38e7891a5730ed4985b5214b5475"}, + {file = "typing_extensions-4.10.0.tar.gz", hash = "sha256:b0abd7c89e8fb96f98db18d86106ff1d90ab692004eb746cf6eda2682f91b3cb"}, ] [[package]] name = "urllib3" -version = "2.2.0" +version = "2.2.1" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = ">=3.8" files = [ - {file = "urllib3-2.2.0-py3-none-any.whl", hash = "sha256:ce3711610ddce217e6d113a2732fafad960a03fd0318c91faa79481e35c11224"}, - {file = "urllib3-2.2.0.tar.gz", hash = "sha256:051d961ad0c62a94e50ecf1af379c3aba230c66c710493493560c0c223c49f20"}, + {file = "urllib3-2.2.1-py3-none-any.whl", hash = "sha256:450b20ec296a467077128bff42b73080516e71b56ff59a60a02bef2232c4fa9d"}, + {file = "urllib3-2.2.1.tar.gz", hash = "sha256:d0570876c61ab9e520d776c38acbbb5b05a776d3f9ff98a5c8fd5162a444cf19"}, ] [package.extras] @@ -1028,13 +1033,13 @@ test = ["Cython (>=0.29.36,<0.30.0)", "aiohttp (==3.9.0b0)", "aiohttp (>=3.8.1)" [[package]] name = "virtualenv" -version = "20.25.0" +version = "20.25.1" description = "Virtual Python Environment builder" optional = false python-versions = ">=3.7" files = [ - {file = "virtualenv-20.25.0-py3-none-any.whl", hash = "sha256:4238949c5ffe6876362d9c0180fc6c3a824a7b12b80604eeb8085f2ed7460de3"}, - {file = "virtualenv-20.25.0.tar.gz", hash = "sha256:bf51c0d9c7dd63ea8e44086fa1e4fb1093a31e963b86959257378aef020e1f1b"}, + {file = "virtualenv-20.25.1-py3-none-any.whl", hash = "sha256:961c026ac520bac5f69acb8ea063e8a4f071bcc9457b9c1f28f6b085c511583a"}, + {file = "virtualenv-20.25.1.tar.gz", hash = "sha256:e08e13ecdca7a0bd53798f356d5831434afa5b07b93f0abdf0797b7a06ffe197"}, ] [package.dependencies] @@ -1217,4 +1222,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "04b7d23848bfc6cb2ff336fbdee6d74e4741947d3f01523b40177fd42b1e786b" +content-hash = "86001e87854a6a7dc6824299d474fe3aff66dba603a71b36ee25945505fb6abf" diff --git a/project/config.py b/project/config.py index dbb0f8b..a15842b 100644 --- a/project/config.py +++ b/project/config.py @@ -23,9 +23,18 @@ class OIDCConfig(BaseModel): model_config = ConfigDict(frozen=True) +class HubConfig(BaseModel): + api_base_url: HttpUrl = "https://api.privateaim.net" + auth_base_url: HttpUrl = "https://auth.privateaim.net" + auth_username: str + auth_password: str + + model_config = ConfigDict(frozen=True) + + class Settings(BaseSettings): + hub: HubConfig minio: MinioBucketConfig - remote: MinioBucketConfig oidc: OIDCConfig model_config = SettingsConfigDict( diff --git a/project/dependencies.py b/project/dependencies.py index d9f2612..a309a12 100644 --- a/project/dependencies.py +++ b/project/dependencies.py @@ -1,5 +1,6 @@ import json import logging +import time from functools import lru_cache from typing import Annotated @@ -12,10 +13,15 @@ from starlette import status from project.config import Settings, MinioBucketConfig +from project.hub import AccessToken, AuthWrapper security = HTTPBearer() logger = logging.getLogger(__name__) +# TODO this doesn't consider the fact that an access token may be invalidated for any reason other than expiration +_access_token: AccessToken | None = None +_access_token_retrieved_at: int + @lru_cache def get_settings(): @@ -56,12 +62,6 @@ def get_local_minio( return __create_minio_from_config(settings.minio) -def get_remote_minio( - settings: Annotated[Settings, Depends(get_settings)], -): - return __create_minio_from_config(settings.remote) - - def get_client_id( settings: Annotated[Settings, Depends(get_settings)], jwks: Annotated[jwk.JWKSet, Depends(get_auth_jwks)], @@ -87,3 +87,34 @@ def get_client_id( raise HTTPException( status_code=status.HTTP_403_FORBIDDEN, detail="JWT is malformed" ) + + +def __obtain_new_access_token(auth: AuthWrapper, username: str, password: str): + global _access_token, _access_token_retrieved_at + + _access_token = auth.acquire_access_token_with_password(username, password) + _access_token_retrieved_at = int(time.time()) + + +def get_auth_wrapper(settings: Annotated[Settings, Depends(get_settings)]): + return AuthWrapper(str(settings.hub.auth_base_url)) + + +def get_access_token( + settings: Annotated[Settings, Depends(get_settings)], + auth_wrapper: Annotated[AuthWrapper, Depends(get_auth_wrapper)], +) -> AccessToken: + global _access_token, _access_token_retrieved_at + + if _access_token is None: + __obtain_new_access_token( + auth_wrapper, settings.hub.auth_username, settings.hub.auth_password + ) + + # TODO configurable leeway? + if int(time.time()) < _access_token_retrieved_at - 3600: + __obtain_new_access_token( + auth_wrapper, settings.hub.auth_username, settings.hub.auth_password + ) + + return _access_token diff --git a/project/hub.py b/project/hub.py new file mode 100644 index 0000000..22356a2 --- /dev/null +++ b/project/hub.py @@ -0,0 +1,221 @@ +from io import BytesIO +from typing import NamedTuple +from urllib.parse import urljoin + +import httpx +from starlette import status + + +class AccessToken(NamedTuple): + access_token: str + expires_in: int + token_type: str + scope: str + refresh_token: str + + +class Project(NamedTuple): + id: str + name: str + + +class Analysis(NamedTuple): + id: str + name: str + + +class BucketFile(NamedTuple): + id: str + name: str + bucket_id: str + + +class AnalysisFile(NamedTuple): + id: str + name: str + type: str + bucket_file_id: str + + +class Bucket(NamedTuple): + id: str + name: str + + +class AuthWrapper: + """Simple wrapper around the password-based token grant of the central AuthUp instance.""" + + def __init__(self, base_url: str): + self.base_url = base_url + + def acquire_access_token_with_password( + self, username: str, password: str + ) -> AccessToken: + """Acquire an access token using the given username and password.""" + r = httpx.post( + urljoin(self.base_url, "/token"), + json={ + "grant_type": "password", + "username": username, + "password": password, + }, + ).raise_for_status() + j = r.json() + + return AccessToken( + access_token=j["access_token"], + expires_in=j["expires_in"], + token_type=j["token_type"], + scope=j["scope"], + refresh_token=j["refresh_token"], + ) + + +class ApiWrapper: + """Simple wrapper around the central hub API. The wrapper does NOT check the access token validity.""" + + def __init__(self, base_url: str, access_token: str): + self.base_url = base_url + self.access_token = access_token + + def __auth_header(self): + return {"Authorization": f"Bearer {self.access_token}"} + + def create_project(self, name: str) -> Project: + """Create a project with the given name.""" + r = httpx.post( + urljoin(self.base_url, "/projects"), + headers=self.__auth_header(), + json={"name": name}, + ).raise_for_status() + j = r.json() + + return Project( + id=j["id"], + name=j["name"], + ) + + def create_analysis(self, name: str, project_id: str) -> Analysis: + """Create an analysis with the given name and assign it to the given project.""" + r = httpx.post( + urljoin(self.base_url, "/analyses"), + headers=self.__auth_header(), + json={ + "name": name, + "project_id": project_id, + }, + ).raise_for_status() + j = r.json() + + return Analysis( + id=j["id"], + name=j["name"], + ) + + def get_bucket(self, bucket_name: str) -> Bucket | None: + """Get the bucket associated with the given name.""" + r = httpx.get( + urljoin(self.base_url, f"/storage/buckets/{bucket_name}"), + headers=self.__auth_header(), + ) + + if r.status_code == status.HTTP_404_NOT_FOUND: + return None + + # catch any other unexpected status + r.raise_for_status() + j = r.json() + + return Bucket( + id=j["id"], + name=j["name"], + ) + + def get_bucket_file(self, bucket_file_id: str) -> BucketFile | None: + """Get the file associated with the given bucket file ID.""" + r = httpx.get( + urljoin(self.base_url, f"/storage/bucket-files/{bucket_file_id}"), + headers=self.__auth_header(), + ).raise_for_status() + + if r.status_code == status.HTTP_404_NOT_FOUND: + return None + + r.raise_for_status() + j = r.json() + + return BucketFile( + id=j["id"], + name=j["name"], + bucket_id=j["bucket_id"], + ) + + def upload_to_bucket( + self, + bucket_name: str, + file_name: str, + file: BytesIO, + content_type: str = "application/octet-stream", + ) -> list[BucketFile]: + """Upload a file to the bucket associated with the given name. Content type is optional and is set + to application/octet-stream by default.""" + r = httpx.post( + urljoin(self.base_url, f"/storage/buckets/{bucket_name}/upload"), + headers=self.__auth_header(), + files={ + "file": (file_name, file, content_type), + }, + ).raise_for_status() + j = r.json() + + return [ + BucketFile( + id=b["id"], + name=b["name"], + bucket_id=b["bucket_id"], + ) + for b in j["data"] + ] + + def link_file_to_analysis( + self, analysis_id: str, bucket_file_id: str, bucket_file_name: str + ) -> AnalysisFile: + """Link the file associated with the given ID and name to the analysis associated with the given ID. + Currently, this function only supports linking result files.""" + r = httpx.post( + urljoin(self.base_url, "/analysis-files"), + headers=self.__auth_header(), + json={ + "analysis_id": analysis_id, + "type": "RESULT", + "bucket_file_id": bucket_file_id, + "name": bucket_file_name, + "root": True, + }, + ).raise_for_status() + j = r.json() + + return AnalysisFile( + id=j["id"], + name=j["name"], + type=j["type"], + bucket_file_id=j["bucket_file_id"], + ) + + def get_analysis_files(self) -> list[AnalysisFile]: + """List all analysis files.""" + r = httpx.get( + urljoin(self.base_url, "/analysis-files"), + headers=self.__auth_header(), + ).raise_for_status() + j = r.json() + + return [ + AnalysisFile( + id=f["id"], + name=f["name"], + type=f["type"], + bucket_file_id=f["bucket_file_id"], + ) + for f in j["data"] + ] diff --git a/project/routers/upload.py b/project/routers/upload.py index 0f30bd8..b8ec969 100644 --- a/project/routers/upload.py +++ b/project/routers/upload.py @@ -4,7 +4,7 @@ from typing import Annotated from fastapi import APIRouter, Depends, UploadFile, BackgroundTasks -from minio import Minio, S3Error +from minio import Minio from starlette import status from project.config import Settings @@ -12,53 +12,53 @@ get_local_minio, get_settings, get_client_id, - get_remote_minio, + get_access_token, ) +from project.hub import ApiWrapper, AccessToken router = APIRouter() logger = logging.getLogger(__name__) async def __bg_upload_to_remote( - remote_minio: Minio, - remote_bucket_name: str, - local_minio: Minio, - local_bucket_name: str, + minio: Minio, + bucket_name: str, object_name: str, + api: ApiWrapper, + client_id: str, ): - max_attempts = 3 # TODO: should be configurable + logger.info( + "__bg_upload_to_remote: bucket `%s`, object `%s`", + bucket_name, + object_name, + ) - for i in range(max_attempts): - logger.info( - "__bg_upload_to_remote: bucket `%s`, object `%s` (attempt: %d)", - local_bucket_name, + minio_resp = None + + try: + # fetch from local minio + minio_resp = minio.get_object(bucket_name, object_name) + # upload to remote + bucket_file_lst = api.upload_to_bucket( + f"analysis-result-files.{client_id}", object_name, - i + 1, + io.BytesIO(minio_resp.data), + minio_resp.headers.get("Content-Type", "application/octet-stream"), ) - r = None - - try: - r = local_minio.get_object(local_bucket_name, object_name) - remote_minio.put_object( - remote_bucket_name, - object_name, - io.BytesIO(r.data), - length=-1, - content_type=r.headers.get("Content-Type", "application/octet-stream"), - part_size=10 * 1024 * 1024, - ) - local_minio.remove_object(local_bucket_name, object_name) - - return - except S3Error: - logger.exception("Failed to upload object to remote") - finally: - if r is not None: - r.close() - r.release_conn() - - logger.error("Failed to upload `%s` to remote after %d attempts", object_name) + # check that only one file has been submitted + assert len(bucket_file_lst) == 1 + # fetch file s.t. it can be linked + bucket_file = bucket_file_lst[0] + # link file to analysis + api.link_file_to_analysis(client_id, bucket_file.id, bucket_file.name) + # remove from local minio + minio.remove_object(bucket_name, object_name) + finally: + # docs are wrong here. resp could be uninitialized so this is a necessary check. + if minio_resp is not None: + minio_resp.close() + minio_resp.release_conn() @router.put( @@ -71,7 +71,7 @@ async def upload_to_remote( background_tasks: BackgroundTasks, settings: Annotated[Settings, Depends(get_settings)], local_minio: Annotated[Minio, Depends(get_local_minio)], - remote_minio: Annotated[Minio, Depends(get_remote_minio)], + api_access_token: Annotated[AccessToken, Depends(get_access_token)], ): object_id = str(uuid.uuid4()) object_name = f"upload/{client_id}/{object_id}" @@ -84,11 +84,13 @@ async def upload_to_remote( content_type=file.content_type or "application/octet-stream", ) + api = ApiWrapper(str(settings.hub.api_base_url), api_access_token.access_token) + background_tasks.add_task( __bg_upload_to_remote, - remote_minio, - settings.remote.bucket, local_minio, settings.minio.bucket, object_name, + api, + client_id, ) diff --git a/pyproject.toml b/pyproject.toml index f748356..ec64404 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ uvicorn = { extras = ["standard"], version = "^0.27.0" } pydantic-settings = "^2.1.0" python-multipart = "^0.0.9" click = "^8.1.7" -jwcrypto = "^1.5.4" +jwcrypto = "^1.5.6" httpx = "^0.26.0" [tool.poetry.group.dev.dependencies] diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..10153ce --- /dev/null +++ b/pytest.ini @@ -0,0 +1,4 @@ +[pytest] +addopts = -m "not live" +markers = + live: mark an integration test that runs against live infra. diff --git a/tests/common/env.py b/tests/common/env.py index a0c9e16..0db3de4 100644 --- a/tests/common/env.py +++ b/tests/common/env.py @@ -10,6 +10,15 @@ def __get_env(env_name: str, val_def: str | None = None) -> str: return val +PYTEST_HUB_API_BASE_URL = __get_env( + "PYTEST__HUB__API_BASE_URL", "https://api.privateaim.net" +) +PYTEST_HUB_AUTH_BASE_URL = __get_env( + "PYTEST__HUB__AUTH_BASE_URL", "https://auth.privateaim.net" +) +PYTEST_HUB_AUTH_USERNAME = __get_env("PYTEST__HUB__AUTH_USERNAME") +PYTEST_HUB_AUTH_PASSWORD = __get_env("PYTEST__HUB__AUTH_PASSWORD") + PYTEST_OIDC_CERTS_URL = __get_env( "PYTEST__OIDC__CERTS_URL", "http://localhost:8001/.well-known/jwks.json" ) @@ -17,20 +26,11 @@ def __get_env(env_name: str, val_def: str | None = None) -> str: "PYTEST__OIDC__CLIENT_ID_CLAIM_NAME", "client_id" ) -PYTEST_LOCAL_MINIO_ENDPOINT = __get_env("PYTEST__MINIO__ENDPOINT") -PYTEST_LOCAL_MINIO_ACCESS_KEY = __get_env("PYTEST__MINIO__ACCESS_KEY") -PYTEST_LOCAL_MINIO_SECRET_KEY = __get_env("PYTEST__MINIO__SECRET_KEY") -PYTEST_LOCAL_MINIO_REGION = __get_env("PYTEST__MINIO__REGION", "us-east-1") -PYTEST_LOCAL_MINIO_BUCKET = __get_env("PYTEST__MINIO__BUCKET") -PYTEST_LOCAL_MINIO_USE_SSL = __get_env("PYTEST__MINIO__USE_SSL", "0") - -PYTEST_REMOTE_MINIO_ENDPOINT = __get_env("PYTEST__REMOTE__ENDPOINT") -PYTEST_REMOTE_MINIO_ACCESS_KEY = __get_env("PYTEST__REMOTE__ACCESS_KEY") -PYTEST_REMOTE_MINIO_SECRET_KEY = __get_env("PYTEST__REMOTE__SECRET_KEY") -PYTEST_REMOTE_MINIO_REGION = __get_env("PYTEST__REMOTE__REGION", "us-east-1") -PYTEST_REMOTE_MINIO_BUCKET = __get_env("PYTEST__REMOTE__BUCKET") -PYTEST_REMOTE_MINIO_USE_SSL = __get_env("PYTEST__REMOTE__USE_SSL", "0") - -PYTEST_REMOTE_VALIDATE_UPLOAD_MAX_ATTEMPTS = __get_env( - "PYTEST__REMOTE__VALIDATE_UPLOAD_MAX_ATTEMPTS", "5" -) +PYTEST_MINIO_ENDPOINT = __get_env("PYTEST__MINIO__ENDPOINT") +PYTEST_MINIO_ACCESS_KEY = __get_env("PYTEST__MINIO__ACCESS_KEY") +PYTEST_MINIO_SECRET_KEY = __get_env("PYTEST__MINIO__SECRET_KEY") +PYTEST_MINIO_REGION = __get_env("PYTEST__MINIO__REGION", "us-east-1") +PYTEST_MINIO_BUCKET = __get_env("PYTEST__MINIO__BUCKET") +PYTEST_MINIO_USE_SSL = __get_env("PYTEST__MINIO__USE_SSL", "0") + +PYTEST_ASYNC_MAX_RETRIES = __get_env("PYTEST__ASYNC_MAX_RETRIES", "10") diff --git a/tests/common/helpers.py b/tests/common/helpers.py new file mode 100644 index 0000000..6943b55 --- /dev/null +++ b/tests/common/helpers.py @@ -0,0 +1,46 @@ +import random +import time +import uuid +from typing import Callable + +from tests.common.env import PYTEST_ASYNC_MAX_RETRIES + + +def eventually(predicate: Callable[[], bool]) -> bool: + """Return True if the predicate passed into this function returns True after a set amount of attempts. + Between each attempt there is a delay of one second. The amount of retries can be configured with the + PYTEST__ASYNC_MAX_RETRIES environment variable.""" + max_retries = int(PYTEST_ASYNC_MAX_RETRIES) + + for _ in range(max_retries): + if not predicate(): + time.sleep(1) + + return True + + return False + + +def next_uuid(): + """Get random UUID as string.""" + return str(uuid.uuid4()) + + +def next_prefixed_name(): + """Get random UUID prefixed with 'node-it-'.""" + return f"node-it-{next_uuid()}" + + +def is_valid_uuid(val: str): + """Return True if the value provided can be parsed into a valid UUID.""" + try: + uuid.UUID(val) + except ValueError: + return False + + return True + + +def next_random_bytes(rng: random.Random, n: int = 16): + """Return a bytes object with random content. (default length: 16)""" + return rng.randbytes(n) diff --git a/tests/common/rest.py b/tests/common/rest.py index e63e798..efa7d7c 100644 --- a/tests/common/rest.py +++ b/tests/common/rest.py @@ -1,5 +1,4 @@ import io -import random from httpx import Response @@ -9,11 +8,6 @@ def detail_of(r: Response) -> str: return r.json()["detail"] -def next_random_bytes(rng: random.Random, n: int = 16): - """Return a bytes object with random content. (default length: 16)""" - return rng.randbytes(n) - - def wrap_bytes_for_request(b: bytes): """Wrap a bytes object into a dictionary s.t. it can be passed into a httpx request.""" return {"file": io.BytesIO(b)} diff --git a/tests/conftest.py b/tests/conftest.py index de5da51..96d0794 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -5,48 +5,45 @@ import pytest from jwcrypto import jwk -from minio import Minio from starlette.testclient import TestClient -from project.config import Settings, MinioBucketConfig, OIDCConfig +from project.config import Settings, MinioBucketConfig, OIDCConfig, HubConfig from project.dependencies import get_settings +from project.hub import AuthWrapper, ApiWrapper from project.server import app from tests.common.auth import get_oid_test_jwk from tests.common.env import ( PYTEST_OIDC_CERTS_URL, - PYTEST_LOCAL_MINIO_ENDPOINT, - PYTEST_LOCAL_MINIO_ACCESS_KEY, - PYTEST_LOCAL_MINIO_SECRET_KEY, - PYTEST_LOCAL_MINIO_REGION, - PYTEST_LOCAL_MINIO_USE_SSL, - PYTEST_LOCAL_MINIO_BUCKET, + PYTEST_MINIO_ENDPOINT, + PYTEST_MINIO_ACCESS_KEY, + PYTEST_MINIO_SECRET_KEY, + PYTEST_MINIO_REGION, + PYTEST_MINIO_USE_SSL, + PYTEST_MINIO_BUCKET, PYTEST_OIDC_CLIENT_ID_CLAIM_NAME, - PYTEST_REMOTE_MINIO_ENDPOINT, - PYTEST_REMOTE_MINIO_ACCESS_KEY, - PYTEST_REMOTE_MINIO_SECRET_KEY, - PYTEST_REMOTE_MINIO_REGION, - PYTEST_REMOTE_MINIO_USE_SSL, - PYTEST_REMOTE_MINIO_BUCKET, + PYTEST_HUB_AUTH_BASE_URL, + PYTEST_HUB_AUTH_USERNAME, + PYTEST_HUB_AUTH_PASSWORD, + PYTEST_HUB_API_BASE_URL, ) +from tests.common.helpers import eventually, next_prefixed_name, is_valid_uuid def __get_settings_override() -> Settings: return Settings( - minio=MinioBucketConfig( - endpoint=PYTEST_LOCAL_MINIO_ENDPOINT, - access_key=PYTEST_LOCAL_MINIO_ACCESS_KEY, - secret_key=PYTEST_LOCAL_MINIO_SECRET_KEY, - region=PYTEST_LOCAL_MINIO_REGION, - use_ssl=PYTEST_LOCAL_MINIO_USE_SSL, - bucket=PYTEST_LOCAL_MINIO_BUCKET, + hub=HubConfig( + api_base_url=PYTEST_HUB_API_BASE_URL, + auth_base_url=PYTEST_HUB_AUTH_BASE_URL, + auth_username=PYTEST_HUB_AUTH_USERNAME, + auth_password=PYTEST_HUB_AUTH_PASSWORD, ), - remote=MinioBucketConfig( - endpoint=PYTEST_REMOTE_MINIO_ENDPOINT, - access_key=PYTEST_REMOTE_MINIO_ACCESS_KEY, - secret_key=PYTEST_REMOTE_MINIO_SECRET_KEY, - region=PYTEST_REMOTE_MINIO_REGION, - use_ssl=PYTEST_REMOTE_MINIO_USE_SSL, - bucket=PYTEST_REMOTE_MINIO_BUCKET, + minio=MinioBucketConfig( + endpoint=PYTEST_MINIO_ENDPOINT, + access_key=PYTEST_MINIO_ACCESS_KEY, + secret_key=PYTEST_MINIO_SECRET_KEY, + region=PYTEST_MINIO_REGION, + use_ssl=PYTEST_MINIO_USE_SSL, + bucket=PYTEST_MINIO_BUCKET, ), oidc=OIDCConfig( certs_url=PYTEST_OIDC_CERTS_URL, @@ -69,17 +66,6 @@ def test_client(test_app): yield test_client -@pytest.fixture(scope="package") -def remote_minio(): - return Minio( - endpoint=PYTEST_REMOTE_MINIO_ENDPOINT, - access_key=PYTEST_REMOTE_MINIO_ACCESS_KEY, - secret_key=PYTEST_REMOTE_MINIO_SECRET_KEY, - region=PYTEST_REMOTE_MINIO_REGION, - secure=PYTEST_REMOTE_MINIO_USE_SSL != "0", - ), PYTEST_REMOTE_MINIO_BUCKET - - @pytest.fixture(scope="package", autouse=True) def setup_jwks_endpoint(): jwks = jwk.JWKSet() @@ -104,6 +90,53 @@ def do_GET(self): httpd.shutdown() -@pytest.fixture +@pytest.fixture(scope="package") def rng(): return random.Random(727) + + +@pytest.fixture(scope="package") +def hub_access_token(): + return ( + AuthWrapper(PYTEST_HUB_AUTH_BASE_URL) + .acquire_access_token_with_password( + PYTEST_HUB_AUTH_USERNAME, PYTEST_HUB_AUTH_PASSWORD + ) + .access_token + ) + + +@pytest.fixture(scope="package") +def api(hub_access_token): + return ApiWrapper(PYTEST_HUB_API_BASE_URL, hub_access_token) + + +@pytest.fixture(scope="package") +def analysis_id(api, rng): + project_name = next_prefixed_name() + project = api.create_project(project_name) + + assert project.name == project_name + assert is_valid_uuid(project.id) + + analysis_name = next_prefixed_name() + analysis = api.create_analysis(analysis_name, project.id) + + assert analysis.name == analysis_name + assert is_valid_uuid(analysis.id) + + for bucket_type in ("result", "code", "temp"): + + def __bucket_exists(): + bucket_name = f"analysis-{bucket_type}-files.{analysis.id}" + bucket = api.get_bucket(bucket_name) + + if bucket is None: + return False + + assert bucket.name == bucket_name + assert is_valid_uuid(bucket.id) + + assert eventually(__bucket_exists) + + yield analysis.id diff --git a/tests/test_hub.py b/tests/test_hub.py new file mode 100644 index 0000000..b0558b2 --- /dev/null +++ b/tests/test_hub.py @@ -0,0 +1,40 @@ +from io import BytesIO + +import pytest + +from tests.common.helpers import next_prefixed_name, is_valid_uuid, next_random_bytes + +pytestmark = pytest.mark.live + + +def test_upload_to_bucket(api, rng, analysis_id): + # 1) upload file with random name to bucket + result_bucket_name = f"analysis-result-files.{analysis_id}" + file_name = next_prefixed_name() + bucket_file_lst = api.upload_to_bucket( + result_bucket_name, file_name, BytesIO(next_random_bytes(rng)) + ) + + # 2) check that the endpoint returned a single file + assert len(bucket_file_lst) == 1 + + # 3) check that the file matches the uploaded file + bucket_file = bucket_file_lst[0] + + assert bucket_file.name == file_name + assert is_valid_uuid(bucket_file.id) + + # 4) link uploaded file to analysis + analysis_file = api.link_file_to_analysis( + analysis_id, bucket_file.id, bucket_file.name + ) + + assert analysis_file.name == bucket_file.name + assert is_valid_uuid(analysis_file.id) + assert analysis_file.type == "RESULT" + assert analysis_file.bucket_file_id == bucket_file.id + + # 5) check that uploaded file appears in list of analysis files + analysis_file_list = api.get_analysis_files() + + assert analysis_file.id in [f.id for f in analysis_file_list] diff --git a/tests/test_scratch.py b/tests/test_scratch.py index 7f467d0..8907f9b 100644 --- a/tests/test_scratch.py +++ b/tests/test_scratch.py @@ -5,7 +5,8 @@ from project.routers.scratch import ScratchUploadResponse from tests.common.auth import BearerAuth, issue_client_access_token -from tests.common.rest import next_random_bytes, wrap_bytes_for_request, detail_of +from tests.common.helpers import next_random_bytes +from tests.common.rest import wrap_bytes_for_request, detail_of def test_200_submit_receive_from_scratch(test_client, rng): diff --git a/tests/test_upload.py b/tests/test_upload.py index 8335f7b..f542cee 100644 --- a/tests/test_upload.py +++ b/tests/test_upload.py @@ -1,43 +1,27 @@ -import time - -from minio import Minio +import pytest from starlette import status -from tests.common.auth import BearerAuth, issue_client_access_token -from tests.common.env import PYTEST_REMOTE_VALIDATE_UPLOAD_MAX_ATTEMPTS -from tests.common.rest import next_random_bytes, wrap_bytes_for_request +from tests.common.auth import issue_client_access_token, BearerAuth +from tests.common.helpers import eventually, next_random_bytes +from tests.common.rest import wrap_bytes_for_request +pytestmark = pytest.mark.live -def __count_bucket_objects(minio: Minio, bucket_name: str) -> int: - return sum(1 for _ in minio.list_objects(bucket_name, recursive=True)) +def test_200_submit_to_upload(test_client, rng, api, analysis_id): + analysis_file_count_old = len(api.get_analysis_files()) -def test_204_submit_to_upload(test_client, rng, remote_minio): - minio, bucket_name = remote_minio blob = next_random_bytes(rng) - - old_remote_obj_count = __count_bucket_objects(minio, bucket_name) - r = test_client.put( "/upload", - auth=BearerAuth(issue_client_access_token()), + auth=BearerAuth(issue_client_access_token(analysis_id)), files=wrap_bytes_for_request(blob), ) assert r.status_code == status.HTTP_204_NO_CONTENT - # since the actual upload to the remote server is deferred, the object might not - # be instantly available on remote. therefore we allow some leeway with some extra attempts. - max_attempts = int(PYTEST_REMOTE_VALIDATE_UPLOAD_MAX_ATTEMPTS) - - for _ in range(max_attempts): - new_remote_obj_count = __count_bucket_objects(minio, bucket_name) + def __check_analysis_file_count_increases(): + analysis_file_count_new = len(api.get_analysis_files()) + return analysis_file_count_new > analysis_file_count_old - if new_remote_obj_count == old_remote_obj_count + 1: - return - - time.sleep(1) - - raise AssertionError( - f"failed to verify successful upload after {max_attempts} attempts" - ) + assert eventually(__check_analysis_file_count_increases)