From 295ecf79487692b934885ae000b5449e9e3a7c04 Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Thu, 3 Apr 2025 16:09:34 +0300 Subject: [PATCH 01/21] Intial commit for adding support for other authentication strategies --- poetry.lock | 161 +++++++- pyproject.toml | 3 +- zitadel_client/api_client.py | 340 ++++++----------- zitadel_client/api_response.py | 25 +- zitadel_client/auth/__init__.py | 0 zitadel_client/auth/authenticator.py | 65 ++++ zitadel_client/auth/client_credentials.py | 49 +++ zitadel_client/auth/jwt_auth.py | 121 ++++++ zitadel_client/auth/no_auth.py | 42 ++ zitadel_client/auth/oauth_base.py | 57 +++ zitadel_client/auth/personal_access.py | 43 +++ zitadel_client/configuration.py | 411 ++------------------ zitadel_client/exceptions.py | 323 ++++++++-------- zitadel_client/rest.py | 443 +++++++++++----------- zitadel_client/zitadel.py | 103 +++-- 15 files changed, 1127 insertions(+), 1059 deletions(-) create mode 100644 zitadel_client/auth/__init__.py create mode 100644 zitadel_client/auth/authenticator.py create mode 100644 zitadel_client/auth/client_credentials.py create mode 100644 zitadel_client/auth/jwt_auth.py create mode 100644 zitadel_client/auth/no_auth.py create mode 100644 zitadel_client/auth/oauth_base.py create mode 100644 zitadel_client/auth/personal_access.py diff --git a/poetry.lock b/poetry.lock index 5d29b2cb..81ddf82f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -15,6 +15,21 @@ files = [ [package.dependencies] typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""} +[[package]] +name = "authlib" +version = "1.3.2" +description = "The ultimate Python library in building OAuth and OpenID Connect servers and clients." +optional = false +python-versions = ">=3.8" +groups = ["main"] +files = [ + {file = "Authlib-1.3.2-py2.py3-none-any.whl", hash = "sha256:ede026a95e9f5cdc2d4364a52103f5405e75aa156357e831ef2bfd0bc5094dfc"}, + {file = "authlib-1.3.2.tar.gz", hash = "sha256:4b16130117f9eb82aa6eec97f6dd4673c3f960ac0283ccdae2897ee4bc030ba2"}, +] + +[package.dependencies] +cryptography = "*" + [[package]] name = "cachetools" version = "5.5.2" @@ -27,6 +42,87 @@ files = [ {file = "cachetools-5.5.2.tar.gz", hash = "sha256:1a661caa9175d26759571b2e19580f9d6393969e5dfca11fdb1f947a23e640d4"}, ] +[[package]] +name = "cffi" +version = "1.17.1" +description = "Foreign Function Interface for Python calling C code." +optional = false +python-versions = ">=3.8" +groups = ["main"] +markers = "platform_python_implementation != \"PyPy\"" +files = [ + {file = "cffi-1.17.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:df8b1c11f177bc2313ec4b2d46baec87a5f3e71fc8b45dab2ee7cae86d9aba14"}, + {file = "cffi-1.17.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8f2cdc858323644ab277e9bb925ad72ae0e67f69e804f4898c070998d50b1a67"}, + {file = "cffi-1.17.1-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:edae79245293e15384b51f88b00613ba9f7198016a5948b5dddf4917d4d26382"}, + {file = "cffi-1.17.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:45398b671ac6d70e67da8e4224a065cec6a93541bb7aebe1b198a61b58c7b702"}, + {file = "cffi-1.17.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ad9413ccdeda48c5afdae7e4fa2192157e991ff761e7ab8fdd8926f40b160cc3"}, + {file = "cffi-1.17.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5da5719280082ac6bd9aa7becb3938dc9f9cbd57fac7d2871717b1feb0902ab6"}, + {file = "cffi-1.17.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2bb1a08b8008b281856e5971307cc386a8e9c5b625ac297e853d36da6efe9c17"}, + {file = "cffi-1.17.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:045d61c734659cc045141be4bae381a41d89b741f795af1dd018bfb532fd0df8"}, + {file = "cffi-1.17.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:6883e737d7d9e4899a8a695e00ec36bd4e5e4f18fabe0aca0efe0a4b44cdb13e"}, + {file = "cffi-1.17.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:6b8b4a92e1c65048ff98cfe1f735ef8f1ceb72e3d5f0c25fdb12087a23da22be"}, + {file = "cffi-1.17.1-cp310-cp310-win32.whl", hash = "sha256:c9c3d058ebabb74db66e431095118094d06abf53284d9c81f27300d0e0d8bc7c"}, + {file = "cffi-1.17.1-cp310-cp310-win_amd64.whl", hash = "sha256:0f048dcf80db46f0098ccac01132761580d28e28bc0f78ae0d58048063317e15"}, + {file = "cffi-1.17.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:a45e3c6913c5b87b3ff120dcdc03f6131fa0065027d0ed7ee6190736a74cd401"}, + {file = "cffi-1.17.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:30c5e0cb5ae493c04c8b42916e52ca38079f1b235c2f8ae5f4527b963c401caf"}, + {file = "cffi-1.17.1-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f75c7ab1f9e4aca5414ed4d8e5c0e303a34f4421f8a0d47a4d019ceff0ab6af4"}, + {file = "cffi-1.17.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a1ed2dd2972641495a3ec98445e09766f077aee98a1c896dcb4ad0d303628e41"}, + {file = "cffi-1.17.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:46bf43160c1a35f7ec506d254e5c890f3c03648a4dbac12d624e4490a7046cd1"}, + {file = "cffi-1.17.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a24ed04c8ffd54b0729c07cee15a81d964e6fee0e3d4d342a27b020d22959dc6"}, + {file = "cffi-1.17.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:610faea79c43e44c71e1ec53a554553fa22321b65fae24889706c0a84d4ad86d"}, + {file = "cffi-1.17.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:a9b15d491f3ad5d692e11f6b71f7857e7835eb677955c00cc0aefcd0669adaf6"}, + {file = "cffi-1.17.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:de2ea4b5833625383e464549fec1bc395c1bdeeb5f25c4a3a82b5a8c756ec22f"}, + {file = "cffi-1.17.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:fc48c783f9c87e60831201f2cce7f3b2e4846bf4d8728eabe54d60700b318a0b"}, + {file = "cffi-1.17.1-cp311-cp311-win32.whl", hash = "sha256:85a950a4ac9c359340d5963966e3e0a94a676bd6245a4b55bc43949eee26a655"}, + {file = "cffi-1.17.1-cp311-cp311-win_amd64.whl", hash = "sha256:caaf0640ef5f5517f49bc275eca1406b0ffa6aa184892812030f04c2abf589a0"}, + {file = "cffi-1.17.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:805b4371bf7197c329fcb3ead37e710d1bca9da5d583f5073b799d5c5bd1eee4"}, + {file = "cffi-1.17.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:733e99bc2df47476e3848417c5a4540522f234dfd4ef3ab7fafdf555b082ec0c"}, + {file = "cffi-1.17.1-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1257bdabf294dceb59f5e70c64a3e2f462c30c7ad68092d01bbbfb1c16b1ba36"}, + {file = "cffi-1.17.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:da95af8214998d77a98cc14e3a3bd00aa191526343078b530ceb0bd710fb48a5"}, + {file = "cffi-1.17.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d63afe322132c194cf832bfec0dc69a99fb9bb6bbd550f161a49e9e855cc78ff"}, + {file = "cffi-1.17.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f79fc4fc25f1c8698ff97788206bb3c2598949bfe0fef03d299eb1b5356ada99"}, + {file = "cffi-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b62ce867176a75d03a665bad002af8e6d54644fad99a3c70905c543130e39d93"}, + {file = "cffi-1.17.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:386c8bf53c502fff58903061338ce4f4950cbdcb23e2902d86c0f722b786bbe3"}, + {file = "cffi-1.17.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:4ceb10419a9adf4460ea14cfd6bc43d08701f0835e979bf821052f1805850fe8"}, + {file = "cffi-1.17.1-cp312-cp312-win32.whl", hash = "sha256:a08d7e755f8ed21095a310a693525137cfe756ce62d066e53f502a83dc550f65"}, + {file = "cffi-1.17.1-cp312-cp312-win_amd64.whl", hash = "sha256:51392eae71afec0d0c8fb1a53b204dbb3bcabcb3c9b807eedf3e1e6ccf2de903"}, + {file = "cffi-1.17.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f3a2b4222ce6b60e2e8b337bb9596923045681d71e5a082783484d845390938e"}, + {file = "cffi-1.17.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:0984a4925a435b1da406122d4d7968dd861c1385afe3b45ba82b750f229811e2"}, + {file = "cffi-1.17.1-cp313-cp313-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d01b12eeeb4427d3110de311e1774046ad344f5b1a7403101878976ecd7a10f3"}, + {file = "cffi-1.17.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:706510fe141c86a69c8ddc029c7910003a17353970cff3b904ff0686a5927683"}, + {file = "cffi-1.17.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:de55b766c7aa2e2a3092c51e0483d700341182f08e67c63630d5b6f200bb28e5"}, + {file = "cffi-1.17.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c59d6e989d07460165cc5ad3c61f9fd8f1b4796eacbd81cee78957842b834af4"}, + {file = "cffi-1.17.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd398dbc6773384a17fe0d3e7eeb8d1a21c2200473ee6806bb5e6a8e62bb73dd"}, + {file = "cffi-1.17.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:3edc8d958eb099c634dace3c7e16560ae474aa3803a5df240542b305d14e14ed"}, + {file = "cffi-1.17.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:72e72408cad3d5419375fc87d289076ee319835bdfa2caad331e377589aebba9"}, + {file = "cffi-1.17.1-cp313-cp313-win32.whl", hash = "sha256:e03eab0a8677fa80d646b5ddece1cbeaf556c313dcfac435ba11f107ba117b5d"}, + {file = "cffi-1.17.1-cp313-cp313-win_amd64.whl", hash = "sha256:f6a16c31041f09ead72d69f583767292f750d24913dadacf5756b966aacb3f1a"}, + {file = "cffi-1.17.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:636062ea65bd0195bc012fea9321aca499c0504409f413dc88af450b57ffd03b"}, + {file = "cffi-1.17.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c7eac2ef9b63c79431bc4b25f1cd649d7f061a28808cbc6c47b534bd789ef964"}, + {file = "cffi-1.17.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e221cf152cff04059d011ee126477f0d9588303eb57e88923578ace7baad17f9"}, + {file = "cffi-1.17.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:31000ec67d4221a71bd3f67df918b1f88f676f1c3b535a7eb473255fdc0b83fc"}, + {file = "cffi-1.17.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6f17be4345073b0a7b8ea599688f692ac3ef23ce28e5df79c04de519dbc4912c"}, + {file = "cffi-1.17.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0e2b1fac190ae3ebfe37b979cc1ce69c81f4e4fe5746bb401dca63a9062cdaf1"}, + {file = "cffi-1.17.1-cp38-cp38-win32.whl", hash = "sha256:7596d6620d3fa590f677e9ee430df2958d2d6d6de2feeae5b20e82c00b76fbf8"}, + {file = "cffi-1.17.1-cp38-cp38-win_amd64.whl", hash = "sha256:78122be759c3f8a014ce010908ae03364d00a1f81ab5c7f4a7a5120607ea56e1"}, + {file = "cffi-1.17.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b2ab587605f4ba0bf81dc0cb08a41bd1c0a5906bd59243d56bad7668a6fc6c16"}, + {file = "cffi-1.17.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:28b16024becceed8c6dfbc75629e27788d8a3f9030691a1dbf9821a128b22c36"}, + {file = "cffi-1.17.1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1d599671f396c4723d016dbddb72fe8e0397082b0a77a4fab8028923bec050e8"}, + {file = "cffi-1.17.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ca74b8dbe6e8e8263c0ffd60277de77dcee6c837a3d0881d8c1ead7268c9e576"}, + {file = "cffi-1.17.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f7f5baafcc48261359e14bcd6d9bff6d4b28d9103847c9e136694cb0501aef87"}, + {file = "cffi-1.17.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:98e3969bcff97cae1b2def8ba499ea3d6f31ddfdb7635374834cf89a1a08ecf0"}, + {file = "cffi-1.17.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cdf5ce3acdfd1661132f2a9c19cac174758dc2352bfe37d98aa7512c6b7178b3"}, + {file = "cffi-1.17.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:9755e4345d1ec879e3849e62222a18c7174d65a6a92d5b346b1863912168b595"}, + {file = "cffi-1.17.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:f1e22e8c4419538cb197e4dd60acc919d7696e5ef98ee4da4e01d3f8cfa4cc5a"}, + {file = "cffi-1.17.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:c03e868a0b3bc35839ba98e74211ed2b05d2119be4e8a0f224fba9384f1fe02e"}, + {file = "cffi-1.17.1-cp39-cp39-win32.whl", hash = "sha256:e31ae45bc2e29f6b2abd0de1cc3b9d5205aa847cafaecb8af1476a609a2f6eb7"}, + {file = "cffi-1.17.1-cp39-cp39-win_amd64.whl", hash = "sha256:d016c76bdd850f3c626af19b0542c9677ba156e4ee4fccfdd7848803533ef662"}, + {file = "cffi-1.17.1.tar.gz", hash = "sha256:1c39c6016c32bc48dd54561950ebd6836e1670f2ae46128f67cf49e789c52824"}, +] + +[package.dependencies] +pycparser = "*" + [[package]] name = "chardet" version = "5.2.0" @@ -139,6 +235,56 @@ tomli = {version = "*", optional = true, markers = "python_full_version <= \"3.1 [package.extras] toml = ["tomli ; python_full_version <= \"3.11.0a6\""] +[[package]] +name = "cryptography" +version = "43.0.3" +description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." +optional = false +python-versions = ">=3.7" +groups = ["main"] +files = [ + {file = "cryptography-43.0.3-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:bf7a1932ac4176486eab36a19ed4c0492da5d97123f1406cf15e41b05e787d2e"}, + {file = "cryptography-43.0.3-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:63efa177ff54aec6e1c0aefaa1a241232dcd37413835a9b674b6e3f0ae2bfd3e"}, + {file = "cryptography-43.0.3-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e1ce50266f4f70bf41a2c6dc4358afadae90e2a1e5342d3c08883df1675374f"}, + {file = "cryptography-43.0.3-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:443c4a81bb10daed9a8f334365fe52542771f25aedaf889fd323a853ce7377d6"}, + {file = "cryptography-43.0.3-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:74f57f24754fe349223792466a709f8e0c093205ff0dca557af51072ff47ab18"}, + {file = "cryptography-43.0.3-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:9762ea51a8fc2a88b70cf2995e5675b38d93bf36bd67d91721c309df184f49bd"}, + {file = "cryptography-43.0.3-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:81ef806b1fef6b06dcebad789f988d3b37ccaee225695cf3e07648eee0fc6b73"}, + {file = "cryptography-43.0.3-cp37-abi3-win32.whl", hash = "sha256:cbeb489927bd7af4aa98d4b261af9a5bc025bd87f0e3547e11584be9e9427be2"}, + {file = "cryptography-43.0.3-cp37-abi3-win_amd64.whl", hash = "sha256:f46304d6f0c6ab8e52770addfa2fc41e6629495548862279641972b6215451cd"}, + {file = "cryptography-43.0.3-cp39-abi3-macosx_10_9_universal2.whl", hash = "sha256:8ac43ae87929a5982f5948ceda07001ee5e83227fd69cf55b109144938d96984"}, + {file = "cryptography-43.0.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:846da004a5804145a5f441b8530b4bf35afbf7da70f82409f151695b127213d5"}, + {file = "cryptography-43.0.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0f996e7268af62598f2fc1204afa98a3b5712313a55c4c9d434aef49cadc91d4"}, + {file = "cryptography-43.0.3-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:f7b178f11ed3664fd0e995a47ed2b5ff0a12d893e41dd0494f406d1cf555cab7"}, + {file = "cryptography-43.0.3-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:c2e6fc39c4ab499049df3bdf567f768a723a5e8464816e8f009f121a5a9f4405"}, + {file = "cryptography-43.0.3-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:e1be4655c7ef6e1bbe6b5d0403526601323420bcf414598955968c9ef3eb7d16"}, + {file = "cryptography-43.0.3-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:df6b6c6d742395dd77a23ea3728ab62f98379eff8fb61be2744d4679ab678f73"}, + {file = "cryptography-43.0.3-cp39-abi3-win32.whl", hash = "sha256:d56e96520b1020449bbace2b78b603442e7e378a9b3bd68de65c782db1507995"}, + {file = "cryptography-43.0.3-cp39-abi3-win_amd64.whl", hash = "sha256:0c580952eef9bf68c4747774cde7ec1d85a6e61de97281f2dba83c7d2c806362"}, + {file = "cryptography-43.0.3-pp310-pypy310_pp73-macosx_10_9_x86_64.whl", hash = "sha256:d03b5621a135bffecad2c73e9f4deb1a0f977b9a8ffe6f8e002bf6c9d07b918c"}, + {file = "cryptography-43.0.3-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:a2a431ee15799d6db9fe80c82b055bae5a752bef645bba795e8e52687c69efe3"}, + {file = "cryptography-43.0.3-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:281c945d0e28c92ca5e5930664c1cefd85efe80e5c0d2bc58dd63383fda29f83"}, + {file = "cryptography-43.0.3-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:f18c716be16bc1fea8e95def49edf46b82fccaa88587a45f8dc0ff6ab5d8e0a7"}, + {file = "cryptography-43.0.3-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:4a02ded6cd4f0a5562a8887df8b3bd14e822a90f97ac5e544c162899bc467664"}, + {file = "cryptography-43.0.3-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:53a583b6637ab4c4e3591a15bc9db855b8d9dee9a669b550f311480acab6eb08"}, + {file = "cryptography-43.0.3-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:1ec0bcf7e17c0c5669d881b1cd38c4972fade441b27bda1051665faaa89bdcaa"}, + {file = "cryptography-43.0.3-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:2ce6fae5bdad59577b44e4dfed356944fbf1d925269114c28be377692643b4ff"}, + {file = "cryptography-43.0.3.tar.gz", hash = "sha256:315b9001266a492a6ff443b61238f956b214dbec9910a081ba5b6646a055a805"}, +] + +[package.dependencies] +cffi = {version = ">=1.12", markers = "platform_python_implementation != \"PyPy\""} + +[package.extras] +docs = ["sphinx (>=5.3.0)", "sphinx-rtd-theme (>=1.1.1)"] +docstest = ["pyenchant (>=1.6.11)", "readme-renderer", "sphinxcontrib-spelling (>=4.0.1)"] +nox = ["nox"] +pep8test = ["check-sdist", "click", "mypy", "ruff"] +sdist = ["build"] +ssh = ["bcrypt (>=3.1.5)"] +test = ["certifi", "cryptography-vectors (==43.0.3)", "pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-xdist"] +test-randomorder = ["pytest-randomly"] + [[package]] name = "distlib" version = "0.3.9" @@ -354,6 +500,19 @@ files = [ {file = "pycodestyle-2.9.1.tar.gz", hash = "sha256:2c9607871d58c76354b697b42f5d57e1ada7d261c261efac224b664affdc5785"}, ] +[[package]] +name = "pycparser" +version = "2.22" +description = "C parser in Python" +optional = false +python-versions = ">=3.8" +groups = ["main"] +markers = "platform_python_implementation != \"PyPy\"" +files = [ + {file = "pycparser-2.22-py3-none-any.whl", hash = "sha256:c3702b6d3dd8c7abc1afa565d7e63d53a1d0bd86cdc24edd75470f4de499cfcc"}, + {file = "pycparser-2.22.tar.gz", hash = "sha256:491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6"}, +] + [[package]] name = "pydantic" version = "2.10.6" @@ -726,4 +885,4 @@ test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess [metadata] lock-version = "2.1" python-versions = ">=3.8" -content-hash = "6ffedc3b18270f40c666d987288ce74cbefad771ccc663eedc530ae08e4309c5" +content-hash = "719b51a8b8c6e8ff59dae16de8d11780b8de6f3936b7ce8f27e4c1d73f7758a6" diff --git a/pyproject.toml b/pyproject.toml index af63386c..1ec49a63 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,8 @@ dependencies = [ "urllib3>=1.25.3,<3.0.0", "python-dateutil>=2.8.2", "pydantic>=2", - "typing-extensions>=4.7.1" + "typing-extensions>=4.7.1", + "authlib (==1.3.2)" ] [project.urls] diff --git a/zitadel_client/api_client.py b/zitadel_client/api_client.py index 276a7b3b..d9cc3453 100644 --- a/zitadel_client/api_client.py +++ b/zitadel_client/api_client.py @@ -1,67 +1,49 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - import datetime -from dateutil.parser import parse -from enum import Enum import decimal import json import mimetypes import os import re import tempfile - +from enum import Enum +from typing import Tuple, Optional, List, Dict, Union, Any from urllib.parse import quote -from typing import Tuple, Optional, List, Dict, Union + +from dateutil.parser import parse from pydantic import SecretStr -from zitadel_client.configuration import Configuration -from zitadel_client.api_response import ApiResponse, T as ApiResponseT import zitadel_client.models -from zitadel_client import rest +from zitadel_client import rest, configuration +from zitadel_client.api_response import ApiResponse, T as ApiResponseT +from zitadel_client.auth.authenticator import Authenticator +from zitadel_client.auth.no_auth import DummyAuthenticator +from zitadel_client.auth.personal_access import PersonalAccessAuthenticator +from zitadel_client.configuration import Configuration from zitadel_client.exceptions import ( - ApiValueError, - ApiException, - BadRequestException, - UnauthorizedException, - ForbiddenException, - NotFoundException, - ServiceException + ApiException ) RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] + class ApiClient: """Generic API client for OpenAPI client library builds. - OpenAPI generic API client. This client handles the client- - server communication, and is invariant across implementations. Specifics of - the methods and models for each application are generated from the OpenAPI + OpenAPI generic API client. This client handles the client-server communication, + and is invariant across implementations. Specifics of the methods and models + for each application are generated from the OpenAPI templates. :param configuration: .Configuration object for this client :param header_name: a header to pass when making calls to the API. :param header_value: a header value to pass when making calls to the API. - :param cookie: a cookie to include in the header when making calls - to the API """ PRIMITIVE_TYPES = (float, bool, bytes, str, int) NATIVE_TYPES_MAPPING = { 'int': int, - 'long': int, # TODO remove as only py3 is supported? + 'long': int, 'float': float, 'str': str, 'bool': bool, @@ -73,23 +55,17 @@ class ApiClient: _pool = None def __init__( - self, - configuration=None, - header_name=None, - header_value=None, - cookie=None + self, + configuration: Configuration, + header_name=None, + header_value=None, ) -> None: - # use default configuration if none is provided - if configuration is None: - configuration = Configuration.get_default() self.configuration = configuration self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} if header_name is not None: self.default_headers[header_name] = header_value - self.cookie = cookie - # Set default User-Agent. self.user_agent = 'OpenAPI-Generator/0.0.1/python' self.client_side_validation = configuration.client_side_validation @@ -111,49 +87,27 @@ def user_agent(self, value): def set_default_header(self, header_name, header_value): self.default_headers[header_name] = header_value - _default = None - @classmethod - def get_default(cls): - """Return new instance of ApiClient. - - This method returns newly created, based on default constructor, - object of ApiClient class or returns a copy of default - ApiClient. - - :return: The ApiClient object. - """ - if cls._default is None: - cls._default = ApiClient() - return cls._default - - @classmethod - def set_default(cls, default): - """Set default instance of ApiClient. - - It stores default ApiClient. - - :param default: object of ApiClient. - """ - cls._default = default - def param_serialize( - self, - method, - resource_path, - path_params=None, - query_params=None, - header_params=None, - body=None, - post_params=None, - files=None, auth_settings=None, - collection_formats=None, - _host=None, - _request_auth=None + self, + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, + auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None ) -> RequestSerialized: """Builds the HTTP request params needed by the request. + :param _host: + :param auth_settings: :param method: Method to call. :param resource_path: Path to method endpoint. :param path_params: Path parameters in the url. @@ -161,14 +115,12 @@ def param_serialize( :param header_params: Header parameters to be placed in the request header. :param body: Request body. - :param post_params dict: Request post form parameters, + :param post_params: Request post form parameters, for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param files dict: key -> filename, value -> filepath, - for `multipart/form-data`. + :param auth_settings: Auth Settings names for the request. :param collection_formats: dict of collection formats for path, query, header, and post parameters. - :param _request_auth: set to override the auth_settings for an a single + :param _request_auth: set to override the auth_settings for an single request; this effectively ignores the authentication in the spec for a single request. :return: tuple of form (path, http_method, query_params, header_params, @@ -180,12 +132,10 @@ def param_serialize( # header parameters header_params = header_params or {} header_params.update(self.default_headers) - if self.cookie: - header_params['Cookie'] = self.cookie if header_params: header_params = self.sanitize_for_serialization(header_params) header_params = dict( - self.parameters_to_tuples(header_params,collection_formats) + self.parameters_to_tuples(header_params, collection_formats) ) # path parameters @@ -213,29 +163,13 @@ def param_serialize( if files: post_params.extend(self.files_parameters(files)) - # auth setting - self.update_params_for_auth( - header_params, - query_params, - auth_settings, - resource_path, - method, - body, - request_auth=_request_auth - ) + header_params.update(self.configuration.authenticator.get_auth_headers()) - # body if body: body = self.sanitize_for_serialization(body) - # request url - if _host is None or self.configuration.ignore_operation_servers: - url = self.configuration.host + resource_path - else: - # use server/host defined in path or operation instead - url = _host + resource_path + url = _host + resource_path - # query parameters if query_params: query_params = self.sanitize_for_serialization(query_params) url_query = self.parameters_to_url_query( @@ -246,23 +180,23 @@ def param_serialize( return method, url, header_params, body, post_params - def call_api( - self, - method, - url, - header_params=None, - body=None, - post_params=None, - _request_timeout=None + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None ) -> rest.RESTResponse: """Makes the HTTP request (synchronous) + :param post_params: :param method: Method to call. :param url: Path to method endpoint. :param header_params: Header parameters to be placed in the request header. :param body: Request body. - :param post_params dict: Request post form parameters, + :param post_params: Request post form parameters, for `application/x-www-form-urlencoded`, `multipart/form-data`. :param _request_timeout: timeout setting for this request. :return: RESTResponse @@ -283,9 +217,9 @@ def call_api( return response_data def response_deserialize( - self, - response_data: rest.RESTResponse, - response_types_map: Optional[Dict[str, ApiResponseT]]=None + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]] = None ) -> ApiResponse[ApiResponseT]: """Deserializes response into an object. :param response_data: RESTResponse object to be deserialized. @@ -324,13 +258,13 @@ def response_deserialize( body=response_text, data=return_data, ) - - return ApiResponse( - status_code = response_data.status, - data = return_data, - headers = response_data.getheaders(), - raw_data = response_data.data - ) + else: + return ApiResponse( + status_code=response_data.status, + data=return_data, + headers=response_data.getheaders(), + raw_data=response_data.data + ) def sanitize_for_serialization(self, obj): """Builds a JSON POST object. @@ -343,7 +277,7 @@ def sanitize_for_serialization(self, obj): If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. - If obj is OpenAPI model, return the properties dict. + If obj is OpenAPI model, return the properties' dict. :param obj: The data to serialize. :return: The serialized form of data. @@ -390,7 +324,7 @@ def sanitize_for_serialization(self, obj): def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): """Deserializes response into an object. - :param response: RESTResponse object to be deserialized. + :param response_text: RESTResponse object to be deserialized. :param response_type: class literal for deserialized object, or string of class name. :param content_type: content type of response. @@ -419,7 +353,8 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti return self.__deserialize(data, response_type) - def __deserialize(self, data, klass): + @staticmethod + def __deserialize(data, klass): """Deserializes dict, list, str into an object. :param data: dict, list or str. @@ -435,38 +370,39 @@ def __deserialize(self, data, klass): m = re.match(r'List\[(.*)]', klass) assert m is not None, "Malformed List type definition" sub_kls = m.group(1) - return [self.__deserialize(sub_data, sub_kls) + return [ApiClient.__deserialize(sub_data) for sub_data in data] if klass.startswith('Dict['): m = re.match(r'Dict\[([^,]*), (.*)]', klass) assert m is not None, "Malformed Dict type definition" sub_kls = m.group(2) - return {k: self.__deserialize(v, sub_kls) + return {k: ApiClient.__deserialize(sub_kls) for k, v in data.items()} # convert str to class - if klass in self.NATIVE_TYPES_MAPPING: - klass = self.NATIVE_TYPES_MAPPING[klass] + if klass in ApiClient.NATIVE_TYPES_MAPPING: + klass = ApiClient.NATIVE_TYPES_MAPPING[klass] else: klass = getattr(zitadel_client.models, klass) - if klass in self.PRIMITIVE_TYPES: - return self.__deserialize_primitive(data, klass) + if klass in ApiClient.PRIMITIVE_TYPES: + return ApiClient.__deserialize_primitive(data, klass) elif klass == object: - return self.__deserialize_object(data) + return ApiClient.__deserialize_object(data) elif klass == datetime.date: - return self.__deserialize_date(data) + return ApiClient.__deserialize_date(data) elif klass == datetime.datetime: - return self.__deserialize_datetime(data) + return ApiClient.__deserialize_datetime(data) elif klass == decimal.Decimal: return decimal.Decimal(data) elif issubclass(klass, Enum): - return self.__deserialize_enum(data, klass) + return ApiClient.__deserialize_enum(data, klass) else: - return self.__deserialize_model(data, klass) + return ApiClient.__deserialize_model(data, klass) - def parameters_to_tuples(self, params, collection_formats): + @staticmethod + def parameters_to_tuples(params, collection_formats): """Get parameters as list of tuples, formatting collections. :param params: Parameters as dict or list of two-tuples @@ -496,7 +432,8 @@ def parameters_to_tuples(self, params, collection_formats): new_params.append((k, v)) return new_params - def parameters_to_url_query(self, params, collection_formats): + @staticmethod + def parameters_to_url_query(params, collection_formats): """Get parameters as list of tuples, formatting collections. :param params: Parameters as dict or list of two-tuples @@ -536,8 +473,8 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) def files_parameters( - self, - files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], ): """Builds form parameters. @@ -562,15 +499,16 @@ def files_parameters( else: raise ValueError("Unsupported file value") mimetype = ( - mimetypes.guess_type(filename)[0] - or 'application/octet-stream' + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' ) params.append( tuple([k, tuple([filename, filedata, mimetype])]) ) return params - def select_header_accept(self, accepts: List[str]) -> Optional[str]: + @staticmethod + def select_header_accept(accepts: List[str]) -> Optional[str]: """Returns `Accept` based on an array of accepts provided. :param accepts: List of headers. @@ -585,7 +523,8 @@ def select_header_accept(self, accepts: List[str]) -> Optional[str]: return accepts[0] - def select_header_content_type(self, content_types): + @staticmethod + def select_header_content_type(content_types): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. @@ -600,85 +539,8 @@ def select_header_content_type(self, content_types): return content_types[0] - def update_params_for_auth( - self, - headers, - queries, - auth_settings, - resource_path, - method, - body, - request_auth=None - ) -> None: - """Updates header and query params based on authentication setting. - - :param headers: Header parameters dict to be updated. - :param queries: Query parameters tuple list to be updated. - :param auth_settings: Authentication setting identifiers list. - :resource_path: A string representation of the HTTP request resource path. - :method: A string representation of the HTTP request method. - :body: A object representing the body of the HTTP request. - The object type is the return value of sanitize_for_serialization(). - :param request_auth: if set, the provided settings will - override the token in the configuration. - """ - if not auth_settings: - return - - if request_auth: - self._apply_auth_params( - headers, - queries, - resource_path, - method, - body, - request_auth - ) - else: - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - self._apply_auth_params( - headers, - queries, - resource_path, - method, - body, - auth_setting - ) - - def _apply_auth_params( - self, - headers, - queries, - resource_path, - method, - body, - auth_setting - ) -> None: - """Updates the request parameters based on a single auth_setting - - :param headers: Header parameters dict to be updated. - :param queries: Query parameters tuple list to be updated. - :resource_path: A string representation of the HTTP request resource path. - :method: A string representation of the HTTP request method. - :body: A object representing the body of the HTTP request. - The object type is the return value of sanitize_for_serialization(). - :param auth_setting: auth settings for the endpoint - """ - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - queries.append((auth_setting['key'], auth_setting['value'])) - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - - def __deserialize_file(self, response): + @staticmethod + def __deserialize_file(response): """Deserializes body to file Saves response body into a file in a temporary folder, @@ -690,7 +552,7 @@ def __deserialize_file(self, response): :param response: RESTResponse. :return: file path. """ - fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + fd, path = tempfile.mkstemp() os.close(fd) os.remove(path) @@ -709,7 +571,8 @@ def __deserialize_file(self, response): return path - def __deserialize_primitive(self, data, klass): + @staticmethod + def __deserialize_primitive(data, klass): """Deserializes string to primitive type. :param data: str. @@ -724,14 +587,16 @@ def __deserialize_primitive(self, data, klass): except TypeError: return data - def __deserialize_object(self, value): + @staticmethod + def __deserialize_object(value): """Return an original value. :return: object. """ return value - def __deserialize_date(self, string): + @staticmethod + def __deserialize_date(string): """Deserializes string to date. :param string: str. @@ -747,7 +612,8 @@ def __deserialize_date(self, string): reason="Failed to parse `{0}` as date object".format(string) ) - def __deserialize_datetime(self, string): + @staticmethod + def __deserialize_datetime(string): """Deserializes string to datetime. The string should be in iso8601 datetime format. @@ -768,7 +634,8 @@ def __deserialize_datetime(self, string): ) ) - def __deserialize_enum(self, data, klass): + @staticmethod + def __deserialize_enum(data, klass): """Deserializes primitive type to enum. :param data: primitive type. @@ -786,7 +653,8 @@ def __deserialize_enum(self, data, klass): ) ) - def __deserialize_model(self, data, klass): + @staticmethod + def __deserialize_model(data, klass: Any): """Deserializes list or dict to model. :param data: dict, list. @@ -795,3 +663,7 @@ def __deserialize_model(self, data, klass): """ return klass.from_dict(data) + + @classmethod + def get_default(cls): + return ApiClient(configuration=Configuration(authenticator=DummyAuthenticator("localhost"))) diff --git a/zitadel_client/api_response.py b/zitadel_client/api_response.py index 9bc7c11f..271ae162 100644 --- a/zitadel_client/api_response.py +++ b/zitadel_client/api_response.py @@ -1,21 +1,22 @@ -"""API response object.""" - from __future__ import annotations + from typing import Optional, Generic, Mapping, TypeVar + from pydantic import Field, StrictInt, StrictBytes, BaseModel T = TypeVar("T") + class ApiResponse(BaseModel, Generic[T]): - """ - API response object - """ + """ + API response object + """ - status_code: StrictInt = Field(description="HTTP status code") - headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") - data: T = Field(description="Deserialized data given the data type") - raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") - model_config = { - "arbitrary_types_allowed": True - } + model_config = { + "arbitrary_types_allowed": True + } diff --git a/zitadel_client/auth/__init__.py b/zitadel_client/auth/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/zitadel_client/auth/authenticator.py b/zitadel_client/auth/authenticator.py new file mode 100644 index 00000000..fca32f76 --- /dev/null +++ b/zitadel_client/auth/authenticator.py @@ -0,0 +1,65 @@ +from abc import ABC, abstractmethod + + +class Authenticator(ABC): + """ + Abstract base class for authentication strategies. + + This class defines a common interface for implementing various + authentication mechanisms. Subclasses must implement the + `get_auth_headers` method to provide the necessary HTTP headers for + authenticated API requests, as well as the `refresh_token` method for + refreshing authentication tokens when needed. + + Attributes: + host (str): The base URL for authentication endpoints. + """ + + def __init__(self, host: str): + """ + Initialize the Authenticator with a host URL. + + Args: + host (str): The base URL for all authentication endpoints. + """ + self.host = host + + @abstractmethod + def get_auth_headers(self) -> dict[str, str]: + """ + Generate and return the authentication headers required for API requests. + + Subclasses must implement this method to return a dictionary where the keys + are the header names and the values are the corresponding header values. + + Returns: + dict[str, str]: A dictionary containing the authentication header(s). + """ + pass + + @abstractmethod + def refresh_token(self) -> None: + """ + Refresh the authentication token. + + This abstract method must be implemented by subclasses that require a mechanism + to refresh the authentication token. The implementation should update the token + used by the authenticator. + + Returns: + None + """ + pass + + def get_host(self) -> str: + """ + Retrieve the base host URL. + + This method returns the host URL that was specified during the instantiation + of the Authenticator. It can be used by concrete classes or external consumers + to build full endpoint URLs. + + Returns: + str: The base URL for authentication endpoints. + """ + return self.host diff --git a/zitadel_client/auth/client_credentials.py b/zitadel_client/auth/client_credentials.py new file mode 100644 index 00000000..371a19dd --- /dev/null +++ b/zitadel_client/auth/client_credentials.py @@ -0,0 +1,49 @@ +from authlib.integrations.requests_client import OAuth2Session + +from .oauth_base import OAuthAuthenticator + + +class ClientCredentialsAuthenticator(OAuthAuthenticator): + """ + An Authenticator implementation using the OAuth2 client credentials grant. + + This class leverages the Authlib library to perform the client credentials flow. + It retrieves an access token from the token endpoint and provides it as part of the + authentication header for subsequent API requests. + """ + + def __init__( + self, + host: str, + client_id: str, + client_secret: str, + token_url: str = "/oauth/v2/token", + scope: str = "openid urn:zitadel:iam:org:project:id:myprojectid:aud additional_scope" # FIXME + ): + """ + Initialize the ClientCredentialsAuthenticator with client credentials. + + Args: + host (str): The base URL for the API endpoints. + client_id (str): The OAuth2 client identifier. + client_secret (str): The OAuth2 client secret. + token_url (str, optional): The URL of the OAuth2 token endpoint. + Defaults to "/oauth/v2/token". + scope (str, optional): The scope for the token request. + Defaults to a string containing "openid" and additional required scopes. + """ + # If token_url is relative, prepend the host. + super().__init__(host, client_id, token_url, scope) + self.client_secret = client_secret + self.session = OAuth2Session(client_id, client_secret=client_secret, scope=scope) + + def refresh_token(self) -> None: + """ + Refresh the access token using the OAuth2 client credentials grant. + + This method fetches a new access token from the token endpoint using the + client credentials and updates the stored token. + """ + self.token = self.session.fetch_token( + grant_type="client_credentials" + ) diff --git a/zitadel_client/auth/jwt_auth.py b/zitadel_client/auth/jwt_auth.py new file mode 100644 index 00000000..347c2bb3 --- /dev/null +++ b/zitadel_client/auth/jwt_auth.py @@ -0,0 +1,121 @@ +import json +import time + +from authlib.integrations.requests_client import OAuth2Session +from authlib.jose import jwt + +from zitadel_client.auth.oauth_base import OAuthAuthenticator + + +class JWTAuthenticator(OAuthAuthenticator): + """ + An Authenticator implementation using JWT-based authentication (RFC7523). + + This strategy leverages Authlib's JOSE support to create a JWT assertion, + which is then exchanged for an access token via the token endpoint using + the JWT bearer grant. + """ + + def __init__(self, host: str, client_id: str, issuer: str, subject: str, + audience: str, private_key: str, token_url: str = "/oauth/v2/token", algorithm: str = "RS256", + token_lifetime: int = 300): + """ + Initialize the JWTAuthenticator with the required credentials and claims. + + Args: + host (str): The base URL for the API endpoints. + client_id (str): The OAuth2 client identifier. + token_url (str): The URL of the OAuth2 token endpoint. + issuer (str): The issuer claim for the JWT. + subject (str): The subject claim for the JWT. + audience (str): The audience claim, typically the token endpoint URL. + private_key (str): The private key used to sign the JWT. + algorithm (str, optional): The signing algorithm. Defaults to "RS256". + token_lifetime (int, optional): Lifetime of the JWT in seconds. Defaults to 300. + """ + # token_url might be relative + super().__init__(host, client_id, token_url) + self.issuer = issuer + self.subject = subject + self.audience = audience + self.private_key = private_key + self.algorithm = algorithm + self.token_lifetime = token_lifetime + self.session = OAuth2Session(client_id) + + def _generate_jwt_assertion(self) -> str: + """ + Generate a JWT assertion based on the provided credentials and claims. + + Returns: + str: A signed JWT assertion. + """ + current_time = int(time.time()) + payload = { + "iss": self.issuer, + "sub": self.subject, + "aud": self.audience, + "iat": current_time, + "exp": current_time + self.token_lifetime, + "jti": str(current_time) + } + header = {"alg": self.algorithm, "typ": "JWT"} + assertion = jwt.encode(header, payload, self.private_key) + return assertion.decode("utf-8") if isinstance(assertion, bytes) else assertion + + def refresh_token(self) -> None: + """ + Refresh the access token using a JWT assertion. + + This method generates a new JWT assertion and exchanges it for an access token + via the token endpoint using the JWT bearer grant. + """ + jwt_assertion = self._generate_jwt_assertion() + self.token = self.session.fetch_token( + grant_type="urn:ietf:params:oauth:grant-type:jwt-bearer", + assertion=jwt_assertion, + client_id=self.client_id + ) + + @classmethod + def from_json(cls, json_path: str, host: str, token_url: str, audience: str, + algorithm: str = "RS256", token_lifetime: int = 300): + """ + Initialize a JWTAuthenticator instance from a JSON configuration file. + + The JSON file should have the following structure: + + { + "type": "serviceaccount", + "keyId": "100509901696068329", + "key": "-----BEGIN RSA PRIVATE KEY----- [...] -----END RSA PRIVATE KEY-----\n", + "userId": "100507859606888466" + } + + Args: + json_path (str): The file path to the JSON configuration file. + host (str): The base URL for the API endpoints. + token_url (str): The URL of the OAuth2 token endpoint. + audience (str): The custom domain to be used as the 'aud' claim. + algorithm (str, optional): The signing algorithm. Defaults to "RS256". + token_lifetime (int, optional): Lifetime of the JWT in seconds. Defaults to 300. + + Returns: + JWTAuthenticator: An initialized instance of JWTAuthenticator. + """ + with open(json_path, 'r') as f: + config = json.load(f) + + user_id = config.get("userId") + private_key = config.get("key") + return cls( + host=host, + client_id=user_id, + token_url=token_url, + issuer=user_id, + subject=user_id, + audience=audience, + private_key=private_key, + algorithm=algorithm, + token_lifetime=token_lifetime + ) diff --git a/zitadel_client/auth/no_auth.py b/zitadel_client/auth/no_auth.py new file mode 100644 index 00000000..751aa950 --- /dev/null +++ b/zitadel_client/auth/no_auth.py @@ -0,0 +1,42 @@ +from .authenticator import Authenticator + + +class DummyAuthenticator(Authenticator): + """ + Authenticator implementation for testing purposes. + + This strategy does not apply any authentication to API requests. + It is useful for testing environments where authentication is not required. + """ + + def __init__(self, host: str): + """ + Initialize the DummyAuthenticator. + + Args: + host (str): The base URL for all authentication endpoints. + """ + super().__init__(host) + + def refresh_token(self) -> None: + """ + Refresh the authentication token. + + For DummyAuthenticator, token refreshing is not applicable. + This method is implemented as a no-op. + + Returns: + None + """ + pass + + def get_auth_headers(self) -> dict: + """ + Retrieve authentication headers. + + Since no authentication is performed, this method returns an empty dictionary. + + Returns: + dict: An empty dictionary. + """ + return {} diff --git a/zitadel_client/auth/oauth_base.py b/zitadel_client/auth/oauth_base.py new file mode 100644 index 00000000..2b17b1ea --- /dev/null +++ b/zitadel_client/auth/oauth_base.py @@ -0,0 +1,57 @@ +from authlib.integrations.requests_client import OAuth2Session + +from .authenticator import Authenticator + + +class OAuthAuthenticator(Authenticator): + """ + Abstract base class for OAuth-based authenticators. + + Attributes: + client_id (str): The OAuth2 client identifier. + token_url (str): The URL of the OAuth2 token endpoint. + scope (str): The scope for the token request. + session (OAuth2Session): The OAuth2 session instance used for token management. + token (dict): The most recently retrieved access token. + """ + + def __init__(self, host: str, client_id: str, token_url: str, scope: str = None): + """ + Initialize the OAuthAuthenticator with the basic OAuth2 parameters. + + Args: + host (str): The base URL for the API endpoints. + client_id (str): The OAuth2 client identifier. + token_url (str): The URL of the OAuth2 token endpoint. + scope (str, optional): The scope for the token request. + """ + super().__init__(host) + self.client_id = client_id + self.token_url = f"{host}{token_url}" if token_url.startswith("/") else token_url + self.scope = scope + self.session = OAuth2Session(client_id, scope=scope, token_endpoint=token_url) + self.token = None + + def get_auth_headers(self) -> dict: + """ + Retrieve the authentication headers using the OAuth2 flow. + + This method checks whether a valid access token is available. If no token exists + or if the current token is expired, it refreshes the token by calling `refresh_token()`. + It then returns an HTTP header with the Bearer token. + + Returns: + dict: A dictionary containing the 'Authorization' header. + """ + if not self.token or self.session.token.is_expired(): + self.refresh_token() + return {"Authorization": f"Bearer {self.token['access_token']}"} + + def refresh_token(self) -> None: + """ + Abstract method to refresh the access token. + + Subclasses must implement this method to perform the token refresh using their + specific grant flow. + """ + raise NotImplementedError("Subclasses must implement refresh_token()") diff --git a/zitadel_client/auth/personal_access.py b/zitadel_client/auth/personal_access.py new file mode 100644 index 00000000..c4d03d55 --- /dev/null +++ b/zitadel_client/auth/personal_access.py @@ -0,0 +1,43 @@ +from .authenticator import Authenticator + + +class PersonalAccessAuthenticator(Authenticator): + """ + Authenticator implementation using a personal access token. + + This strategy simply injects the personal access token into the HTTP + Authorization header for API requests. + """ + + def __init__(self, host: str, token: str): + """ + Initialize the authenticator with a personal access token. + + Args: + host (str): The base URL for the API endpoints. + token (str): The personal access token to be used for authentication. + """ + super().__init__(host) + self.token = token + + def refresh_token(self) -> None: + """ + Refresh the authentication token. + + For PersonalAccessAuthenticator, token refresh is not applicable as the token + is static. This method is implemented as a no-op. + + Returns: + None + """ + pass + + def get_auth_headers(self) -> dict: + """ + Retrieve authentication headers using the personal access token. + + Returns: + dict: A dictionary with the 'Authorization' header. + Example: {'Authorization': 'Bearer '} + """ + return {"Authorization": f"Bearer {self.token}"} diff --git a/zitadel_client/configuration.py b/zitadel_client/configuration.py index dc8abb1f..b3ebd42a 100644 --- a/zitadel_client/configuration.py +++ b/zitadel_client/configuration.py @@ -1,28 +1,23 @@ # coding: utf-8 - """ Zitadel SDK - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - + The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist + you in integrating with your Zitadel environment. This SDK enables you to + handle resources, settings, and configurations within the Zitadel platform. +""" import copy import http.client as httplib import logging -from logging import FileHandler import multiprocessing import sys -from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union -from typing_extensions import NotRequired, Self +from logging import FileHandler +from typing import Any, Dict, List, Optional, TypedDict, Union -import urllib3 +from typing_extensions import NotRequired, Self +from zitadel_client.auth.authenticator import Authenticator JSON_SCHEMA_VALIDATION_KEYWORDS = { 'multipleOf', 'maximum', 'exclusiveMaximum', @@ -32,92 +27,6 @@ ServerVariablesT = Dict[str, str] -GenericAuthSetting = TypedDict( - "GenericAuthSetting", - { - "type": str, - "in": str, - "key": str, - "value": str, - }, -) - - -OAuth2AuthSetting = TypedDict( - "OAuth2AuthSetting", - { - "type": Literal["oauth2"], - "in": Literal["header"], - "key": Literal["Authorization"], - "value": str, - }, -) - - -APIKeyAuthSetting = TypedDict( - "APIKeyAuthSetting", - { - "type": Literal["api_key"], - "in": str, - "key": str, - "value": Optional[str], - }, -) - - -BasicAuthSetting = TypedDict( - "BasicAuthSetting", - { - "type": Literal["basic"], - "in": Literal["header"], - "key": Literal["Authorization"], - "value": Optional[str], - }, -) - - -BearerFormatAuthSetting = TypedDict( - "BearerFormatAuthSetting", - { - "type": Literal["bearer"], - "in": Literal["header"], - "format": Literal["JWT"], - "key": Literal["Authorization"], - "value": str, - }, -) - - -BearerAuthSetting = TypedDict( - "BearerAuthSetting", - { - "type": Literal["bearer"], - "in": Literal["header"], - "key": Literal["Authorization"], - "value": str, - }, -) - - -HTTPSignatureAuthSetting = TypedDict( - "HTTPSignatureAuthSetting", - { - "type": Literal["http-signature"], - "in": Literal["header"], - "key": Literal["Authorization"], - "value": None, - }, -) - - -AuthSettings = TypedDict( - "AuthSettings", - { - "zitadelAccessToken": BearerAuthSetting, - }, - total=False, -) - class HostSettingVariable(TypedDict): description: str @@ -133,152 +42,39 @@ class HostSetting(TypedDict): class Configuration: """This class contains various settings of the API client. - - :param host: Base url. - :param ignore_operation_servers - Boolean to ignore operation servers for the API client. - Config will use `host` as the base url regardless of the operation servers. - :param api_key: Dict to store API key(s). - Each entry in the dict specifies an API key. - The dict key is the name of the security scheme in the OAS specification. - The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer). - The dict key is the name of the security scheme in the OAS specification. - The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication. - :param password: Password for HTTP basic authentication. - :param access_token: Access token. - :param server_index: Index to servers configuration. - :param server_variables: Mapping with string values to replace variables in - templated server configuration. The validation of enums is performed for - variables with defined enum values before. - :param server_operation_index: Mapping from operation ID to an index to server - configuration. - :param server_operation_variables: Mapping from operation ID to a mapping with - string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum - values before. - :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format. - :param retries: Number of retries for API requests. - :param ca_cert_data: verify the peer using concatenated CA certificate data - in PEM (str) or DER (bytes) format. - - :Example: """ - _default: ClassVar[Optional[Self]] = None - def __init__( - self, - host: Optional[str]=None, - api_key: Optional[Dict[str, str]]=None, - api_key_prefix: Optional[Dict[str, str]]=None, - username: Optional[str]=None, - password: Optional[str]=None, - access_token: Optional[str]=None, - server_index: Optional[int]=None, - server_variables: Optional[ServerVariablesT]=None, - server_operation_index: Optional[Dict[int, int]]=None, - server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, - ignore_operation_servers: bool=False, - ssl_ca_cert: Optional[str]=None, - retries: Optional[int] = None, - ca_cert_data: Optional[Union[str, bytes]] = None, - *, - debug: Optional[bool] = None, + self, + authenticator: Authenticator, + ssl_ca_cert: Optional[str] = None, + retries: Optional[int] = None, + ca_cert_data: Optional[Union[str, bytes]] = None, + *, + debug: Optional[bool] = None, ) -> None: """Constructor """ - self._base_path = "http://localhost:8080" if host is None else host - """Default Base url - """ - self.server_index = 0 if server_index is None and host is None else server_index - self.server_operation_index = server_operation_index or {} - """Default server index - """ - self.server_variables = server_variables or {} - self.server_operation_variables = server_operation_variables or {} - """Default server variables - """ - self.ignore_operation_servers = ignore_operation_servers - """Ignore operation servers - """ - self.temp_folder_path = None - """Temp file folder for downloading files - """ - # Authentication Settings - self.api_key = {} - if api_key: - self.api_key = api_key - """dict to store API key(s) - """ + self.authenticator = authenticator self.api_key_prefix = {} - if api_key_prefix: - self.api_key_prefix = api_key_prefix - """dict to store API prefix (e.g. Bearer) - """ self.refresh_api_key_hook = None - """function hook to refresh API key if expired - """ - self.username = username - """Username for HTTP basic authentication - """ - self.password = password - """Password for HTTP basic authentication - """ - self.access_token = access_token - """Access token - """ - self.logger = {} - """Logging Settings - """ - self.logger["package_logger"] = logging.getLogger("zitadel_client") - self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger = {"package_logger": logging.getLogger("zitadel_client"), + "urllib3_logger": logging.getLogger("urllib3")} self.logger_format = '%(asctime)s %(levelname)s %(message)s' - """Log format - """ self.logger_stream_handler = None - """Log stream handler - """ self.logger_file_handler: Optional[FileHandler] = None - """Log file handler - """ self.logger_file = None - """Debug file location - """ if debug is not None: self.debug = debug else: self.__debug = False - """Debug switch - """ - self.verify_ssl = True - """SSL/TLS verification - Set this to false to skip verifying SSL certificate when calling API - from https server. - """ self.ssl_ca_cert = ssl_ca_cert - """Set this to customize the certificate file to verify the peer. - """ self.ca_cert_data = ca_cert_data - """Set this to verify the peer using PEM (str) or DER (bytes) - certificate data. - """ self.cert_file = None - """client certificate file - """ self.key_file = None - """client key file - """ self.assert_hostname = None - """Set this to True/False to enable/disable SSL hostname verification. - """ self.tls_server_name = None - """SSL/TLS Server Name Indication (SNI) - Set this to the SNI value expected by the server. - """ self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved @@ -289,33 +85,16 @@ def __init__( """ self.proxy: Optional[str] = None - """Proxy URL - """ self.proxy_headers = None - """Proxy headers - """ self.safe_chars_for_path_param = '' - """Safe chars for path_param - """ self.retries = retries - """Adding retries to override urllib3 default value 3 - """ # Enable client side validation self.client_side_validation = True - self.socket_options = None - """Options to pass down to the underlying urllib3 socket - """ - self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" - """datetime format - """ - self.date_format = "%Y-%m-%d" - """date format - """ - def __deepcopy__(self, memo: Dict[int, Any]) -> Self: + def __deepcopy__(self, memo: Dict[int, Any]) -> Self: cls = self.__class__ result = cls.__new__(cls) memo[id(self)] = result @@ -343,30 +122,6 @@ def set_default(cls, default: Optional[Self]) -> None: """ cls._default = default - @classmethod - def get_default_copy(cls) -> Self: - """Deprecated. Please use `get_default` instead. - - Deprecated. Please use `get_default` instead. - - :return: The configuration object. - """ - return cls.get_default() - - @classmethod - def get_default(cls) -> Self: - """Return the default configuration. - - This method returns newly created, based on default constructor, - object of Configuration class or returns a copy of default - configuration. - - :return: The configuration object. - """ - if cls._default is None: - cls._default = cls() - return cls._default - @property def logger_file(self) -> Optional[str]: """The logger file. @@ -452,130 +207,20 @@ def logger_format(self, value: str) -> None: self.__logger_format = value self.logger_formatter = logging.Formatter(self.__logger_format) - def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]: - """Gets API key (with prefix if set). - - :param identifier: The identifier of apiKey. - :param alias: The alternative identifier of apiKey. - :return: The token for api key authentication. - """ - if self.refresh_api_key_hook is not None: - self.refresh_api_key_hook(self) - key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) - if key: - prefix = self.api_key_prefix.get(identifier) - if prefix: - return "%s %s" % (prefix, key) - else: - return key - - return None - - def get_basic_auth_token(self) -> Optional[str]: - """Gets HTTP basic authentication header (string). - - :return: The token for basic HTTP authentication. - """ - username = "" - if self.username is not None: - username = self.username - password = "" - if self.password is not None: - password = self.password - return urllib3.util.make_headers( - basic_auth=username + ':' + password - ).get('authorization') - - def auth_settings(self)-> AuthSettings: - """Gets Auth Settings dict for api client. - - :return: The Auth Settings information dict. - """ - auth: AuthSettings = {} - if self.access_token is not None: - auth['zitadelAccessToken'] = { - 'type': 'bearer', - 'in': 'header', - 'key': 'Authorization', - 'value': 'Bearer ' + self.access_token - } - return auth - - def to_debug_report(self) -> str: + @staticmethod + def to_debug_report() -> str: """Gets the essential information for debugging. :return: The report for debugging. """ - return "Python SDK Debug Report:\n"\ - "OS: {env}\n"\ - "Python Version: {pyversion}\n"\ - "Version of the API: 1.0.0\n"\ - "SDK Package Version: 0.0.1".\ - format(env=sys.platform, pyversion=sys.version) - - def get_host_settings(self) -> List[HostSetting]: - """Gets an array of host settings - - :return: An array of host settings - """ - return [ - { - 'url': "http://localhost:8080", - 'description': "No description provided", - } - ] - - def get_host_from_settings( - self, - index: Optional[int], - variables: Optional[ServerVariablesT]=None, - servers: Optional[List[HostSetting]]=None, - ) -> str: - """Gets host URL based on the index and variables - :param index: array index of the host settings - :param variables: hash of variable and the corresponding value - :param servers: an array of host settings or None - :return: URL based on host settings - """ - if index is None: - return self._base_path - - variables = {} if variables is None else variables - servers = self.get_host_settings() if servers is None else servers - - try: - server = servers[index] - except IndexError: - raise ValueError( - "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers))) - - url = server['url'] - - # go through variables and replace placeholders - for variable_name, variable in server.get('variables', {}).items(): - used_value = variables.get( - variable_name, variable['default_value']) - - if 'enum_values' in variable \ - and used_value not in variable['enum_values']: - raise ValueError( - "The variable `{0}` in the host URL has invalid value " - "{1}. Must be {2}.".format( - variable_name, variables[variable_name], - variable['enum_values'])) - - url = url.replace("{" + variable_name + "}", used_value) - - return url + return "Python SDK Debug Report:\n" \ + "OS: {env}\n" \ + "Python Version: {pyversion}\n" \ + "Version of the API: 1.0.0\n" \ + "SDK Package Version: 0.0.1". \ + format(env=sys.platform, pyversion=sys.version) @property def host(self) -> str: """Return generated host.""" - return self.get_host_from_settings(self.server_index, variables=self.server_variables) - - @host.setter - def host(self, value: str) -> None: - """Fix base path.""" - self._base_path = value - self.server_index = None + return self.authenticator.get_host() diff --git a/zitadel_client/exceptions.py b/zitadel_client/exceptions.py index 3b49b898..9e517e33 100644 --- a/zitadel_client/exceptions.py +++ b/zitadel_client/exceptions.py @@ -1,216 +1,205 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - from typing import Any, Optional + from typing_extensions import Self + class OpenApiException(Exception): - """The base exception class for all OpenAPIExceptions""" + """The base exception class for all OpenAPIExceptions""" class ApiTypeError(OpenApiException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None) -> None: - """ Raises an exception for TypeErrors - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list): a list of keys an indices to get to the - current_item - None if unset - valid_classes (tuple): the primitive classes that current item - should be an instance of - None if unset - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None) -> None: + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item None if unset - """ - self.path_to_item = path_to_item - self.valid_classes = valid_classes - self.key_type = key_type - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiTypeError, self).__init__(full_msg) + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None) -> None: - """ - Args: - msg (str): the exception message + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message - Keyword Args: - path_to_item (list) the path to the exception in the - received_data dict. None if unset - """ + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiValueError, self).__init__(full_msg) + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None) -> None: - """ - Raised when an attribute reference or assignment fails. + def __init__(self, msg, path_to_item=None) -> None: + """ + Raised when an attribute reference or assignment fails. - Args: - msg (str): the exception message + Args: + msg (str): the exception message - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiAttributeError, self).__init__(full_msg) + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None) -> None: - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiKeyError, self).__init__(full_msg) + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) class ApiException(OpenApiException): - def __init__( - self, - status=None, - reason=None, - http_resp=None, - *, - body: Optional[str] = None, - data: Optional[Any] = None, - ) -> None: - self.status = status - self.reason = reason - self.body = body - self.data = data - self.headers = None - - if http_resp: - if self.status is None: - self.status = http_resp.status - if self.reason is None: - self.reason = http_resp.reason - if self.body is None: - try: - self.body = http_resp.data.decode('utf-8') - except Exception: - pass - self.headers = http_resp.getheaders() - - @classmethod - def from_response( - cls, - *, - http_resp, - body: Optional[str], - data: Optional[Any], - ) -> Self: - if http_resp.status == 400: - raise BadRequestException(http_resp=http_resp, body=body, data=data) - - if http_resp.status == 401: - raise UnauthorizedException(http_resp=http_resp, body=body, data=data) - - if http_resp.status == 403: - raise ForbiddenException(http_resp=http_resp, body=body, data=data) - - if http_resp.status == 404: - raise NotFoundException(http_resp=http_resp, body=body, data=data) - - # Added new conditions for 409 and 422 - if http_resp.status == 409: - raise ConflictException(http_resp=http_resp, body=body, data=data) - - if http_resp.status == 422: - raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) - - if 500 <= http_resp.status <= 599: - raise ServiceException(http_resp=http_resp, body=body, data=data) - raise ApiException(http_resp=http_resp, body=body, data=data) - - def __str__(self): - """Custom error messages for exception""" - error_message = "({0})\n"\ - "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) - - if self.data or self.body: - error_message += "HTTP response body: {0}\n".format(self.data or self.body) - - return error_message + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + + if http_resp: + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass + self.headers = http_resp.getheaders() + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n" \ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.data or self.body: + error_message += "HTTP response body: {0}\n".format(self.data or self.body) + + return error_message class BadRequestException(ApiException): - pass + pass class NotFoundException(ApiException): - pass + pass class UnauthorizedException(ApiException): - pass + pass class ForbiddenException(ApiException): - pass + pass class ServiceException(ApiException): - pass + pass class ConflictException(ApiException): - """Exception for HTTP 409 Conflict.""" - pass + """Exception for HTTP 409 Conflict.""" + pass class UnprocessableEntityException(ApiException): - """Exception for HTTP 422 Unprocessable Entity.""" - pass + """Exception for HTTP 422 Unprocessable Entity.""" + pass def render_path(path_to_item): - """Returns a string representation of a path""" - result = "" - for pth in path_to_item: - if isinstance(pth, int): - result += "[{0}]".format(pth) - else: - result += "['{0}']".format(pth) - return result + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/zitadel_client/rest.py b/zitadel_client/rest.py index f73b85d8..0522f9bd 100644 --- a/zitadel_client/rest.py +++ b/zitadel_client/rest.py @@ -1,17 +1,3 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - import io import json import re @@ -26,233 +12,232 @@ def is_socks_proxy_url(url): - if url is None: - return False - split_section = url.split("://") - if len(split_section) < 2: - return False - else: - return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES + if url is None: + return False + split_section = url.split("://") + if len(split_section) < 2: + return False + else: + return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES class RESTResponse(io.IOBase): - def __init__(self, resp) -> None: - self.response = resp - self.status = resp.status - self.reason = resp.reason - self.data = None + def __init__(self, resp) -> None: + self.response = resp + self.status = resp.status + self.reason = resp.reason + self.data = None - def read(self): - if self.data is None: - self.data = self.response.data - return self.data + def read(self): + if self.data is None: + self.data = self.response.data + return self.data - def getheaders(self): - """Returns a dictionary of the response headers.""" - return self.response.headers + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.response.headers - def getheader(self, name, default=None): - """Returns a given response header.""" - return self.response.headers.get(name, default) + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.response.headers.get(name, default) class RESTClientObject: - def __init__(self, configuration) -> None: - # urllib3.PoolManager will pass all kw parameters to connectionpool - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 - - # cert_reqs - if configuration.verify_ssl: - cert_reqs = ssl.CERT_REQUIRED - else: - cert_reqs = ssl.CERT_NONE - - pool_args = { - "cert_reqs": cert_reqs, - "ca_certs": configuration.ssl_ca_cert, - "cert_file": configuration.cert_file, - "key_file": configuration.key_file, - "ca_cert_data": configuration.ca_cert_data, - } - if configuration.assert_hostname is not None: - pool_args['assert_hostname'] = ( - configuration.assert_hostname - ) - - if configuration.retries is not None: - pool_args['retries'] = configuration.retries - - if configuration.tls_server_name: - pool_args['server_hostname'] = configuration.tls_server_name - + def __init__(self, configuration) -> None: + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 - if configuration.socket_options is not None: - pool_args['socket_options'] = configuration.socket_options - - if configuration.connection_pool_maxsize is not None: - pool_args['maxsize'] = configuration.connection_pool_maxsize - - # https pool manager - self.pool_manager: urllib3.PoolManager - - if configuration.proxy: - if is_socks_proxy_url(configuration.proxy): - from urllib3.contrib.socks import SOCKSProxyManager - pool_args["proxy_url"] = configuration.proxy - pool_args["headers"] = configuration.proxy_headers - self.pool_manager = SOCKSProxyManager(**pool_args) - else: - pool_args["proxy_url"] = configuration.proxy - pool_args["proxy_headers"] = configuration.proxy_headers - self.pool_manager = urllib3.ProxyManager(**pool_args) + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + pool_args = { + "cert_reqs": cert_reqs, + "ca_certs": configuration.ssl_ca_cert, + "cert_file": configuration.cert_file, + "key_file": configuration.key_file, + "ca_cert_data": configuration.ca_cert_data, + } + if configuration.assert_hostname is not None: + pool_args['assert_hostname'] = ( + configuration.assert_hostname + ) + + if configuration.retries is not None: + pool_args['retries'] = configuration.retries + + if configuration.tls_server_name: + pool_args['server_hostname'] = configuration.tls_server_name + + if configuration.socket_options is not None: + pool_args['socket_options'] = configuration.socket_options + + if configuration.connection_pool_maxsize is not None: + pool_args['maxsize'] = configuration.connection_pool_maxsize + + # https pool manager + self.pool_manager: urllib3.PoolManager + + if configuration.proxy: + if is_socks_proxy_url(configuration.proxy): + from urllib3.contrib.socks import SOCKSProxyManager + pool_args["proxy_url"] = configuration.proxy + pool_args["headers"] = configuration.proxy_headers + self.pool_manager = SOCKSProxyManager(**pool_args) + else: + pool_args["proxy_url"] = configuration.proxy + pool_args["proxy_headers"] = configuration.proxy_headers + self.pool_manager = urllib3.ProxyManager(**pool_args) + else: + self.pool_manager = urllib3.PoolManager(**pool_args) + + def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): + """Perform requests. + + :param method: http request method + :param url: http request url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] + + if post_params and body: + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, float)): + timeout = urllib3.Timeout(total=_request_timeout) + elif ( + isinstance(_request_timeout, tuple) + and len(_request_timeout) == 2 + ): + timeout = urllib3.Timeout( + connect=_request_timeout[0], + read=_request_timeout[1] + ) + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + + # no content type provided or payload is json + content_type = headers.get('Content-Type') + if ( + not content_type + or re.search('json', content_type, re.IGNORECASE) + ): + request_body = None + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, + url, + body=request_body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif content_type == 'application/x-www-form-urlencoded': + r = self.pool_manager.request( + method, + url, + fields=post_params, + encode_multipart=False, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif content_type == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + # Ensures that dict objects are serialized + post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a, b) for a, b in post_params] + r = self.pool_manager.request( + method, + url, + fields=post_params, + encode_multipart=True, + timeout=timeout, + headers=headers, + preload_content=False + ) + # Pass a `string` parameter directly in the body to support + # other content types than JSON when `body` argument is + # provided in serialized form. + elif isinstance(body, str) or isinstance(body, bytes): + r = self.pool_manager.request( + method, + url, + body=body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif headers['Content-Type'].startswith('text/') and isinstance(body, bool): + request_body = "true" if body else "false" + r = self.pool_manager.request( + method, + url, + body=request_body, + preload_content=False, + timeout=timeout, + headers=headers) else: - self.pool_manager = urllib3.PoolManager(**pool_args) - - def request( - self, - method, - url, - headers=None, - body=None, - post_params=None, - _request_timeout=None - ): - """Perform requests. - - :param method: http request method - :param url: http request url - :param headers: http request headers - :param body: request json body, for `application/json` - :param post_params: request post parameters, - `application/x-www-form-urlencoded` - and `multipart/form-data` - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - """ - method = method.upper() - assert method in [ - 'GET', - 'HEAD', - 'DELETE', - 'POST', - 'PUT', - 'PATCH', - 'OPTIONS' - ] - - if post_params and body: - raise ApiValueError( - "body parameter cannot be used with post_params parameter." - ) - - post_params = post_params or {} - headers = headers or {} - - timeout = None - if _request_timeout: - if isinstance(_request_timeout, (int, float)): - timeout = urllib3.Timeout(total=_request_timeout) - elif ( - isinstance(_request_timeout, tuple) - and len(_request_timeout) == 2 - ): - timeout = urllib3.Timeout( - connect=_request_timeout[0], - read=_request_timeout[1] - ) - - try: - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - - # no content type provided or payload is json - content_type = headers.get('Content-Type') - if ( - not content_type - or re.search('json', content_type, re.IGNORECASE) - ): - request_body = None - if body is not None: - request_body = json.dumps(body) - r = self.pool_manager.request( - method, - url, - body=request_body, - timeout=timeout, - headers=headers, - preload_content=False - ) - elif content_type == 'application/x-www-form-urlencoded': - r = self.pool_manager.request( - method, - url, - fields=post_params, - encode_multipart=False, - timeout=timeout, - headers=headers, - preload_content=False - ) - elif content_type == 'multipart/form-data': - # must del headers['Content-Type'], or the correct - # Content-Type which generated by urllib3 will be - # overwritten. - del headers['Content-Type'] - # Ensures that dict objects are serialized - post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params] - r = self.pool_manager.request( - method, - url, - fields=post_params, - encode_multipart=True, - timeout=timeout, - headers=headers, - preload_content=False - ) - # Pass a `string` parameter directly in the body to support - # other content types than JSON when `body` argument is - # provided in serialized form. - elif isinstance(body, str) or isinstance(body, bytes): - r = self.pool_manager.request( - method, - url, - body=body, - timeout=timeout, - headers=headers, - preload_content=False - ) - elif headers['Content-Type'].startswith('text/') and isinstance(body, bool): - request_body = "true" if body else "false" - r = self.pool_manager.request( - method, - url, - body=request_body, - preload_content=False, - timeout=timeout, - headers=headers) - else: - # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided arguments. Please check that your arguments match declared content type.""" - raise ApiException(status=0, reason=msg) - # For `GET`, `HEAD` - else: - r = self.pool_manager.request( - method, - url, - fields={}, - timeout=timeout, - headers=headers, - preload_content=False - ) - except urllib3.exceptions.SSLError as e: - msg = "\n".join([type(e).__name__, str(e)]) - raise ApiException(status=0, reason=msg) - - return RESTResponse(r) + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request( + method, + url, + fields={}, + timeout=timeout, + headers=headers, + preload_content=False + ) + except urllib3.exceptions.SSLError as e: + msg = "\n".join([type(e).__name__, str(e)]) + raise ApiException(status=0, reason=msg) + + return RESTResponse(r) diff --git a/zitadel_client/zitadel.py b/zitadel_client/zitadel.py index 5c429992..a760fe11 100644 --- a/zitadel_client/zitadel.py +++ b/zitadel_client/zitadel.py @@ -3,40 +3,79 @@ from zitadel_client.api.oidc_service_api import OIDCServiceApi from zitadel_client.api.organization_service_api import OrganizationServiceApi from zitadel_client.api.session_service_api import SessionServiceApi -from zitadel_client.api.settings_api import SettingsApi from zitadel_client.api.settings_service_api import SettingsServiceApi from zitadel_client.api.user_service_api import UserServiceApi -from zitadel_client.configuration import Configuration from zitadel_client.api_client import ApiClient +from zitadel_client.auth.authenticator import Authenticator +from zitadel_client.configuration import Configuration + class Zitadel: - def __init__(self, host: str, access_token: str, mutate_config: callable = None): - """ - Initialize the Zitadel SDK with the provided host and access token. - - Parameters: - - host: The base URL of the Zitadel API. - - access_token: The access token for authenticating API requests. - """ - self.configuration = Configuration( - host = host, - access_token = access_token - ) - - if mutate_config: - mutate_config(self.configuration) - - self.client = ApiClient(configuration = self.configuration) - self.features = FeatureServiceApi(self.client) - self.idps = IdentityProviderServiceApi(self.client) - self.oidc = OIDCServiceApi(self.client) - self.organizations = OrganizationServiceApi(self.client) - self.sessions = SessionServiceApi(self.client) - self.settings = SettingsServiceApi(self.client) - self.users = UserServiceApi(self.client) - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - pass + """ + Main entry point for the Zitadel SDK. + + This class initializes and configures the SDK with the provided authentication strategy. + It sets up service APIs for interacting with various Zitadel features such as identity providers, + organizations, sessions, settings, users, and more. + + Attributes: + configuration (Configuration): The configuration instance containing authentication and endpoint details. + client (ApiClient): The API client used for making HTTP requests to the Zitadel API. + features (FeatureServiceApi): Service API for feature management. + idps (IdentityProviderServiceApi): Service API for identity provider operations. + oidc (OIDCServiceApi): Service API for OIDC-related operations. + organizations (OrganizationServiceApi): Service API for organization-related operations. + sessions (SessionServiceApi): Service API for session management. + settings (SettingsServiceApi): Service API for settings management. + users (UserServiceApi): Service API for user management. + """ + + def __init__(self, authenticator: Authenticator, mutate_config: callable = None): + """ + Initialize the Zitadel SDK. + + This constructor creates a configuration instance using the provided authenticator. + Optionally, the configuration can be modified via the `mutate_config` callback function. + It then instantiates the underlying API client and initializes various service APIs. + + Args: + authenticator (Authenticator): The authentication strategy to be used. + mutate_config (callable, optional): A callback function that receives the configuration + instance for any additional modifications before the API client is created. + Defaults to None. + """ + self.configuration = Configuration(authenticator) + + if mutate_config: + mutate_config(self.configuration) + + self.client = ApiClient(configuration=self.configuration) + self.features = FeatureServiceApi(self.client) + self.idps = IdentityProviderServiceApi(self.client) + self.oidc = OIDCServiceApi(self.client) + self.organizations = OrganizationServiceApi(self.client) + self.sessions = SessionServiceApi(self.client) + self.settings = SettingsServiceApi(self.client) + self.users = UserServiceApi(self.client) + + def __enter__(self): + """ + Enter the runtime context related to the Zitadel instance. + + Returns: + Zitadel: The current instance. + """ + return self + + def __exit__(self, exc_type, exc_value, traceback): + """ + Exit the runtime context. + + This method can be used to perform cleanup actions. Currently, it does nothing. + + Args: + exc_type: The exception type, if an exception occurred. + exc_value: The exception value, if an exception occurred. + traceback: The traceback of the exception, if an exception occurred. + """ + pass From c8ef007f1c1701c8a24220250e8fab82410f0e47 Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Mon, 7 Apr 2025 17:57:59 +0300 Subject: [PATCH 02/21] Intial commit for adding support for other authentication strategies --- zitadel_client/auth/authenticator.py | 82 ++++++----- zitadel_client/auth/client_credentials.py | 49 ------ .../auth/client_credentials_authenticator.py | 81 ++++++++++ zitadel_client/auth/jwt_auth.py | 121 --------------- zitadel_client/auth/no_auth.py | 42 ------ zitadel_client/auth/no_auth_authenticator.py | 28 ++++ zitadel_client/auth/oauth_authenticator.py | 74 ++++++++++ zitadel_client/auth/oauth_base.py | 57 ------- zitadel_client/auth/open_id.py | 51 +++++++ zitadel_client/auth/personal_access.py | 43 ------ .../personal_access_token_authenticator.py | 24 +++ .../auth/web_token_authenticator.py | 139 ++++++++++++++++++ zitadel_client/utils/__init__.py | 0 zitadel_client/utils/url_util.py | 12 ++ 14 files changed, 456 insertions(+), 347 deletions(-) delete mode 100644 zitadel_client/auth/client_credentials.py create mode 100644 zitadel_client/auth/client_credentials_authenticator.py delete mode 100644 zitadel_client/auth/jwt_auth.py delete mode 100644 zitadel_client/auth/no_auth.py create mode 100644 zitadel_client/auth/no_auth_authenticator.py create mode 100644 zitadel_client/auth/oauth_authenticator.py delete mode 100644 zitadel_client/auth/oauth_base.py create mode 100644 zitadel_client/auth/open_id.py delete mode 100644 zitadel_client/auth/personal_access.py create mode 100644 zitadel_client/auth/personal_access_token_authenticator.py create mode 100644 zitadel_client/auth/web_token_authenticator.py create mode 100644 zitadel_client/utils/__init__.py create mode 100644 zitadel_client/utils/url_util.py diff --git a/zitadel_client/auth/authenticator.py b/zitadel_client/auth/authenticator.py index fca32f76..7a44973d 100644 --- a/zitadel_client/auth/authenticator.py +++ b/zitadel_client/auth/authenticator.py @@ -1,65 +1,77 @@ from abc import ABC, abstractmethod +from datetime import datetime, timezone +from typing import Dict + +from zitadel_client.auth.open_id import OpenId class Authenticator(ABC): """ - Abstract base class for authentication strategies. - - This class defines a common interface for implementing various - authentication mechanisms. Subclasses must implement the - `get_auth_headers` method to provide the necessary HTTP headers for - authenticated API requests, as well as the `refresh_token` method for - refreshing authentication tokens when needed. + Abstract base class for authenticators. - Attributes: - host (str): The base URL for authentication endpoints. + This class defines the basic structure for any authenticator by requiring the implementation + of a method to retrieve authentication headers, and provides a way to store and retrieve the host. """ def __init__(self, host: str): """ - Initialize the Authenticator with a host URL. + Initializes the Authenticator with the specified host. - Args: - host (str): The base URL for all authentication endpoints. + :param host: The base URL or endpoint for the service. """ self.host = host @abstractmethod - def get_auth_headers(self) -> dict[str, str]: + def get_auth_headers(self) -> Dict[str, str]: """ - Generate and return the authentication headers required for API requests. + Retrieves the authentication headers to be sent with requests. - Subclasses must implement this method to return a dictionary where the keys - are the header names and the values are the corresponding header values. + Subclasses must override this method to return the appropriate headers. - Returns: - dict[str, str]: A dictionary containing the authentication header(s). + :return: A dictionary mapping header names to their values. """ pass - @abstractmethod - def refresh_token(self) -> None: + def get_host(self) -> str: + """ + Returns the stored host. + + :return: The host as a string. """ - Refresh the authentication token. + return self.host + + +class Token: + def __init__(self, access_token: str, expires_at: datetime): + self.access_token = access_token + self.expires_at = expires_at + + def is_expired(self) -> bool: + return datetime.now(timezone.utc) >= self.expires_at - This abstract method must be implemented by subclasses that require a mechanism - to refresh the authentication token. The implementation should update the token - used by the authenticator. - Returns: - None +class OAuthAuthenticatorBuilder(ABC): + """ + Abstract builder class for constructing OAuth authenticator instances. + + This builder provides common configuration options such as the OpenId instance and authentication scopes. + """ + + def __init__(self, host: str): """ - pass + Initializes the OAuthAuthenticatorBuilder with a given host. - def get_host(self) -> str: + :param host: The base URL for the OAuth provider. """ - Retrieve the base host URL. + self.open_id = OpenId(host) + self.auth_scopes = "openid urn:zitadel:iam:org:project:id:zitadel:aud" - This method returns the host URL that was specified during the instantiation - of the Authenticator. It can be used by concrete classes or external consumers - to build full endpoint URLs. + def scopes(self, auth_scopes: set) -> "OAuthAuthenticatorBuilder": + """ + Sets the authentication scopes for the OAuth authenticator. - Returns: - str: The base URL for authentication endpoints. + :param auth_scopes: A set of scope strings. + :return: The builder instance to allow for method chaining. """ - return self.host + self.auth_scopes = " ".join(auth_scopes) + return self diff --git a/zitadel_client/auth/client_credentials.py b/zitadel_client/auth/client_credentials.py deleted file mode 100644 index 371a19dd..00000000 --- a/zitadel_client/auth/client_credentials.py +++ /dev/null @@ -1,49 +0,0 @@ -from authlib.integrations.requests_client import OAuth2Session - -from .oauth_base import OAuthAuthenticator - - -class ClientCredentialsAuthenticator(OAuthAuthenticator): - """ - An Authenticator implementation using the OAuth2 client credentials grant. - - This class leverages the Authlib library to perform the client credentials flow. - It retrieves an access token from the token endpoint and provides it as part of the - authentication header for subsequent API requests. - """ - - def __init__( - self, - host: str, - client_id: str, - client_secret: str, - token_url: str = "/oauth/v2/token", - scope: str = "openid urn:zitadel:iam:org:project:id:myprojectid:aud additional_scope" # FIXME - ): - """ - Initialize the ClientCredentialsAuthenticator with client credentials. - - Args: - host (str): The base URL for the API endpoints. - client_id (str): The OAuth2 client identifier. - client_secret (str): The OAuth2 client secret. - token_url (str, optional): The URL of the OAuth2 token endpoint. - Defaults to "/oauth/v2/token". - scope (str, optional): The scope for the token request. - Defaults to a string containing "openid" and additional required scopes. - """ - # If token_url is relative, prepend the host. - super().__init__(host, client_id, token_url, scope) - self.client_secret = client_secret - self.session = OAuth2Session(client_id, client_secret=client_secret, scope=scope) - - def refresh_token(self) -> None: - """ - Refresh the access token using the OAuth2 client credentials grant. - - This method fetches a new access token from the token endpoint using the - client credentials and updates the stored token. - """ - self.token = self.session.fetch_token( - grant_type="client_credentials" - ) diff --git a/zitadel_client/auth/client_credentials_authenticator.py b/zitadel_client/auth/client_credentials_authenticator.py new file mode 100644 index 00000000..09efd3ab --- /dev/null +++ b/zitadel_client/auth/client_credentials_authenticator.py @@ -0,0 +1,81 @@ +from typing import override + +from authlib.integrations.requests_client import OAuth2Session + +from zitadel_client.auth.authenticator import OAuthAuthenticatorBuilder +from zitadel_client.auth.oauth_authenticator import OAuthAuthenticator +from zitadel_client.auth.open_id import OpenId + + +class ClientCredentialsAuthenticator(OAuthAuthenticator): + """ + OAuth authenticator implementing the client credentials flow. + + Uses client_id and client_secret to obtain an access token from the OAuth2 token endpoint. + """ + + def __init__(self, open_id: OpenId, client_id: str, client_secret: str, auth_scopes: str): + """ + Constructs a ClientCredentialsAuthenticator. + + :param open_id: The base URL for the OAuth provider. + :param client_id: The OAuth client identifier. + :param client_secret: The OAuth client secret. + :param auth_scopes: The scope(s) for the token request. + """ + super().__init__(open_id, OAuth2Session(client_id=client_id, client_secret=client_secret, scope=auth_scopes)) + + @override + def get_grant(self) -> dict: + """ + Returns the grant parameters for the client credentials flow. + + :return: A dictionary with the grant type for client credentials. + """ + return {"grant_type": "client_credentials"} + + @staticmethod + def builder(host: str, client_id: str, client_secret: str) -> "ClientCredentialsAuthenticatorBuilder": + """ + Returns a builder for constructing a ClientCredentialsAuthenticator. + + :param host: The base URL for the OAuth provider. + :param client_id: The OAuth client identifier. + :param client_secret: The OAuth client secret. + :return: A ClientCredentialsAuthenticatorBuilder instance. + """ + return ClientCredentialsAuthenticatorBuilder(host, client_id, client_secret) + + +class ClientCredentialsAuthenticatorBuilder(OAuthAuthenticatorBuilder): + """ + Builder class for constructing ClientCredentialsAuthenticator instances. + + This builder extends the OAuthAuthenticatorBuilder with client credentials (client_id and client_secret) + required for the client credentials flow. + """ + + def __init__(self, host: str, client_id: str, client_secret: str): + """ + Initializes the ClientCredentialsAuthenticatorBuilder with host, client ID, and client secret. + + :param host: The base URL for the OAuth provider. + :param client_id: The OAuth client identifier. + :param client_secret: The OAuth client secret. + """ + super().__init__(host) + self.client_id = client_id + self.client_secret = client_secret + + def build(self) -> ClientCredentialsAuthenticator: + """ + Constructs and returns a ClientCredentialsAuthenticator instance using the configured parameters. + + :return: A configured ClientCredentialsAuthenticator. + """ + return ClientCredentialsAuthenticator( + self.open_id, # OpenId instance with endpoint info (constructed from host) + self.client_id, # OAuth client identifier + self.client_secret, # OAuth client secret + self.auth_scopes # Authentication scopes configured in the builder + ) diff --git a/zitadel_client/auth/jwt_auth.py b/zitadel_client/auth/jwt_auth.py deleted file mode 100644 index 347c2bb3..00000000 --- a/zitadel_client/auth/jwt_auth.py +++ /dev/null @@ -1,121 +0,0 @@ -import json -import time - -from authlib.integrations.requests_client import OAuth2Session -from authlib.jose import jwt - -from zitadel_client.auth.oauth_base import OAuthAuthenticator - - -class JWTAuthenticator(OAuthAuthenticator): - """ - An Authenticator implementation using JWT-based authentication (RFC7523). - - This strategy leverages Authlib's JOSE support to create a JWT assertion, - which is then exchanged for an access token via the token endpoint using - the JWT bearer grant. - """ - - def __init__(self, host: str, client_id: str, issuer: str, subject: str, - audience: str, private_key: str, token_url: str = "/oauth/v2/token", algorithm: str = "RS256", - token_lifetime: int = 300): - """ - Initialize the JWTAuthenticator with the required credentials and claims. - - Args: - host (str): The base URL for the API endpoints. - client_id (str): The OAuth2 client identifier. - token_url (str): The URL of the OAuth2 token endpoint. - issuer (str): The issuer claim for the JWT. - subject (str): The subject claim for the JWT. - audience (str): The audience claim, typically the token endpoint URL. - private_key (str): The private key used to sign the JWT. - algorithm (str, optional): The signing algorithm. Defaults to "RS256". - token_lifetime (int, optional): Lifetime of the JWT in seconds. Defaults to 300. - """ - # token_url might be relative - super().__init__(host, client_id, token_url) - self.issuer = issuer - self.subject = subject - self.audience = audience - self.private_key = private_key - self.algorithm = algorithm - self.token_lifetime = token_lifetime - self.session = OAuth2Session(client_id) - - def _generate_jwt_assertion(self) -> str: - """ - Generate a JWT assertion based on the provided credentials and claims. - - Returns: - str: A signed JWT assertion. - """ - current_time = int(time.time()) - payload = { - "iss": self.issuer, - "sub": self.subject, - "aud": self.audience, - "iat": current_time, - "exp": current_time + self.token_lifetime, - "jti": str(current_time) - } - header = {"alg": self.algorithm, "typ": "JWT"} - assertion = jwt.encode(header, payload, self.private_key) - return assertion.decode("utf-8") if isinstance(assertion, bytes) else assertion - - def refresh_token(self) -> None: - """ - Refresh the access token using a JWT assertion. - - This method generates a new JWT assertion and exchanges it for an access token - via the token endpoint using the JWT bearer grant. - """ - jwt_assertion = self._generate_jwt_assertion() - self.token = self.session.fetch_token( - grant_type="urn:ietf:params:oauth:grant-type:jwt-bearer", - assertion=jwt_assertion, - client_id=self.client_id - ) - - @classmethod - def from_json(cls, json_path: str, host: str, token_url: str, audience: str, - algorithm: str = "RS256", token_lifetime: int = 300): - """ - Initialize a JWTAuthenticator instance from a JSON configuration file. - - The JSON file should have the following structure: - - { - "type": "serviceaccount", - "keyId": "100509901696068329", - "key": "-----BEGIN RSA PRIVATE KEY----- [...] -----END RSA PRIVATE KEY-----\n", - "userId": "100507859606888466" - } - - Args: - json_path (str): The file path to the JSON configuration file. - host (str): The base URL for the API endpoints. - token_url (str): The URL of the OAuth2 token endpoint. - audience (str): The custom domain to be used as the 'aud' claim. - algorithm (str, optional): The signing algorithm. Defaults to "RS256". - token_lifetime (int, optional): Lifetime of the JWT in seconds. Defaults to 300. - - Returns: - JWTAuthenticator: An initialized instance of JWTAuthenticator. - """ - with open(json_path, 'r') as f: - config = json.load(f) - - user_id = config.get("userId") - private_key = config.get("key") - return cls( - host=host, - client_id=user_id, - token_url=token_url, - issuer=user_id, - subject=user_id, - audience=audience, - private_key=private_key, - algorithm=algorithm, - token_lifetime=token_lifetime - ) diff --git a/zitadel_client/auth/no_auth.py b/zitadel_client/auth/no_auth.py deleted file mode 100644 index 751aa950..00000000 --- a/zitadel_client/auth/no_auth.py +++ /dev/null @@ -1,42 +0,0 @@ -from .authenticator import Authenticator - - -class DummyAuthenticator(Authenticator): - """ - Authenticator implementation for testing purposes. - - This strategy does not apply any authentication to API requests. - It is useful for testing environments where authentication is not required. - """ - - def __init__(self, host: str): - """ - Initialize the DummyAuthenticator. - - Args: - host (str): The base URL for all authentication endpoints. - """ - super().__init__(host) - - def refresh_token(self) -> None: - """ - Refresh the authentication token. - - For DummyAuthenticator, token refreshing is not applicable. - This method is implemented as a no-op. - - Returns: - None - """ - pass - - def get_auth_headers(self) -> dict: - """ - Retrieve authentication headers. - - Since no authentication is performed, this method returns an empty dictionary. - - Returns: - dict: An empty dictionary. - """ - return {} diff --git a/zitadel_client/auth/no_auth_authenticator.py b/zitadel_client/auth/no_auth_authenticator.py new file mode 100644 index 00000000..f76eee9f --- /dev/null +++ b/zitadel_client/auth/no_auth_authenticator.py @@ -0,0 +1,28 @@ +from typing import Dict + +from zitadel_client.auth.authenticator import Authenticator + + +class NoAuthAuthenticator(Authenticator): + """ + A simple authenticator that performs no authentication. + + This authenticator is useful for cases where no token or credentials are required. + It simply returns an empty dictionary for authentication headers. + """ + + def __init__(self, host: str = "http://localhost"): + """ + Initializes the NoAuthAuthenticator with a default host. + + :param host: The base URL for the service. Defaults to "http://localhost". + """ + super().__init__(host) + + def get_auth_headers(self) -> Dict[str, str]: + """ + Returns an empty dictionary since no authentication is performed. + + :return: An empty dictionary. + """ + return {} diff --git a/zitadel_client/auth/oauth_authenticator.py b/zitadel_client/auth/oauth_authenticator.py new file mode 100644 index 00000000..29e9f48e --- /dev/null +++ b/zitadel_client/auth/oauth_authenticator.py @@ -0,0 +1,74 @@ +from abc import ABC, abstractmethod +from datetime import datetime, timedelta +from typing import Dict, Optional + +from authlib.integrations.requests_client import OAuth2Session + +from zitadel_client.auth.authenticator import Token, Authenticator + + +class OAuthAuthenticator(Authenticator, ABC): + """ + Base class for OAuth-based authentication using Authlib. + + Attributes: + open_id: An object providing OAuth endpoint information. + oauth_session: An OAuth2Session instance used for fetching tokens. + """ + + def __init__(self, open_id, oauth_session: OAuth2Session): + """ + Constructs an OAuthAuthenticator. + + :param open_id: An object that must implement get_host_endpoint() and get_token_endpoint(). + :param scope: The scope for the token request. + """ + super().__init__(open_id.get_host_endpoint()) + self.open_id = open_id + self.token: Optional[Token] = None + self.oauth_session = oauth_session + + def get_auth_token(self) -> str: + """ + Returns the current access token, refreshing it if necessary. + """ + if self.token is None or self.token.is_expired(): + self.refresh_token() + return self.token.access_token + + def get_auth_headers(self) -> Dict[str, str]: + """ + Retrieves authentication headers. + + :return: A dictionary containing the 'Authorization' header. + """ + return {"Authorization": "Bearer " + self.get_auth_token()} + + @abstractmethod + def get_grant(self) -> dict: + """ + Builds and returns a dictionary of grant parameters required for the token request. + + For example, this might include parameters like grant_type, client_assertion, etc. + """ + pass + + def refresh_token(self) -> Token: + """ + Refreshes the access token using the OAuth flow. + It uses get_grant() to obtain all necessary parameters, such as the grant type and any assertions. + + :return: A new Token. + """ + token_endpoint = self.open_id.get_token_endpoint() + grant_params = self.get_grant() + try: + # fetch_token returns an OAuth2Token (usually a dict-like object) + token_response = self.session.fetch_token(url=token_endpoint, **grant_params) + access_token = token_response["access_token"] + expires_in = token_response.get("expires_in", 3600) + expires_at = datetime.utcnow() + timedelta(seconds=expires_in) + self.token = Token(access_token, expires_at) + return self.token + except Exception as e: + raise Exception("Failed to refresh token: " + str(e)) from e diff --git a/zitadel_client/auth/oauth_base.py b/zitadel_client/auth/oauth_base.py deleted file mode 100644 index 2b17b1ea..00000000 --- a/zitadel_client/auth/oauth_base.py +++ /dev/null @@ -1,57 +0,0 @@ -from authlib.integrations.requests_client import OAuth2Session - -from .authenticator import Authenticator - - -class OAuthAuthenticator(Authenticator): - """ - Abstract base class for OAuth-based authenticators. - - Attributes: - client_id (str): The OAuth2 client identifier. - token_url (str): The URL of the OAuth2 token endpoint. - scope (str): The scope for the token request. - session (OAuth2Session): The OAuth2 session instance used for token management. - token (dict): The most recently retrieved access token. - """ - - def __init__(self, host: str, client_id: str, token_url: str, scope: str = None): - """ - Initialize the OAuthAuthenticator with the basic OAuth2 parameters. - - Args: - host (str): The base URL for the API endpoints. - client_id (str): The OAuth2 client identifier. - token_url (str): The URL of the OAuth2 token endpoint. - scope (str, optional): The scope for the token request. - """ - super().__init__(host) - self.client_id = client_id - self.token_url = f"{host}{token_url}" if token_url.startswith("/") else token_url - self.scope = scope - self.session = OAuth2Session(client_id, scope=scope, token_endpoint=token_url) - self.token = None - - def get_auth_headers(self) -> dict: - """ - Retrieve the authentication headers using the OAuth2 flow. - - This method checks whether a valid access token is available. If no token exists - or if the current token is expired, it refreshes the token by calling `refresh_token()`. - It then returns an HTTP header with the Bearer token. - - Returns: - dict: A dictionary containing the 'Authorization' header. - """ - if not self.token or self.session.token.is_expired(): - self.refresh_token() - return {"Authorization": f"Bearer {self.token['access_token']}"} - - def refresh_token(self) -> None: - """ - Abstract method to refresh the access token. - - Subclasses must implement this method to perform the token refresh using their - specific grant flow. - """ - raise NotImplementedError("Subclasses must implement refresh_token()") diff --git a/zitadel_client/auth/open_id.py b/zitadel_client/auth/open_id.py new file mode 100644 index 00000000..ac4ee281 --- /dev/null +++ b/zitadel_client/auth/open_id.py @@ -0,0 +1,51 @@ +import json +from urllib.parse import urljoin + +import urllib3 + + +class OpenId: + """ + OpenId retrieves OpenID Connect configuration from a given host. + + It builds the well-known configuration URL from the provided hostname, + fetches the configuration, and extracts the token endpoint. + """ + + def __init__(self, hostname: str): + if not (hostname.startswith("http://") or hostname.startswith("https://")): + hostname = "https://" + hostname # Default to HTTPS if no scheme is provided. + self.host_endpoint = hostname + well_known_url = self.build_well_known_url(hostname) + + http = urllib3.PoolManager() + response = http.request("GET", well_known_url) + + if response.status != 200: + raise Exception(f"Failed to fetch OpenID configuration: HTTP {response.status}") + + # Decode and load the JSON response + config = json.loads(response.data.decode('utf-8')) + token_endpoint = config.get("token_endpoint") + if not token_endpoint: + raise Exception("token_endpoint not found in OpenID configuration") + self.token_endpoint = token_endpoint + + @staticmethod + def build_well_known_url(hostname: str) -> str: + """ + Builds the well-known OpenID configuration URL for the given hostname. + """ + return urljoin(hostname, "/.well-known/openid-configuration") + + def get_host_endpoint(self) -> str: + """ + Returns the host endpoint URL. + """ + return self.host_endpoint + + def get_token_endpoint(self) -> str: + """ + Returns the token endpoint URL extracted from the OpenID configuration. + """ + return self.token_endpoint diff --git a/zitadel_client/auth/personal_access.py b/zitadel_client/auth/personal_access.py deleted file mode 100644 index c4d03d55..00000000 --- a/zitadel_client/auth/personal_access.py +++ /dev/null @@ -1,43 +0,0 @@ -from .authenticator import Authenticator - - -class PersonalAccessAuthenticator(Authenticator): - """ - Authenticator implementation using a personal access token. - - This strategy simply injects the personal access token into the HTTP - Authorization header for API requests. - """ - - def __init__(self, host: str, token: str): - """ - Initialize the authenticator with a personal access token. - - Args: - host (str): The base URL for the API endpoints. - token (str): The personal access token to be used for authentication. - """ - super().__init__(host) - self.token = token - - def refresh_token(self) -> None: - """ - Refresh the authentication token. - - For PersonalAccessAuthenticator, token refresh is not applicable as the token - is static. This method is implemented as a no-op. - - Returns: - None - """ - pass - - def get_auth_headers(self) -> dict: - """ - Retrieve authentication headers using the personal access token. - - Returns: - dict: A dictionary with the 'Authorization' header. - Example: {'Authorization': 'Bearer '} - """ - return {"Authorization": f"Bearer {self.token}"} diff --git a/zitadel_client/auth/personal_access_token_authenticator.py b/zitadel_client/auth/personal_access_token_authenticator.py new file mode 100644 index 00000000..75b7be96 --- /dev/null +++ b/zitadel_client/auth/personal_access_token_authenticator.py @@ -0,0 +1,24 @@ +from typing import Dict + +from zitadel_client.auth.authenticator import Authenticator +from zitadel_client.utils.url_util import URLUtil + + +class PersonalAccessTokenAuthenticator(Authenticator): + """ + Personal Access Token Authenticator. + + Uses a static personal access token for API authentication. + """ + + def __init__(self, host: str, token: str): + super().__init__(URLUtil.build_hostname(host)) + self.token = token + + def get_auth_headers(self) -> Dict[str, str]: + """ + Returns the authentication headers using the personal access token. + + :return: A dictionary containing the 'Authorization' header. + """ + return {"Authorization": "Bearer " + self.token} diff --git a/zitadel_client/auth/web_token_authenticator.py b/zitadel_client/auth/web_token_authenticator.py new file mode 100644 index 00000000..d8ed5763 --- /dev/null +++ b/zitadel_client/auth/web_token_authenticator.py @@ -0,0 +1,139 @@ +from datetime import datetime, timedelta, timezone + +from authlib.integrations.requests_client import OAuth2Session +from authlib.jose import jwt, JoseError + +from zitadel_client.auth.authenticator import OAuthAuthenticatorBuilder +from zitadel_client.auth.oauth_authenticator import OAuthAuthenticator +from zitadel_client.auth.open_id import OpenId + + +class JWTAuthenticator(OAuthAuthenticator): + """ + OAuth authenticator implementing the JWT bearer flow. + + This implementation builds a JWT assertion dynamically in get_grant(). + """ + + def __init__(self, open_id: OpenId, auth_scopes: str, + jwt_issuer: str, jwt_subject: str, jwt_audience: str, + private_key: str, jwt_lifetime: timedelta = timedelta(hours=1), jwt_algorithm: str = "RS256"): + """ + Constructs a JWTAuthenticator. + + :param open_id: The base URL for the OAuth provider. + :param auth_scopes: The scope(s) for the token request. + :param jwt_issuer: The JWT issuer. + :param jwt_subject: The JWT subject. + :param jwt_audience: The JWT audience. + :param private_key: The private key used to sign the JWT. + :param jwt_lifetime: Lifetime of the JWT in seconds. + :param jwt_algorithm: The JWT signing algorithm (default "RS256"). + """ + super().__init__(open_id, OAuth2Session(scope=auth_scopes)) + self.jwt_issuer = jwt_issuer + self.jwt_subject = jwt_subject + self.jwt_audience = jwt_audience + self.private_key = private_key + self.jwt_lifetime = jwt_lifetime + self.jwt_algorithm = jwt_algorithm + + def get_grant(self) -> dict: + """ + Builds and returns the grant parameters for the JWT bearer flow. + + Dynamically generates a JWT assertion that includes time-sensitive claims. + + :return: A dictionary with the JWT bearer grant parameters. + :raises Exception: If JWT generation fails. + """ + now = datetime.now(timezone.utc) + try: + return { + "grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer", + "assertion": (jwt.encode({"alg": self.jwt_algorithm, "typ": "JWT"}, { + "iss": self.jwt_issuer, + "sub": self.jwt_subject, + "aud": self.jwt_audience, + "iat": int(now.timestamp()), + "exp": int((now + self.jwt_lifetime).timestamp()) + }, self.private_key, algorithm=self.jwt_algorithm)) + } + except JoseError as e: + raise Exception("Failed to generate JWT assertion: " + str(e)) from e + + @staticmethod + def builder(host: str, user_id: str, private_key: str) -> "JWTAuthenticatorBuilder": + """ + Returns a builder for constructing a JWTAuthenticator. + + :param host: The base URL for the OAuth provider. + :param user_id: The user identifier, used as both the issuer and subject. + :param private_key: The private key used to sign the JWT. + :return: A JWTAuthenticatorBuilder instance. + """ + return JWTAuthenticatorBuilder(host, user_id, user_id, host, private_key) + + +class JWTAuthenticatorBuilder(OAuthAuthenticatorBuilder): + """ + Builder for JWTAuthenticator. + + Provides a fluent API for configuring and constructing a JWTAuthenticator instance. + """ + + def __init__(self, host: str, jwt_issuer: str, jwt_subject: str, jwt_audience: str, private_key: str): + """ + Initializes the JWTAuthenticatorBuilder with required parameters. + + :param host: The base URL for API endpoints. + :param jwt_issuer: The issuer claim for the JWT. + :param jwt_subject: The subject claim for the JWT. + :param jwt_audience: The audience claim for the JWT. + :param private_key: The PEM-formatted private key used for signing the JWT. + """ + super().__init__(host) + self.jwt_issuer = jwt_issuer + self.jwt_subject = jwt_subject + self.jwt_audience = jwt_audience + self.private_key = private_key + self.jwt_lifetime = timedelta(hours=1) + + def token_lifetime_seconds(self, seconds: int) -> "JWTAuthenticatorBuilder": + """ + Sets the JWT token lifetime in seconds. + + :param seconds: Lifetime of the JWT in seconds. + :return: The builder instance. + """ + self.jwt_lifetime = timedelta(seconds=seconds) + return self + + def scopes(self, scopes: set) -> "JWTAuthenticatorBuilder": + """ + Overrides the default scopes for the JWTAuthenticator. + + :param scopes: A set of scope strings. + :return: The builder instance. + """ + self.auth_scopes = " ".join(scopes) + return self + + def build(self) -> JWTAuthenticator: + """ + Builds and returns a new JWTAuthenticator instance using the configured parameters. + + This method inlines the JWT assertion generation logic and passes all required + configuration to the JWTAuthenticator constructor. + + :return: A new JWTAuthenticator instance. + """ + return JWTAuthenticator( + open_id=self.open_id, + auth_scopes=self.auth_scopes, + jwt_issuer=self.jwt_issuer, + jwt_subject=self.jwt_subject, + jwt_audience=self.jwt_audience, + private_key=self.private_key, + jwt_lifetime=self.jwt_lifetime + ) diff --git a/zitadel_client/utils/__init__.py b/zitadel_client/utils/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/zitadel_client/utils/url_util.py b/zitadel_client/utils/url_util.py new file mode 100644 index 00000000..df4b63d6 --- /dev/null +++ b/zitadel_client/utils/url_util.py @@ -0,0 +1,12 @@ +class URLUtil: + @staticmethod + def build_hostname(host: str) -> str: + """ + Processes the host string. This might include cleaning up the input, + adding a protocol, or other logic similar to your Java URLUtil.buildHostname method. + """ + # For example, trim whitespace and ensure the host starts with 'https://' + host = host.strip() + if not host.startswith("http://") and not host.startswith("https://"): + host = "https://" + host + return host From 654e8ea9ec64e6ed423c2ea38cb2ac712d17226b Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Mon, 7 Apr 2025 21:19:13 +0300 Subject: [PATCH 03/21] Added some tests to ensure that the auth works --- .openapi-generator-ignore | 1 + poetry.lock | 343 ++++++++++++++++- pyproject.toml | 1 + test/auth/__init__.py | 0 .../test_client_credentials_authenticator.py | 29 ++ test/auth/test_no_auth_authenticator.py | 15 + test/auth/test_oauth_authenticator.py | 32 ++ .../test_personal_access_authenticator.py | 10 + test/auth/test_web_token_authenticator.py | 38 ++ test/test_add_organization_request_admin.py | 93 ----- ...add_organization_response_created_admin.py | 53 --- test/test_feature_service_api.py | 115 ------ test/test_identity_provider_service_api.py | 38 -- test/test_objectv2_list_details.py | 53 --- test/test_objectv2_list_query.py | 53 --- test/test_oidc_service_api.py | 45 --- .../test_oidc_service_create_callback_body.py | 57 --- test/test_organization_service_api.py | 45 --- test/test_otp_email_send_code.py | 51 --- test/test_protobuf_any.py | 51 --- test/test_request_challenges_otp_email.py | 53 --- test/test_request_challenges_otpsms.py | 51 --- test/test_rpc_status.py | 57 --- test/test_session_service_api.py | 66 ---- ...est_session_service_delete_session_body.py | 51 --- test/test_session_service_set_session_body.py | 81 ---- test/test_settings_api.py | 45 --- test/test_settings_service_api.py | 94 ----- test/test_user_agent_header_values.py | 53 --- test/test_user_service_add_idp_link_body.py | 54 --- test/test_user_service_api.py | 345 ------------------ ...st_user_service_create_invite_code_body.py | 54 --- ...e_create_passkey_registration_link_body.py | 53 --- test/test_user_service_list_idp_links_body.py | 54 --- test/test_user_service_password_reset_body.py | 54 --- ...test_user_service_register_passkey_body.py | 55 --- test/test_user_service_register_u2_f_body.py | 51 --- ...est_user_service_resend_email_code_body.py | 53 --- ...est_user_service_resend_phone_code_body.py | 52 --- ..._retrieve_identity_provider_intent_body.py | 51 --- .../test_user_service_send_email_code_body.py | 53 --- test/test_user_service_set_email_body.py | 56 --- test/test_user_service_set_phone_body.py | 55 --- ...est_user_service_update_human_user_body.py | 78 ---- test/test_user_service_verify_email_body.py | 52 --- ...st_user_service_verify_invite_code_body.py | 52 --- ...ervice_verify_passkey_registration_body.py | 54 --- test/test_user_service_verify_phone_body.py | 52 --- ...r_service_verify_totp_registration_body.py | 52 --- ...r_service_verify_u2_f_registration_body.py | 54 --- test/test_userv2_set_password.py | 60 --- test/test_userv2_type.py | 33 -- test/test_v2_access_token_type.py | 33 -- test/test_v2_add_human_user_request.py | 103 ------ test/test_v2_add_human_user_request1.py | 104 ------ test/test_v2_add_human_user_response.py | 57 --- test/test_v2_add_idp_link_response.py | 54 --- test/test_v2_add_organization_request.py | 98 ----- test/test_v2_add_organization_response.py | 61 ---- test/test_v2_add_otp_email_response.py | 54 --- test/test_v2_add_otpsms_response.py | 54 --- test/test_v2_and_query.py | 90 ----- test/test_v2_apple_config.py | 54 --- test/test_v2_auth_factor.py | 57 --- test/test_v2_auth_factor_state.py | 33 -- test/test_v2_auth_factor_u2_f.py | 52 --- test/test_v2_auth_request.py | 66 ---- test/test_v2_authentication_method_type.py | 33 -- test/test_v2_authorization_error.py | 53 --- test/test_v2_auto_linking_option.py | 33 -- test/test_v2_azure_ad_config.py | 56 --- test/test_v2_azure_ad_tenant.py | 52 --- test/test_v2_azure_ad_tenant_type.py | 33 -- test/test_v2_branding_settings.py | 69 ---- test/test_v2_challenges.py | 54 --- test/test_v2_challenges_web_auth_n.py | 51 --- test/test_v2_check_idp_intent.py | 52 --- test/test_v2_check_otp.py | 51 --- test/test_v2_check_password.py | 51 --- test/test_v2_check_totp.py | 51 --- test/test_v2_check_user.py | 52 --- test/test_v2_check_web_auth_n.py | 52 --- test/test_v2_checks.py | 65 ---- test/test_v2_create_callback_response.py | 55 --- test/test_v2_create_invite_code_response.py | 55 --- ...eate_passkey_registration_link_response.py | 57 --- test/test_v2_create_session_request.py | 90 ----- test/test_v2_create_session_response.py | 61 ---- test/test_v2_creation_date_query.py | 52 --- test/test_v2_creator_query.py | 51 --- test/test_v2_deactivate_user_response.py | 54 --- test/test_v2_delete_session_response.py | 54 --- test/test_v2_delete_user_response.py | 54 --- test/test_v2_details.py | 53 --- test/test_v2_display_name_query.py | 53 --- test/test_v2_domain_settings.py | 54 --- test/test_v2_email_query.py | 53 --- test/test_v2_embedded_iframe_settings.py | 52 --- test/test_v2_error_reason.py | 33 -- test/test_v2_factors.py | 69 ---- test/test_v2_feature_flag.py | 52 --- test/test_v2_first_name_query.py | 53 --- test/test_v2_gender.py | 33 -- test/test_v2_generic_oidc_config.py | 54 --- ..._get_active_identity_providers_response.py | 66 ---- test/test_v2_get_auth_request_response.py | 67 ---- .../test_v2_get_branding_settings_response.py | 74 ---- test/test_v2_get_domain_settings_response.py | 59 --- test/test_v2_get_general_settings_response.py | 53 --- test/test_v2_get_idpby_id_response.py | 149 -------- .../test_v2_get_instance_features_response.py | 97 ----- ...get_legal_and_support_settings_response.py | 63 ---- test/test_v2_get_lockout_settings_response.py | 58 --- test/test_v2_get_login_settings_response.py | 79 ---- ...t_v2_get_organization_features_response.py | 54 --- ...t_password_complexity_settings_response.py | 61 ---- ...2_get_password_expiry_settings_response.py | 58 --- .../test_v2_get_security_settings_response.py | 59 --- test/test_v2_get_session_response.py | 89 ----- test/test_v2_get_system_features_response.py | 91 ----- test/test_v2_get_user_by_id_response.py | 89 ----- test/test_v2_get_user_features_response.py | 54 --- test/test_v2_git_hub_config.py | 52 --- ...est_v2_git_hub_enterprise_server_config.py | 55 --- test/test_v2_git_lab_config.py | 52 --- test/test_v2_git_lab_self_hosted_config.py | 53 --- test/test_v2_google_config.py | 52 --- test/test_v2_hashed_password.py | 53 --- test/test_v2_human_email.py | 52 --- ...test_v2_human_mfa_init_skipped_response.py | 54 --- test/test_v2_human_phone.py | 52 --- test/test_v2_human_profile.py | 57 --- test/test_v2_human_user.py | 70 ---- test/test_v2_identity_provider.py | 59 --- test/test_v2_identity_provider_type.py | 33 -- test/test_v2_idp.py | 148 -------- test/test_v2_idp_config.py | 139 ------- test/test_v2_idp_information.py | 61 ---- test/test_v2_idp_intent.py | 53 --- test/test_v2_idp_link.py | 53 --- test/test_v2_idp_state.py | 33 -- test/test_v2_idp_type.py | 33 -- test/test_v2_idpldap_access_information.py | 51 --- test/test_v2_idpo_auth_access_information.py | 52 --- test/test_v2_idpsaml_access_information.py | 51 --- test/test_v2_ids_query.py | 53 --- test/test_v2_improved_performance.py | 33 -- ...st_v2_improved_performance_feature_flag.py | 52 --- test/test_v2_in_user_emails_query.py | 51 --- test/test_v2_in_user_id_query.py | 51 --- test/test_v2_intent_factor.py | 51 --- test/test_v2_jwt_config.py | 54 --- test/test_v2_last_name_query.py | 53 --- test/test_v2_ldap_attributes.py | 63 ---- test/test_v2_ldap_config.py | 78 ---- test/test_v2_ldap_credentials.py | 52 --- test/test_v2_legal_and_support_settings.py | 58 --- ...v2_list_authentication_factors_response.py | 60 --- ...st_authentication_method_types_response.py | 57 --- test/test_v2_list_details.py | 53 --- test/test_v2_list_idp_links_response.py | 60 --- test/test_v2_list_organizations_request.py | 68 ---- test/test_v2_list_organizations_response.py | 66 ---- test/test_v2_list_passkeys_response.py | 60 --- test/test_v2_list_query.py | 53 --- test/test_v2_list_sessions_request.py | 71 ---- test/test_v2_list_sessions_response.py | 95 ----- test/test_v2_list_users_request.py | 100 ----- test/test_v2_list_users_response.py | 92 ----- test/test_v2_lock_user_response.py | 54 --- test/test_v2_lockout_settings.py | 53 --- test/test_v2_login_name_query.py | 53 --- test/test_v2_login_settings.py | 74 ---- test/test_v2_login_v2.py | 52 --- test/test_v2_login_v2_feature_flag.py | 53 --- test/test_v2_machine_user.py | 54 --- test/test_v2_multi_factor_type.py | 33 -- test/test_v2_nick_name_query.py | 53 --- test/test_v2_not_query.py | 92 ----- test/test_v2_notification_type.py | 33 -- test/test_v2_o_auth_config.py | 56 --- test/test_v2_or_query.py | 90 ----- test/test_v2_organization.py | 52 --- test/test_v2_organization_domain_query.py | 53 --- test/test_v2_organization_field_name.py | 33 -- test/test_v2_organization_id_query.py | 52 --- test/test_v2_organization_name_query.py | 53 --- test/test_v2_organization_state.py | 33 -- test/test_v2_organization_state_query.py | 51 --- test/test_v2_otp_factor.py | 51 --- test/test_v2_passkey.py | 53 --- test/test_v2_passkey_authenticator.py | 33 -- test/test_v2_passkey_registration_code.py | 54 --- test/test_v2_passkeys_type.py | 33 -- test/test_v2_password.py | 53 --- test/test_v2_password_complexity_settings.py | 56 --- test/test_v2_password_expiry_settings.py | 53 --- test/test_v2_password_factor.py | 51 --- test/test_v2_password_reset_response.py | 55 --- test/test_v2_phone_query.py | 53 --- test/test_v2_prompt.py | 33 -- test/test_v2_reactivate_user_response.py | 54 --- test/test_v2_redirect_urls.py | 52 --- test/test_v2_register_passkey_response.py | 56 --- test/test_v2_register_totp_response.py | 56 --- test/test_v2_register_u2_f_response.py | 56 --- test/test_v2_remove_idp_link_response.py | 54 --- test/test_v2_remove_otp_email_response.py | 54 --- test/test_v2_remove_otpsms_response.py | 54 --- test/test_v2_remove_passkey_response.py | 54 --- test/test_v2_remove_phone_response.py | 54 --- test/test_v2_remove_totp_response.py | 54 --- test/test_v2_remove_u2_f_response.py | 54 --- test/test_v2_request_challenges.py | 59 --- test/test_v2_request_challenges_web_auth_n.py | 54 --- test/test_v2_resend_email_code_response.py | 55 --- test/test_v2_resend_invite_code_response.py | 54 --- test/test_v2_resend_phone_code_response.py | 55 --- ...est_v2_reset_instance_features_response.py | 54 --- ...v2_reset_organization_features_response.py | 54 --- .../test_v2_reset_system_features_response.py | 54 --- test/test_v2_reset_user_features_response.py | 54 --- test/test_v2_resource_owner_type.py | 33 -- ...rieve_identity_provider_intent_response.py | 67 ---- test/test_v2_saml_binding.py | 33 -- test/test_v2_saml_config.py | 55 --- test/test_v2_saml_name_id_format.py | 33 -- test/test_v2_search_query.py | 63 ---- test/test_v2_search_query1.py | 205 ----------- test/test_v2_second_factor_type.py | 33 -- test/test_v2_security_settings.py | 54 --- test/test_v2_send_email_code_response.py | 55 --- test/test_v2_send_email_verification_code.py | 51 --- test/test_v2_send_invite_code.py | 52 --- .../test_v2_send_passkey_registration_link.py | 51 --- test/test_v2_send_password_reset_link.py | 52 --- test/test_v2_session.py | 52 --- test/test_v2_session1.py | 88 ----- test/test_v2_session_field_name.py | 33 -- test/test_v2_set_email_response.py | 55 --- test/test_v2_set_human_email.py | 56 --- test/test_v2_set_human_email1.py | 56 --- test/test_v2_set_human_phone.py | 54 --- test/test_v2_set_human_phone1.py | 54 --- test/test_v2_set_human_profile.py | 58 --- test/test_v2_set_human_profile1.py | 58 --- test/test_v2_set_instance_features_request.py | 66 ---- .../test_v2_set_instance_features_response.py | 54 --- test/test_v2_set_metadata_entry.py | 54 --- test/test_v2_set_metadata_entry1.py | 54 --- ...t_v2_set_organization_features_response.py | 54 --- test/test_v2_set_password_response.py | 54 --- test/test_v2_set_phone_response.py | 55 --- test/test_v2_set_security_settings_request.py | 54 --- .../test_v2_set_security_settings_response.py | 54 --- test/test_v2_set_session_response.py | 60 --- test/test_v2_set_system_features_request.py | 64 ---- test/test_v2_set_system_features_response.py | 54 --- test/test_v2_set_user_features_response.py | 54 --- test/test_v2_source.py | 33 -- ..._start_identity_provider_intent_request.py | 57 --- ...start_identity_provider_intent_response.py | 60 --- test/test_v2_state_query.py | 52 --- test/test_v2_text_query_method.py | 33 -- test/test_v2_theme.py | 56 --- test/test_v2_theme_mode.py | 33 -- test/test_v2_totp_factor.py | 51 --- test/test_v2_type_query.py | 52 --- test/test_v2_unlock_user_response.py | 54 --- test/test_v2_update_human_user_response.py | 56 --- test/test_v2_user.py | 85 ----- test/test_v2_user_agent.py | 59 --- test/test_v2_user_agent_query.py | 51 --- test/test_v2_user_factor.py | 55 --- test/test_v2_user_field_name.py | 33 -- test/test_v2_user_id_query.py | 51 --- test/test_v2_user_name_query.py | 53 --- .../test_v2_user_service_set_password_body.py | 57 --- test/test_v2_user_state.py | 33 -- test/test_v2_user_verification_requirement.py | 33 -- test/test_v2_verify_email_response.py | 54 --- test/test_v2_verify_invite_code_response.py | 54 --- ...v2_verify_passkey_registration_response.py | 54 --- test/test_v2_verify_phone_response.py | 54 --- ...st_v2_verify_totp_registration_response.py | 54 --- ...st_v2_verify_u2_f_registration_response.py | 54 --- test/test_v2_web_auth_n_factor.py | 52 --- test/test_zitadelidpv2_options.py | 55 --- test/test_zitadelidpv2_options1.py | 55 --- test/test_zitadelobjectv2_organization.py | 52 --- test/test_zitadelorgv2_organization.py | 58 --- test/test_zitadelorgv2_search_query.py | 61 ---- test/test_zitadelv1_timestamp_query_method.py | 33 -- zitadel_client/api_client.py | 7 +- zitadel_client/auth/oauth_authenticator.py | 14 +- .../auth/web_token_authenticator.py | 8 +- 296 files changed, 479 insertions(+), 16512 deletions(-) create mode 100644 test/auth/__init__.py create mode 100644 test/auth/test_client_credentials_authenticator.py create mode 100644 test/auth/test_no_auth_authenticator.py create mode 100644 test/auth/test_oauth_authenticator.py create mode 100644 test/auth/test_personal_access_authenticator.py create mode 100644 test/auth/test_web_token_authenticator.py delete mode 100644 test/test_add_organization_request_admin.py delete mode 100644 test/test_add_organization_response_created_admin.py delete mode 100644 test/test_feature_service_api.py delete mode 100644 test/test_identity_provider_service_api.py delete mode 100644 test/test_objectv2_list_details.py delete mode 100644 test/test_objectv2_list_query.py delete mode 100644 test/test_oidc_service_api.py delete mode 100644 test/test_oidc_service_create_callback_body.py delete mode 100644 test/test_organization_service_api.py delete mode 100644 test/test_otp_email_send_code.py delete mode 100644 test/test_protobuf_any.py delete mode 100644 test/test_request_challenges_otp_email.py delete mode 100644 test/test_request_challenges_otpsms.py delete mode 100644 test/test_rpc_status.py delete mode 100644 test/test_session_service_api.py delete mode 100644 test/test_session_service_delete_session_body.py delete mode 100644 test/test_session_service_set_session_body.py delete mode 100644 test/test_settings_api.py delete mode 100644 test/test_settings_service_api.py delete mode 100644 test/test_user_agent_header_values.py delete mode 100644 test/test_user_service_add_idp_link_body.py delete mode 100644 test/test_user_service_api.py delete mode 100644 test/test_user_service_create_invite_code_body.py delete mode 100644 test/test_user_service_create_passkey_registration_link_body.py delete mode 100644 test/test_user_service_list_idp_links_body.py delete mode 100644 test/test_user_service_password_reset_body.py delete mode 100644 test/test_user_service_register_passkey_body.py delete mode 100644 test/test_user_service_register_u2_f_body.py delete mode 100644 test/test_user_service_resend_email_code_body.py delete mode 100644 test/test_user_service_resend_phone_code_body.py delete mode 100644 test/test_user_service_retrieve_identity_provider_intent_body.py delete mode 100644 test/test_user_service_send_email_code_body.py delete mode 100644 test/test_user_service_set_email_body.py delete mode 100644 test/test_user_service_set_phone_body.py delete mode 100644 test/test_user_service_update_human_user_body.py delete mode 100644 test/test_user_service_verify_email_body.py delete mode 100644 test/test_user_service_verify_invite_code_body.py delete mode 100644 test/test_user_service_verify_passkey_registration_body.py delete mode 100644 test/test_user_service_verify_phone_body.py delete mode 100644 test/test_user_service_verify_totp_registration_body.py delete mode 100644 test/test_user_service_verify_u2_f_registration_body.py delete mode 100644 test/test_userv2_set_password.py delete mode 100644 test/test_userv2_type.py delete mode 100644 test/test_v2_access_token_type.py delete mode 100644 test/test_v2_add_human_user_request.py delete mode 100644 test/test_v2_add_human_user_request1.py delete mode 100644 test/test_v2_add_human_user_response.py delete mode 100644 test/test_v2_add_idp_link_response.py delete mode 100644 test/test_v2_add_organization_request.py delete mode 100644 test/test_v2_add_organization_response.py delete mode 100644 test/test_v2_add_otp_email_response.py delete mode 100644 test/test_v2_add_otpsms_response.py delete mode 100644 test/test_v2_and_query.py delete mode 100644 test/test_v2_apple_config.py delete mode 100644 test/test_v2_auth_factor.py delete mode 100644 test/test_v2_auth_factor_state.py delete mode 100644 test/test_v2_auth_factor_u2_f.py delete mode 100644 test/test_v2_auth_request.py delete mode 100644 test/test_v2_authentication_method_type.py delete mode 100644 test/test_v2_authorization_error.py delete mode 100644 test/test_v2_auto_linking_option.py delete mode 100644 test/test_v2_azure_ad_config.py delete mode 100644 test/test_v2_azure_ad_tenant.py delete mode 100644 test/test_v2_azure_ad_tenant_type.py delete mode 100644 test/test_v2_branding_settings.py delete mode 100644 test/test_v2_challenges.py delete mode 100644 test/test_v2_challenges_web_auth_n.py delete mode 100644 test/test_v2_check_idp_intent.py delete mode 100644 test/test_v2_check_otp.py delete mode 100644 test/test_v2_check_password.py delete mode 100644 test/test_v2_check_totp.py delete mode 100644 test/test_v2_check_user.py delete mode 100644 test/test_v2_check_web_auth_n.py delete mode 100644 test/test_v2_checks.py delete mode 100644 test/test_v2_create_callback_response.py delete mode 100644 test/test_v2_create_invite_code_response.py delete mode 100644 test/test_v2_create_passkey_registration_link_response.py delete mode 100644 test/test_v2_create_session_request.py delete mode 100644 test/test_v2_create_session_response.py delete mode 100644 test/test_v2_creation_date_query.py delete mode 100644 test/test_v2_creator_query.py delete mode 100644 test/test_v2_deactivate_user_response.py delete mode 100644 test/test_v2_delete_session_response.py delete mode 100644 test/test_v2_delete_user_response.py delete mode 100644 test/test_v2_details.py delete mode 100644 test/test_v2_display_name_query.py delete mode 100644 test/test_v2_domain_settings.py delete mode 100644 test/test_v2_email_query.py delete mode 100644 test/test_v2_embedded_iframe_settings.py delete mode 100644 test/test_v2_error_reason.py delete mode 100644 test/test_v2_factors.py delete mode 100644 test/test_v2_feature_flag.py delete mode 100644 test/test_v2_first_name_query.py delete mode 100644 test/test_v2_gender.py delete mode 100644 test/test_v2_generic_oidc_config.py delete mode 100644 test/test_v2_get_active_identity_providers_response.py delete mode 100644 test/test_v2_get_auth_request_response.py delete mode 100644 test/test_v2_get_branding_settings_response.py delete mode 100644 test/test_v2_get_domain_settings_response.py delete mode 100644 test/test_v2_get_general_settings_response.py delete mode 100644 test/test_v2_get_idpby_id_response.py delete mode 100644 test/test_v2_get_instance_features_response.py delete mode 100644 test/test_v2_get_legal_and_support_settings_response.py delete mode 100644 test/test_v2_get_lockout_settings_response.py delete mode 100644 test/test_v2_get_login_settings_response.py delete mode 100644 test/test_v2_get_organization_features_response.py delete mode 100644 test/test_v2_get_password_complexity_settings_response.py delete mode 100644 test/test_v2_get_password_expiry_settings_response.py delete mode 100644 test/test_v2_get_security_settings_response.py delete mode 100644 test/test_v2_get_session_response.py delete mode 100644 test/test_v2_get_system_features_response.py delete mode 100644 test/test_v2_get_user_by_id_response.py delete mode 100644 test/test_v2_get_user_features_response.py delete mode 100644 test/test_v2_git_hub_config.py delete mode 100644 test/test_v2_git_hub_enterprise_server_config.py delete mode 100644 test/test_v2_git_lab_config.py delete mode 100644 test/test_v2_git_lab_self_hosted_config.py delete mode 100644 test/test_v2_google_config.py delete mode 100644 test/test_v2_hashed_password.py delete mode 100644 test/test_v2_human_email.py delete mode 100644 test/test_v2_human_mfa_init_skipped_response.py delete mode 100644 test/test_v2_human_phone.py delete mode 100644 test/test_v2_human_profile.py delete mode 100644 test/test_v2_human_user.py delete mode 100644 test/test_v2_identity_provider.py delete mode 100644 test/test_v2_identity_provider_type.py delete mode 100644 test/test_v2_idp.py delete mode 100644 test/test_v2_idp_config.py delete mode 100644 test/test_v2_idp_information.py delete mode 100644 test/test_v2_idp_intent.py delete mode 100644 test/test_v2_idp_link.py delete mode 100644 test/test_v2_idp_state.py delete mode 100644 test/test_v2_idp_type.py delete mode 100644 test/test_v2_idpldap_access_information.py delete mode 100644 test/test_v2_idpo_auth_access_information.py delete mode 100644 test/test_v2_idpsaml_access_information.py delete mode 100644 test/test_v2_ids_query.py delete mode 100644 test/test_v2_improved_performance.py delete mode 100644 test/test_v2_improved_performance_feature_flag.py delete mode 100644 test/test_v2_in_user_emails_query.py delete mode 100644 test/test_v2_in_user_id_query.py delete mode 100644 test/test_v2_intent_factor.py delete mode 100644 test/test_v2_jwt_config.py delete mode 100644 test/test_v2_last_name_query.py delete mode 100644 test/test_v2_ldap_attributes.py delete mode 100644 test/test_v2_ldap_config.py delete mode 100644 test/test_v2_ldap_credentials.py delete mode 100644 test/test_v2_legal_and_support_settings.py delete mode 100644 test/test_v2_list_authentication_factors_response.py delete mode 100644 test/test_v2_list_authentication_method_types_response.py delete mode 100644 test/test_v2_list_details.py delete mode 100644 test/test_v2_list_idp_links_response.py delete mode 100644 test/test_v2_list_organizations_request.py delete mode 100644 test/test_v2_list_organizations_response.py delete mode 100644 test/test_v2_list_passkeys_response.py delete mode 100644 test/test_v2_list_query.py delete mode 100644 test/test_v2_list_sessions_request.py delete mode 100644 test/test_v2_list_sessions_response.py delete mode 100644 test/test_v2_list_users_request.py delete mode 100644 test/test_v2_list_users_response.py delete mode 100644 test/test_v2_lock_user_response.py delete mode 100644 test/test_v2_lockout_settings.py delete mode 100644 test/test_v2_login_name_query.py delete mode 100644 test/test_v2_login_settings.py delete mode 100644 test/test_v2_login_v2.py delete mode 100644 test/test_v2_login_v2_feature_flag.py delete mode 100644 test/test_v2_machine_user.py delete mode 100644 test/test_v2_multi_factor_type.py delete mode 100644 test/test_v2_nick_name_query.py delete mode 100644 test/test_v2_not_query.py delete mode 100644 test/test_v2_notification_type.py delete mode 100644 test/test_v2_o_auth_config.py delete mode 100644 test/test_v2_or_query.py delete mode 100644 test/test_v2_organization.py delete mode 100644 test/test_v2_organization_domain_query.py delete mode 100644 test/test_v2_organization_field_name.py delete mode 100644 test/test_v2_organization_id_query.py delete mode 100644 test/test_v2_organization_name_query.py delete mode 100644 test/test_v2_organization_state.py delete mode 100644 test/test_v2_organization_state_query.py delete mode 100644 test/test_v2_otp_factor.py delete mode 100644 test/test_v2_passkey.py delete mode 100644 test/test_v2_passkey_authenticator.py delete mode 100644 test/test_v2_passkey_registration_code.py delete mode 100644 test/test_v2_passkeys_type.py delete mode 100644 test/test_v2_password.py delete mode 100644 test/test_v2_password_complexity_settings.py delete mode 100644 test/test_v2_password_expiry_settings.py delete mode 100644 test/test_v2_password_factor.py delete mode 100644 test/test_v2_password_reset_response.py delete mode 100644 test/test_v2_phone_query.py delete mode 100644 test/test_v2_prompt.py delete mode 100644 test/test_v2_reactivate_user_response.py delete mode 100644 test/test_v2_redirect_urls.py delete mode 100644 test/test_v2_register_passkey_response.py delete mode 100644 test/test_v2_register_totp_response.py delete mode 100644 test/test_v2_register_u2_f_response.py delete mode 100644 test/test_v2_remove_idp_link_response.py delete mode 100644 test/test_v2_remove_otp_email_response.py delete mode 100644 test/test_v2_remove_otpsms_response.py delete mode 100644 test/test_v2_remove_passkey_response.py delete mode 100644 test/test_v2_remove_phone_response.py delete mode 100644 test/test_v2_remove_totp_response.py delete mode 100644 test/test_v2_remove_u2_f_response.py delete mode 100644 test/test_v2_request_challenges.py delete mode 100644 test/test_v2_request_challenges_web_auth_n.py delete mode 100644 test/test_v2_resend_email_code_response.py delete mode 100644 test/test_v2_resend_invite_code_response.py delete mode 100644 test/test_v2_resend_phone_code_response.py delete mode 100644 test/test_v2_reset_instance_features_response.py delete mode 100644 test/test_v2_reset_organization_features_response.py delete mode 100644 test/test_v2_reset_system_features_response.py delete mode 100644 test/test_v2_reset_user_features_response.py delete mode 100644 test/test_v2_resource_owner_type.py delete mode 100644 test/test_v2_retrieve_identity_provider_intent_response.py delete mode 100644 test/test_v2_saml_binding.py delete mode 100644 test/test_v2_saml_config.py delete mode 100644 test/test_v2_saml_name_id_format.py delete mode 100644 test/test_v2_search_query.py delete mode 100644 test/test_v2_search_query1.py delete mode 100644 test/test_v2_second_factor_type.py delete mode 100644 test/test_v2_security_settings.py delete mode 100644 test/test_v2_send_email_code_response.py delete mode 100644 test/test_v2_send_email_verification_code.py delete mode 100644 test/test_v2_send_invite_code.py delete mode 100644 test/test_v2_send_passkey_registration_link.py delete mode 100644 test/test_v2_send_password_reset_link.py delete mode 100644 test/test_v2_session.py delete mode 100644 test/test_v2_session1.py delete mode 100644 test/test_v2_session_field_name.py delete mode 100644 test/test_v2_set_email_response.py delete mode 100644 test/test_v2_set_human_email.py delete mode 100644 test/test_v2_set_human_email1.py delete mode 100644 test/test_v2_set_human_phone.py delete mode 100644 test/test_v2_set_human_phone1.py delete mode 100644 test/test_v2_set_human_profile.py delete mode 100644 test/test_v2_set_human_profile1.py delete mode 100644 test/test_v2_set_instance_features_request.py delete mode 100644 test/test_v2_set_instance_features_response.py delete mode 100644 test/test_v2_set_metadata_entry.py delete mode 100644 test/test_v2_set_metadata_entry1.py delete mode 100644 test/test_v2_set_organization_features_response.py delete mode 100644 test/test_v2_set_password_response.py delete mode 100644 test/test_v2_set_phone_response.py delete mode 100644 test/test_v2_set_security_settings_request.py delete mode 100644 test/test_v2_set_security_settings_response.py delete mode 100644 test/test_v2_set_session_response.py delete mode 100644 test/test_v2_set_system_features_request.py delete mode 100644 test/test_v2_set_system_features_response.py delete mode 100644 test/test_v2_set_user_features_response.py delete mode 100644 test/test_v2_source.py delete mode 100644 test/test_v2_start_identity_provider_intent_request.py delete mode 100644 test/test_v2_start_identity_provider_intent_response.py delete mode 100644 test/test_v2_state_query.py delete mode 100644 test/test_v2_text_query_method.py delete mode 100644 test/test_v2_theme.py delete mode 100644 test/test_v2_theme_mode.py delete mode 100644 test/test_v2_totp_factor.py delete mode 100644 test/test_v2_type_query.py delete mode 100644 test/test_v2_unlock_user_response.py delete mode 100644 test/test_v2_update_human_user_response.py delete mode 100644 test/test_v2_user.py delete mode 100644 test/test_v2_user_agent.py delete mode 100644 test/test_v2_user_agent_query.py delete mode 100644 test/test_v2_user_factor.py delete mode 100644 test/test_v2_user_field_name.py delete mode 100644 test/test_v2_user_id_query.py delete mode 100644 test/test_v2_user_name_query.py delete mode 100644 test/test_v2_user_service_set_password_body.py delete mode 100644 test/test_v2_user_state.py delete mode 100644 test/test_v2_user_verification_requirement.py delete mode 100644 test/test_v2_verify_email_response.py delete mode 100644 test/test_v2_verify_invite_code_response.py delete mode 100644 test/test_v2_verify_passkey_registration_response.py delete mode 100644 test/test_v2_verify_phone_response.py delete mode 100644 test/test_v2_verify_totp_registration_response.py delete mode 100644 test/test_v2_verify_u2_f_registration_response.py delete mode 100644 test/test_v2_web_auth_n_factor.py delete mode 100644 test/test_zitadelidpv2_options.py delete mode 100644 test/test_zitadelidpv2_options1.py delete mode 100644 test/test_zitadelobjectv2_organization.py delete mode 100644 test/test_zitadelorgv2_organization.py delete mode 100644 test/test_zitadelorgv2_search_query.py delete mode 100644 test/test_zitadelv1_timestamp_query_method.py diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore index 98fafa65..0062019e 100644 --- a/.openapi-generator-ignore +++ b/.openapi-generator-ignore @@ -17,3 +17,4 @@ poetry.lock requirements.txt test-requirements.txt tox.ini +test/*.py diff --git a/poetry.lock b/poetry.lock index 81ddf82f..24e6367d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -42,6 +42,18 @@ files = [ {file = "cachetools-5.5.2.tar.gz", hash = "sha256:1a661caa9175d26759571b2e19580f9d6393969e5dfca11fdb1f947a23e640d4"}, ] +[[package]] +name = "certifi" +version = "2025.1.31" +description = "Python package for providing Mozilla's CA Bundle." +optional = false +python-versions = ">=3.6" +groups = ["dev"] +files = [ + {file = "certifi-2025.1.31-py3-none-any.whl", hash = "sha256:ca78db4565a652026a4db2bcdf68f2fb589ea80d0be70e03929ed730746b84fe"}, + {file = "certifi-2025.1.31.tar.gz", hash = "sha256:3d5da6925056f6f18f119200434a4780a94263f10d1c21d032a6f6b2baa20651"}, +] + [[package]] name = "cffi" version = "1.17.1" @@ -135,6 +147,108 @@ files = [ {file = "chardet-5.2.0.tar.gz", hash = "sha256:1b3b6ff479a8c414bc3fa2c0852995695c4a026dcd6d0633b2dd092ca39c1cf7"}, ] +[[package]] +name = "charset-normalizer" +version = "3.4.1" +description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." +optional = false +python-versions = ">=3.7" +groups = ["dev"] +files = [ + {file = "charset_normalizer-3.4.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:91b36a978b5ae0ee86c394f5a54d6ef44db1de0815eb43de826d41d21e4af3de"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7461baadb4dc00fd9e0acbe254e3d7d2112e7f92ced2adc96e54ef6501c5f176"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e218488cd232553829be0664c2292d3af2eeeb94b32bea483cf79ac6a694e037"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:80ed5e856eb7f30115aaf94e4a08114ccc8813e6ed1b5efa74f9f82e8509858f"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b010a7a4fd316c3c484d482922d13044979e78d1861f0e0650423144c616a46a"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4532bff1b8421fd0a320463030c7520f56a79c9024a4e88f01c537316019005a"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:d973f03c0cb71c5ed99037b870f2be986c3c05e63622c017ea9816881d2dd247"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:3a3bd0dcd373514dcec91c411ddb9632c0d7d92aed7093b8c3bbb6d69ca74408"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:d9c3cdf5390dcd29aa8056d13e8e99526cda0305acc038b96b30352aff5ff2bb"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:2bdfe3ac2e1bbe5b59a1a63721eb3b95fc9b6817ae4a46debbb4e11f6232428d"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:eab677309cdb30d047996b36d34caeda1dc91149e4fdca0b1a039b3f79d9a807"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-win32.whl", hash = "sha256:c0429126cf75e16c4f0ad00ee0eae4242dc652290f940152ca8c75c3a4b6ee8f"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-win_amd64.whl", hash = "sha256:9f0b8b1c6d84c8034a44893aba5e767bf9c7a211e313a9605d9c617d7083829f"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:8bfa33f4f2672964266e940dd22a195989ba31669bd84629f05fab3ef4e2d125"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:28bf57629c75e810b6ae989f03c0828d64d6b26a5e205535585f96093e405ed1"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f08ff5e948271dc7e18a35641d2f11a4cd8dfd5634f55228b691e62b37125eb3"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:234ac59ea147c59ee4da87a0c0f098e9c8d169f4dc2a159ef720f1a61bbe27cd"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fd4ec41f914fa74ad1b8304bbc634b3de73d2a0889bd32076342a573e0779e00"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eea6ee1db730b3483adf394ea72f808b6e18cf3cb6454b4d86e04fa8c4327a12"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:c96836c97b1238e9c9e3fe90844c947d5afbf4f4c92762679acfe19927d81d77"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:4d86f7aff21ee58f26dcf5ae81a9addbd914115cdebcbb2217e4f0ed8982e146"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:09b5e6733cbd160dcc09589227187e242a30a49ca5cefa5a7edd3f9d19ed53fd"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:5777ee0881f9499ed0f71cc82cf873d9a0ca8af166dfa0af8ec4e675b7df48e6"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:237bdbe6159cff53b4f24f397d43c6336c6b0b42affbe857970cefbb620911c8"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-win32.whl", hash = "sha256:8417cb1f36cc0bc7eaba8ccb0e04d55f0ee52df06df3ad55259b9a323555fc8b"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-win_amd64.whl", hash = "sha256:d7f50a1f8c450f3925cb367d011448c39239bb3eb4117c36a6d354794de4ce76"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:73d94b58ec7fecbc7366247d3b0b10a21681004153238750bb67bd9012414545"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dad3e487649f498dd991eeb901125411559b22e8d7ab25d3aeb1af367df5efd7"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c30197aa96e8eed02200a83fba2657b4c3acd0f0aa4bdc9f6c1af8e8962e0757"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2369eea1ee4a7610a860d88f268eb39b95cb588acd7235e02fd5a5601773d4fa"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc2722592d8998c870fa4e290c2eec2c1569b87fe58618e67d38b4665dfa680d"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ffc9202a29ab3920fa812879e95a9e78b2465fd10be7fcbd042899695d75e616"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:804a4d582ba6e5b747c625bf1255e6b1507465494a40a2130978bda7b932c90b"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:0f55e69f030f7163dffe9fd0752b32f070566451afe180f99dbeeb81f511ad8d"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:c4c3e6da02df6fa1410a7680bd3f63d4f710232d3139089536310d027950696a"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:5df196eb874dae23dcfb968c83d4f8fdccb333330fe1fc278ac5ceeb101003a9"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e358e64305fe12299a08e08978f51fc21fac060dcfcddd95453eabe5b93ed0e1"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-win32.whl", hash = "sha256:9b23ca7ef998bc739bf6ffc077c2116917eabcc901f88da1b9856b210ef63f35"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-win_amd64.whl", hash = "sha256:6ff8a4a60c227ad87030d76e99cd1698345d4491638dfa6673027c48b3cd395f"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:aabfa34badd18f1da5ec1bc2715cadc8dca465868a4e73a0173466b688f29dda"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22e14b5d70560b8dd51ec22863f370d1e595ac3d024cb8ad7d308b4cd95f8313"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8436c508b408b82d87dc5f62496973a1805cd46727c34440b0d29d8a2f50a6c9"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2d074908e1aecee37a7635990b2c6d504cd4766c7bc9fc86d63f9c09af3fa11b"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:955f8851919303c92343d2f66165294848d57e9bba6cf6e3625485a70a038d11"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:44ecbf16649486d4aebafeaa7ec4c9fed8b88101f4dd612dcaf65d5e815f837f"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:0924e81d3d5e70f8126529951dac65c1010cdf117bb75eb02dd12339b57749dd"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:2967f74ad52c3b98de4c3b32e1a44e32975e008a9cd2a8cc8966d6a5218c5cb2"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:c75cb2a3e389853835e84a2d8fb2b81a10645b503eca9bcb98df6b5a43eb8886"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:09b26ae6b1abf0d27570633b2b078a2a20419c99d66fb2823173d73f188ce601"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:fa88b843d6e211393a37219e6a1c1df99d35e8fd90446f1118f4216e307e48cd"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-win32.whl", hash = "sha256:eb8178fe3dba6450a3e024e95ac49ed3400e506fd4e9e5c32d30adda88cbd407"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-win_amd64.whl", hash = "sha256:b1ac5992a838106edb89654e0aebfc24f5848ae2547d22c2c3f66454daa11971"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f30bf9fd9be89ecb2360c7d94a711f00c09b976258846efe40db3d05828e8089"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:97f68b8d6831127e4787ad15e6757232e14e12060bec17091b85eb1486b91d8d"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7974a0b5ecd505609e3b19742b60cee7aa2aa2fb3151bc917e6e2646d7667dcf"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fc54db6c8593ef7d4b2a331b58653356cf04f67c960f584edb7c3d8c97e8f39e"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:311f30128d7d333eebd7896965bfcfbd0065f1716ec92bd5638d7748eb6f936a"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:7d053096f67cd1241601111b698f5cad775f97ab25d81567d3f59219b5f1adbd"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:807f52c1f798eef6cf26beb819eeb8819b1622ddfeef9d0977a8502d4db6d534"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_ppc64le.whl", hash = "sha256:dccbe65bd2f7f7ec22c4ff99ed56faa1e9f785482b9bbd7c717e26fd723a1d1e"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_s390x.whl", hash = "sha256:2fb9bd477fdea8684f78791a6de97a953c51831ee2981f8e4f583ff3b9d9687e"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:01732659ba9b5b873fc117534143e4feefecf3b2078b0a6a2e925271bb6f4cfa"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-win32.whl", hash = "sha256:7a4f97a081603d2050bfaffdefa5b02a9ec823f8348a572e39032caa8404a487"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-win_amd64.whl", hash = "sha256:7b1bef6280950ee6c177b326508f86cad7ad4dff12454483b51d8b7d673a2c5d"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:ecddf25bee22fe4fe3737a399d0d177d72bc22be6913acfab364b40bce1ba83c"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c60ca7339acd497a55b0ea5d506b2a2612afb2826560416f6894e8b5770d4a9"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b7b2d86dd06bfc2ade3312a83a5c364c7ec2e3498f8734282c6c3d4b07b346b8"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dd78cfcda14a1ef52584dbb008f7ac81c1328c0f58184bf9a84c49c605002da6"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e27f48bcd0957c6d4cb9d6fa6b61d192d0b13d5ef563e5f2ae35feafc0d179c"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:01ad647cdd609225c5350561d084b42ddf732f4eeefe6e678765636791e78b9a"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:619a609aa74ae43d90ed2e89bdd784765de0a25ca761b93e196d938b8fd1dbbd"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:89149166622f4db9b4b6a449256291dc87a99ee53151c74cbd82a53c8c2f6ccd"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:7709f51f5f7c853f0fb938bcd3bc59cdfdc5203635ffd18bf354f6967ea0f824"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:345b0426edd4e18138d6528aed636de7a9ed169b4aaf9d61a8c19e39d26838ca"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:0907f11d019260cdc3f94fbdb23ff9125f6b5d1039b76003b5b0ac9d6a6c9d5b"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-win32.whl", hash = "sha256:ea0d8d539afa5eb2728aa1932a988a9a7af94f18582ffae4bc10b3fbdad0626e"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:329ce159e82018d646c7ac45b01a430369d526569ec08516081727a20e9e4af4"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:b97e690a2118911e39b4042088092771b4ae3fc3aa86518f84b8cf6888dbdb41"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:78baa6d91634dfb69ec52a463534bc0df05dbd546209b79a3880a34487f4b84f"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1a2bc9f351a75ef49d664206d51f8e5ede9da246602dc2d2726837620ea034b2"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:75832c08354f595c760a804588b9357d34ec00ba1c940c15e31e96d902093770"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0af291f4fe114be0280cdd29d533696a77b5b49cfde5467176ecab32353395c4"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0167ddc8ab6508fe81860a57dd472b2ef4060e8d378f0cc555707126830f2537"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:2a75d49014d118e4198bcee5ee0a6f25856b29b12dbf7cd012791f8a6cc5c496"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:363e2f92b0f0174b2f8238240a1a30142e3db7b957a5dd5689b0e75fb717cc78"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:ab36c8eb7e454e34e60eb55ca5d241a5d18b2c6244f6827a30e451c42410b5f7"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:4c0907b1928a36d5a998d72d64d8eaa7244989f7aaaf947500d3a800c83a3fd6"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:04432ad9479fa40ec0f387795ddad4437a2b50417c69fa275e212933519ff294"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-win32.whl", hash = "sha256:3bed14e9c89dcb10e8f3a29f9ccac4955aebe93c71ae803af79265c9ca5644c5"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:49402233c892a461407c512a19435d1ce275543138294f7ef013f0b63d5d3765"}, + {file = "charset_normalizer-3.4.1-py3-none-any.whl", hash = "sha256:d98b1668f06378c6dbefec3b92299716b931cd4e6061f3c875a71ced1780ab85"}, + {file = "charset_normalizer-3.4.1.tar.gz", hash = "sha256:44251f18cd68a75b56585dd00dae26183e102cd5e0f9f1466e6df5da2ed64ea3"}, +] + [[package]] name = "colorama" version = "0.4.6" @@ -285,6 +399,21 @@ ssh = ["bcrypt (>=3.1.5)"] test = ["certifi", "cryptography-vectors (==43.0.3)", "pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-xdist"] test-randomorder = ["pytest-randomly"] +[[package]] +name = "deprecation" +version = "2.1.0" +description = "A library to handle automated deprecations" +optional = false +python-versions = "*" +groups = ["dev"] +files = [ + {file = "deprecation-2.1.0-py2.py3-none-any.whl", hash = "sha256:a10811591210e1fb0e768a8c25517cabeabcba6f0bf96564f8ff45189f90b14a"}, + {file = "deprecation-2.1.0.tar.gz", hash = "sha256:72b3bde64e5d778694b0cf68178aed03d15e15477116add3fb773e581f9518ff"}, +] + +[package.dependencies] +packaging = "*" + [[package]] name = "distlib" version = "0.3.9" @@ -297,6 +426,29 @@ files = [ {file = "distlib-0.3.9.tar.gz", hash = "sha256:a60f20dea646b8a33f3e7772f74dc0b2d0772d2837ee1342a00645c81edf9403"}, ] +[[package]] +name = "docker" +version = "7.1.0" +description = "A Python library for the Docker Engine API." +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "docker-7.1.0-py3-none-any.whl", hash = "sha256:c96b93b7f0a746f9e77d325bcfb87422a3d8bd4f03136ae8a85b37f1898d5fc0"}, + {file = "docker-7.1.0.tar.gz", hash = "sha256:ad8c70e6e3f8926cb8a92619b832b4ea5299e2831c14284663184e200546fa6c"}, +] + +[package.dependencies] +pywin32 = {version = ">=304", markers = "sys_platform == \"win32\""} +requests = ">=2.26.0" +urllib3 = ">=1.26.0" + +[package.extras] +dev = ["coverage (==7.2.7)", "pytest (==7.4.2)", "pytest-cov (==4.1.0)", "pytest-timeout (==2.1.0)", "ruff (==0.1.8)"] +docs = ["myst-parser (==0.18.0)", "sphinx (==5.1.1)"] +ssh = ["paramiko (>=2.4.3)"] +websockets = ["websocket-client (>=1.3.0)"] + [[package]] name = "exceptiongroup" version = "1.2.2" @@ -347,6 +499,21 @@ mccabe = ">=0.7.0,<0.8.0" pycodestyle = ">=2.9.0,<2.10.0" pyflakes = ">=2.5.0,<2.6.0" +[[package]] +name = "idna" +version = "3.10" +description = "Internationalized Domain Names in Applications (IDNA)" +optional = false +python-versions = ">=3.6" +groups = ["dev"] +files = [ + {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, + {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, +] + +[package.extras] +all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"] + [[package]] name = "iniconfig" version = "2.1.0" @@ -736,6 +903,55 @@ files = [ [package.dependencies] six = ">=1.5" +[[package]] +name = "pywin32" +version = "310" +description = "Python for Window Extensions" +optional = false +python-versions = "*" +groups = ["dev"] +markers = "sys_platform == \"win32\"" +files = [ + {file = "pywin32-310-cp310-cp310-win32.whl", hash = "sha256:6dd97011efc8bf51d6793a82292419eba2c71cf8e7250cfac03bba284454abc1"}, + {file = "pywin32-310-cp310-cp310-win_amd64.whl", hash = "sha256:c3e78706e4229b915a0821941a84e7ef420bf2b77e08c9dae3c76fd03fd2ae3d"}, + {file = "pywin32-310-cp310-cp310-win_arm64.whl", hash = "sha256:33babed0cf0c92a6f94cc6cc13546ab24ee13e3e800e61ed87609ab91e4c8213"}, + {file = "pywin32-310-cp311-cp311-win32.whl", hash = "sha256:1e765f9564e83011a63321bb9d27ec456a0ed90d3732c4b2e312b855365ed8bd"}, + {file = "pywin32-310-cp311-cp311-win_amd64.whl", hash = "sha256:126298077a9d7c95c53823934f000599f66ec9296b09167810eb24875f32689c"}, + {file = "pywin32-310-cp311-cp311-win_arm64.whl", hash = "sha256:19ec5fc9b1d51c4350be7bb00760ffce46e6c95eaf2f0b2f1150657b1a43c582"}, + {file = "pywin32-310-cp312-cp312-win32.whl", hash = "sha256:8a75a5cc3893e83a108c05d82198880704c44bbaee4d06e442e471d3c9ea4f3d"}, + {file = "pywin32-310-cp312-cp312-win_amd64.whl", hash = "sha256:bf5c397c9a9a19a6f62f3fb821fbf36cac08f03770056711f765ec1503972060"}, + {file = "pywin32-310-cp312-cp312-win_arm64.whl", hash = "sha256:2349cc906eae872d0663d4d6290d13b90621eaf78964bb1578632ff20e152966"}, + {file = "pywin32-310-cp313-cp313-win32.whl", hash = "sha256:5d241a659c496ada3253cd01cfaa779b048e90ce4b2b38cd44168ad555ce74ab"}, + {file = "pywin32-310-cp313-cp313-win_amd64.whl", hash = "sha256:667827eb3a90208ddbdcc9e860c81bde63a135710e21e4cb3348968e4bd5249e"}, + {file = "pywin32-310-cp313-cp313-win_arm64.whl", hash = "sha256:e308f831de771482b7cf692a1f308f8fca701b2d8f9dde6cc440c7da17e47b33"}, + {file = "pywin32-310-cp38-cp38-win32.whl", hash = "sha256:0867beb8addefa2e3979d4084352e4ac6e991ca45373390775f7084cc0209b9c"}, + {file = "pywin32-310-cp38-cp38-win_amd64.whl", hash = "sha256:30f0a9b3138fb5e07eb4973b7077e1883f558e40c578c6925acc7a94c34eaa36"}, + {file = "pywin32-310-cp39-cp39-win32.whl", hash = "sha256:851c8d927af0d879221e616ae1f66145253537bbdd321a77e8ef701b443a9a1a"}, + {file = "pywin32-310-cp39-cp39-win_amd64.whl", hash = "sha256:96867217335559ac619f00ad70e513c0fcf84b8a3af9fc2bba3b59b97da70475"}, +] + +[[package]] +name = "requests" +version = "2.32.3" +description = "Python HTTP for Humans." +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"}, + {file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"}, +] + +[package.dependencies] +certifi = ">=2017.4.17" +charset-normalizer = ">=2,<4" +idna = ">=2.5,<4" +urllib3 = ">=1.21.1,<3" + +[package.extras] +socks = ["PySocks (>=1.5.6,!=1.5.7)"] +use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] + [[package]] name = "six" version = "1.17.0" @@ -748,6 +964,40 @@ files = [ {file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"}, ] +[[package]] +name = "testcontainers" +version = "3.7.1" +description = "Library provides lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container" +optional = false +python-versions = ">=3.7" +groups = ["dev"] +files = [ + {file = "testcontainers-3.7.1-py2.py3-none-any.whl", hash = "sha256:7f48cef4bf0ccd78f1a4534d4b701a003a3bace851f24eae58a32f9e3f0aeba0"}, +] + +[package.dependencies] +deprecation = "*" +docker = ">=4.0.0" +wrapt = "*" + +[package.extras] +arangodb = ["python-arango"] +azurite = ["azure-storage-blob"] +clickhouse = ["clickhouse-driver"] +docker-compose = ["docker-compose"] +google-cloud-pubsub = ["google-cloud-pubsub (<2)"] +kafka = ["kafka-python"] +keycloak = ["python-keycloak"] +mongo = ["pymongo"] +mssqlserver = ["pymssql"] +mysql = ["pymysql", "sqlalchemy"] +neo4j = ["neo4j"] +oracle = ["cx-Oracle", "sqlalchemy"] +postgresql = ["psycopg2-binary", "sqlalchemy"] +rabbitmq = ["pika"] +redis = ["redis"] +selenium = ["selenium"] + [[package]] name = "tomli" version = "2.2.1" @@ -849,7 +1099,7 @@ version = "2.2.3" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = ">=3.8" -groups = ["main"] +groups = ["main", "dev"] files = [ {file = "urllib3-2.2.3-py3-none-any.whl", hash = "sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac"}, {file = "urllib3-2.2.3.tar.gz", hash = "sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9"}, @@ -882,7 +1132,96 @@ platformdirs = ">=3.9.1,<5" docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.2,!=7.3)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"] test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.4)", "pytest-env (>=0.8.2)", "pytest-freezer (>=0.4.8) ; platform_python_implementation == \"PyPy\" or platform_python_implementation == \"CPython\" and sys_platform == \"win32\" and python_version >= \"3.13\"", "pytest-mock (>=3.11.1)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)", "setuptools (>=68)", "time-machine (>=2.10) ; platform_python_implementation == \"CPython\""] +[[package]] +name = "wrapt" +version = "1.17.2" +description = "Module for decorators, wrappers and monkey patching." +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "wrapt-1.17.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:3d57c572081fed831ad2d26fd430d565b76aa277ed1d30ff4d40670b1c0dd984"}, + {file = "wrapt-1.17.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:b5e251054542ae57ac7f3fba5d10bfff615b6c2fb09abeb37d2f1463f841ae22"}, + {file = "wrapt-1.17.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:80dd7db6a7cb57ffbc279c4394246414ec99537ae81ffd702443335a61dbf3a7"}, + {file = "wrapt-1.17.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0a6e821770cf99cc586d33833b2ff32faebdbe886bd6322395606cf55153246c"}, + {file = "wrapt-1.17.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b60fb58b90c6d63779cb0c0c54eeb38941bae3ecf7a73c764c52c88c2dcb9d72"}, + {file = "wrapt-1.17.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b870b5df5b71d8c3359d21be8f0d6c485fa0ebdb6477dda51a1ea54a9b558061"}, + {file = "wrapt-1.17.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:4011d137b9955791f9084749cba9a367c68d50ab8d11d64c50ba1688c9b457f2"}, + {file = "wrapt-1.17.2-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:1473400e5b2733e58b396a04eb7f35f541e1fb976d0c0724d0223dd607e0f74c"}, + {file = "wrapt-1.17.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:3cedbfa9c940fdad3e6e941db7138e26ce8aad38ab5fe9dcfadfed9db7a54e62"}, + {file = "wrapt-1.17.2-cp310-cp310-win32.whl", hash = "sha256:582530701bff1dec6779efa00c516496968edd851fba224fbd86e46cc6b73563"}, + {file = "wrapt-1.17.2-cp310-cp310-win_amd64.whl", hash = "sha256:58705da316756681ad3c9c73fd15499aa4d8c69f9fd38dc8a35e06c12468582f"}, + {file = "wrapt-1.17.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:ff04ef6eec3eee8a5efef2401495967a916feaa353643defcc03fc74fe213b58"}, + {file = "wrapt-1.17.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4db983e7bca53819efdbd64590ee96c9213894272c776966ca6306b73e4affda"}, + {file = "wrapt-1.17.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:9abc77a4ce4c6f2a3168ff34b1da9b0f311a8f1cfd694ec96b0603dff1c79438"}, + {file = "wrapt-1.17.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0b929ac182f5ace000d459c59c2c9c33047e20e935f8e39371fa6e3b85d56f4a"}, + {file = "wrapt-1.17.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f09b286faeff3c750a879d336fb6d8713206fc97af3adc14def0cdd349df6000"}, + {file = "wrapt-1.17.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1a7ed2d9d039bd41e889f6fb9364554052ca21ce823580f6a07c4ec245c1f5d6"}, + {file = "wrapt-1.17.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:129a150f5c445165ff941fc02ee27df65940fcb8a22a61828b1853c98763a64b"}, + {file = "wrapt-1.17.2-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:1fb5699e4464afe5c7e65fa51d4f99e0b2eadcc176e4aa33600a3df7801d6662"}, + {file = "wrapt-1.17.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:9a2bce789a5ea90e51a02dfcc39e31b7f1e662bc3317979aa7e5538e3a034f72"}, + {file = "wrapt-1.17.2-cp311-cp311-win32.whl", hash = "sha256:4afd5814270fdf6380616b321fd31435a462019d834f83c8611a0ce7484c7317"}, + {file = "wrapt-1.17.2-cp311-cp311-win_amd64.whl", hash = "sha256:acc130bc0375999da18e3d19e5a86403667ac0c4042a094fefb7eec8ebac7cf3"}, + {file = "wrapt-1.17.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:d5e2439eecc762cd85e7bd37161d4714aa03a33c5ba884e26c81559817ca0925"}, + {file = "wrapt-1.17.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:3fc7cb4c1c744f8c05cd5f9438a3caa6ab94ce8344e952d7c45a8ed59dd88392"}, + {file = "wrapt-1.17.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8fdbdb757d5390f7c675e558fd3186d590973244fab0c5fe63d373ade3e99d40"}, + {file = "wrapt-1.17.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5bb1d0dbf99411f3d871deb6faa9aabb9d4e744d67dcaaa05399af89d847a91d"}, + {file = "wrapt-1.17.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d18a4865f46b8579d44e4fe1e2bcbc6472ad83d98e22a26c963d46e4c125ef0b"}, + {file = "wrapt-1.17.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc570b5f14a79734437cb7b0500376b6b791153314986074486e0b0fa8d71d98"}, + {file = "wrapt-1.17.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:6d9187b01bebc3875bac9b087948a2bccefe464a7d8f627cf6e48b1bbae30f82"}, + {file = "wrapt-1.17.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:9e8659775f1adf02eb1e6f109751268e493c73716ca5761f8acb695e52a756ae"}, + {file = "wrapt-1.17.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e8b2816ebef96d83657b56306152a93909a83f23994f4b30ad4573b00bd11bb9"}, + {file = "wrapt-1.17.2-cp312-cp312-win32.whl", hash = "sha256:468090021f391fe0056ad3e807e3d9034e0fd01adcd3bdfba977b6fdf4213ea9"}, + {file = "wrapt-1.17.2-cp312-cp312-win_amd64.whl", hash = "sha256:ec89ed91f2fa8e3f52ae53cd3cf640d6feff92ba90d62236a81e4e563ac0e991"}, + {file = "wrapt-1.17.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:6ed6ffac43aecfe6d86ec5b74b06a5be33d5bb9243d055141e8cabb12aa08125"}, + {file = "wrapt-1.17.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:35621ae4c00e056adb0009f8e86e28eb4a41a4bfa8f9bfa9fca7d343fe94f998"}, + {file = "wrapt-1.17.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:a604bf7a053f8362d27eb9fefd2097f82600b856d5abe996d623babd067b1ab5"}, + {file = "wrapt-1.17.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5cbabee4f083b6b4cd282f5b817a867cf0b1028c54d445b7ec7cfe6505057cf8"}, + {file = "wrapt-1.17.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:49703ce2ddc220df165bd2962f8e03b84c89fee2d65e1c24a7defff6f988f4d6"}, + {file = "wrapt-1.17.2-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8112e52c5822fc4253f3901b676c55ddf288614dc7011634e2719718eaa187dc"}, + {file = "wrapt-1.17.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:9fee687dce376205d9a494e9c121e27183b2a3df18037f89d69bd7b35bcf59e2"}, + {file = "wrapt-1.17.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:18983c537e04d11cf027fbb60a1e8dfd5190e2b60cc27bc0808e653e7b218d1b"}, + {file = "wrapt-1.17.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:703919b1633412ab54bcf920ab388735832fdcb9f9a00ae49387f0fe67dad504"}, + {file = "wrapt-1.17.2-cp313-cp313-win32.whl", hash = "sha256:abbb9e76177c35d4e8568e58650aa6926040d6a9f6f03435b7a522bf1c487f9a"}, + {file = "wrapt-1.17.2-cp313-cp313-win_amd64.whl", hash = "sha256:69606d7bb691b50a4240ce6b22ebb319c1cfb164e5f6569835058196e0f3a845"}, + {file = "wrapt-1.17.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:4a721d3c943dae44f8e243b380cb645a709ba5bd35d3ad27bc2ed947e9c68192"}, + {file = "wrapt-1.17.2-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:766d8bbefcb9e00c3ac3b000d9acc51f1b399513f44d77dfe0eb026ad7c9a19b"}, + {file = "wrapt-1.17.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:e496a8ce2c256da1eb98bd15803a79bee00fc351f5dfb9ea82594a3f058309e0"}, + {file = "wrapt-1.17.2-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:40d615e4fe22f4ad3528448c193b218e077656ca9ccb22ce2cb20db730f8d306"}, + {file = "wrapt-1.17.2-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a5aaeff38654462bc4b09023918b7f21790efb807f54c000a39d41d69cf552cb"}, + {file = "wrapt-1.17.2-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9a7d15bbd2bc99e92e39f49a04653062ee6085c0e18b3b7512a4f2fe91f2d681"}, + {file = "wrapt-1.17.2-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:e3890b508a23299083e065f435a492b5435eba6e304a7114d2f919d400888cc6"}, + {file = "wrapt-1.17.2-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:8c8b293cd65ad716d13d8dd3624e42e5a19cc2a2f1acc74b30c2c13f15cb61a6"}, + {file = "wrapt-1.17.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:4c82b8785d98cdd9fed4cac84d765d234ed3251bd6afe34cb7ac523cb93e8b4f"}, + {file = "wrapt-1.17.2-cp313-cp313t-win32.whl", hash = "sha256:13e6afb7fe71fe7485a4550a8844cc9ffbe263c0f1a1eea569bc7091d4898555"}, + {file = "wrapt-1.17.2-cp313-cp313t-win_amd64.whl", hash = "sha256:eaf675418ed6b3b31c7a989fd007fa7c3be66ce14e5c3b27336383604c9da85c"}, + {file = "wrapt-1.17.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:5c803c401ea1c1c18de70a06a6f79fcc9c5acfc79133e9869e730ad7f8ad8ef9"}, + {file = "wrapt-1.17.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:f917c1180fdb8623c2b75a99192f4025e412597c50b2ac870f156de8fb101119"}, + {file = "wrapt-1.17.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:ecc840861360ba9d176d413a5489b9a0aff6d6303d7e733e2c4623cfa26904a6"}, + {file = "wrapt-1.17.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bb87745b2e6dc56361bfde481d5a378dc314b252a98d7dd19a651a3fa58f24a9"}, + {file = "wrapt-1.17.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:58455b79ec2661c3600e65c0a716955adc2410f7383755d537584b0de41b1d8a"}, + {file = "wrapt-1.17.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b4e42a40a5e164cbfdb7b386c966a588b1047558a990981ace551ed7e12ca9c2"}, + {file = "wrapt-1.17.2-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:91bd7d1773e64019f9288b7a5101f3ae50d3d8e6b1de7edee9c2ccc1d32f0c0a"}, + {file = "wrapt-1.17.2-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:bb90fb8bda722a1b9d48ac1e6c38f923ea757b3baf8ebd0c82e09c5c1a0e7a04"}, + {file = "wrapt-1.17.2-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:08e7ce672e35efa54c5024936e559469436f8b8096253404faeb54d2a878416f"}, + {file = "wrapt-1.17.2-cp38-cp38-win32.whl", hash = "sha256:410a92fefd2e0e10d26210e1dfb4a876ddaf8439ef60d6434f21ef8d87efc5b7"}, + {file = "wrapt-1.17.2-cp38-cp38-win_amd64.whl", hash = "sha256:95c658736ec15602da0ed73f312d410117723914a5c91a14ee4cdd72f1d790b3"}, + {file = "wrapt-1.17.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:99039fa9e6306880572915728d7f6c24a86ec57b0a83f6b2491e1d8ab0235b9a"}, + {file = "wrapt-1.17.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:2696993ee1eebd20b8e4ee4356483c4cb696066ddc24bd70bcbb80fa56ff9061"}, + {file = "wrapt-1.17.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:612dff5db80beef9e649c6d803a8d50c409082f1fedc9dbcdfde2983b2025b82"}, + {file = "wrapt-1.17.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:62c2caa1585c82b3f7a7ab56afef7b3602021d6da34fbc1cf234ff139fed3cd9"}, + {file = "wrapt-1.17.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c958bcfd59bacc2d0249dcfe575e71da54f9dcf4a8bdf89c4cb9a68a1170d73f"}, + {file = "wrapt-1.17.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fc78a84e2dfbc27afe4b2bd7c80c8db9bca75cc5b85df52bfe634596a1da846b"}, + {file = "wrapt-1.17.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:ba0f0eb61ef00ea10e00eb53a9129501f52385c44853dbd6c4ad3f403603083f"}, + {file = "wrapt-1.17.2-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:1e1fe0e6ab7775fd842bc39e86f6dcfc4507ab0ffe206093e76d61cde37225c8"}, + {file = "wrapt-1.17.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:c86563182421896d73858e08e1db93afdd2b947a70064b813d515d66549e15f9"}, + {file = "wrapt-1.17.2-cp39-cp39-win32.whl", hash = "sha256:f393cda562f79828f38a819f4788641ac7c4085f30f1ce1a68672baa686482bb"}, + {file = "wrapt-1.17.2-cp39-cp39-win_amd64.whl", hash = "sha256:36ccae62f64235cf8ddb682073a60519426fdd4725524ae38874adf72b5f2aeb"}, + {file = "wrapt-1.17.2-py3-none-any.whl", hash = "sha256:b18f2d1533a71f069c7f82d524a52599053d4c7166e9dd374ae2136b7f40f7c8"}, + {file = "wrapt-1.17.2.tar.gz", hash = "sha256:41388e9d4d1522446fe79d3213196bd9e3b301a336965b9e27ca2788ebd122f3"}, +] + [metadata] lock-version = "2.1" python-versions = ">=3.8" -content-hash = "719b51a8b8c6e8ff59dae16de8d11780b8de6f3936b7ce8f27e4c1d73f7758a6" +content-hash = "f631f2a362d9484bf12172f6a7a8e6bd87332668cb8eee3c60818dfca349d89a" diff --git a/pyproject.toml b/pyproject.toml index 1ec49a63..60b101d9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,7 @@ tox = ">= 3.9.0" flake8 = ">= 4.0.0" types-python-dateutil = ">= 2.8.19.14" mypy = ">= 1.5" +testcontainers = "3.7.1" [build-system] requires = ["poetry-core>=1.0.0"] diff --git a/test/auth/__init__.py b/test/auth/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/test/auth/test_client_credentials_authenticator.py b/test/auth/test_client_credentials_authenticator.py new file mode 100644 index 00000000..7b4ee934 --- /dev/null +++ b/test/auth/test_client_credentials_authenticator.py @@ -0,0 +1,29 @@ +import time +from datetime import datetime, timezone + +from test.auth.test_oauth_authenticator import OAuthAuthenticatorTest +from zitadel_client.auth.client_credentials_authenticator import ClientCredentialsAuthenticator + + +class ClientCredentialsAuthenticatorTest(OAuthAuthenticatorTest): + """ + Test for ClientCredentialsAuthenticator to verify token refresh functionality. + Extends the base OAuthAuthenticatorTest class. + """ + + def test_refresh_token(self): + time.sleep(20) + + authenticator = ClientCredentialsAuthenticator.builder(self.oauth_host, "dummy-client", "dummy-secret") \ + .scopes({"openid", "foo"}) \ + .build() + + self.assertTrue(authenticator.get_auth_token(), "Access token should not be empty") + token = authenticator.refresh_token() + self.assertEqual({"Authorization": "Bearer " + token.access_token}, authenticator.get_auth_headers()) + self.assertTrue(token.access_token, "Access token should not be null") + self.assertTrue(token.expires_at > datetime.now(timezone.utc), "Token expiry should be in the future") + self.assertEqual(token.access_token, authenticator.get_auth_token()) + self.assertEqual(self.oauth_host, authenticator.get_host()) + self.assertNotEqual(authenticator.refresh_token().access_token, authenticator.refresh_token().access_token, + "Two refreshToken calls should produce different tokens") diff --git a/test/auth/test_no_auth_authenticator.py b/test/auth/test_no_auth_authenticator.py new file mode 100644 index 00000000..d42fc403 --- /dev/null +++ b/test/auth/test_no_auth_authenticator.py @@ -0,0 +1,15 @@ +import unittest + +from zitadel_client.auth.no_auth_authenticator import NoAuthAuthenticator + + +class NoAuthAuthenticatorTest(unittest.TestCase): + def test_returns_empty_headers_and_default_host(self): + auth = NoAuthAuthenticator() + self.assertEqual({}, auth.get_auth_headers()) + self.assertEqual("http://localhost", auth.get_host()) + + def test_returns_empty_headers_and_custom_host(self): + auth = NoAuthAuthenticator("https://custom-host") + self.assertEqual({}, auth.get_auth_headers()) + self.assertEqual("https://custom-host", auth.get_host()) diff --git a/test/auth/test_oauth_authenticator.py b/test/auth/test_oauth_authenticator.py new file mode 100644 index 00000000..45e37a35 --- /dev/null +++ b/test/auth/test_oauth_authenticator.py @@ -0,0 +1,32 @@ +import unittest + +from testcontainers.core.container import DockerContainer + + +class OAuthAuthenticatorTest(unittest.TestCase): + """ + Base test class for OAuth authenticators. + + This class starts a Docker container running the mock OAuth2 server + (ghcr.io/navikt/mock-oauth2-server:2.1.10) before any tests run and stops it after all tests. + It sets the class variable `oauth_host` to the container’s accessible URL. + + The container is configured to wait for an HTTP response from the "/" endpoint + with a status code of 405, using HttpWaitStrategy. + """ + oauth_host: str = None + mock_oauth2_server: DockerContainer = None + + @classmethod + def setUpClass(cls): + cls.mock_oauth2_server = DockerContainer("ghcr.io/navikt/mock-oauth2-server:2.1.10") \ + .with_exposed_ports(8080) + cls.mock_oauth2_server.start() + host = cls.mock_oauth2_server.get_container_host_ip() + port = cls.mock_oauth2_server.get_exposed_port(8080) + cls.oauth_host = f"http://{host}:{port}" + + @classmethod + def tearDownClass(cls): + if cls.mock_oauth2_server is not None: + cls.mock_oauth2_server.stop() diff --git a/test/auth/test_personal_access_authenticator.py b/test/auth/test_personal_access_authenticator.py new file mode 100644 index 00000000..2b143ed3 --- /dev/null +++ b/test/auth/test_personal_access_authenticator.py @@ -0,0 +1,10 @@ +import unittest + +from zitadel_client.auth.personal_access_token_authenticator import PersonalAccessTokenAuthenticator + + +class PersonalAccessTokenAuthenticatorTest(unittest.TestCase): + def test_returns_expected_headers_and_host(self): + auth = PersonalAccessTokenAuthenticator("https://api.example.com", "my-secret-token") + self.assertEqual({"Authorization": "Bearer my-secret-token"}, auth.get_auth_headers()) + self.assertEqual("https://api.example.com", auth.get_host()) diff --git a/test/auth/test_web_token_authenticator.py b/test/auth/test_web_token_authenticator.py new file mode 100644 index 00000000..1ab33999 --- /dev/null +++ b/test/auth/test_web_token_authenticator.py @@ -0,0 +1,38 @@ +import time +from datetime import datetime, timezone + +from cryptography.hazmat.primitives.asymmetric import rsa +from cryptography.hazmat.primitives.serialization import Encoding, PrivateFormat, NoEncryption + +from test.auth.test_oauth_authenticator import OAuthAuthenticatorTest +from zitadel_client.auth.web_token_authenticator import WebTokenAuthenticator + + +class WebTokenAuthenticatorTest(OAuthAuthenticatorTest): + """ + Test for WebTokenAuthenticator to verify JWT token refresh functionality using the builder. + """ + + def test_refresh_token_using_builder(self): + time.sleep(20) + + key = rsa.generate_private_key(public_exponent=65537, key_size=2048) + private_key_pem = key.private_bytes( + encoding=Encoding.PEM, + format=PrivateFormat.PKCS8, + encryption_algorithm=NoEncryption() + ).decode('utf-8') + + authenticator = WebTokenAuthenticator.builder(self.oauth_host, "dummy-client", private_key_pem) \ + .token_lifetime_seconds(3600) \ + .build() + + self.assertTrue(authenticator.get_auth_token(), "Access token should not be empty") + token = authenticator.refresh_token() + self.assertEqual({"Authorization": "Bearer " + token.access_token}, authenticator.get_auth_headers()) + self.assertTrue(token.access_token, "Access token should not be null") + self.assertTrue(token.expires_at > datetime.now(timezone.utc), "Token expiry should be in the future") + self.assertEqual(token.access_token, authenticator.get_auth_token()) + self.assertEqual(self.oauth_host, authenticator.get_host()) + self.assertNotEqual(authenticator.refresh_token().access_token, authenticator.refresh_token().access_token, + "Two refreshToken calls should produce different tokens") diff --git a/test/test_add_organization_request_admin.py b/test/test_add_organization_request_admin.py deleted file mode 100644 index 4b0220c0..00000000 --- a/test/test_add_organization_request_admin.py +++ /dev/null @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.add_organization_request_admin import AddOrganizationRequestAdmin - -class TestAddOrganizationRequestAdmin(unittest.TestCase): - """AddOrganizationRequestAdmin unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> AddOrganizationRequestAdmin: - """Test AddOrganizationRequestAdmin - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `AddOrganizationRequestAdmin` - """ - model = AddOrganizationRequestAdmin() - if include_optional: - return AddOrganizationRequestAdmin( - user_id = '', - human = zitadel_client.models.v2_add_human_user_request.v2AddHumanUserRequest( - user_id = 'd654e6ba-70a3-48ef-a95d-37c8d8a7901a', - username = 'minnie-mouse', - organization = zitadel_client.models.zitadelobjectv2_organization.zitadelobjectv2Organization( - org_id = '', - org_domain = '', ), - profile = zitadel_client.models.v2_set_human_profile.v2SetHumanProfile( - given_name = 'Minnie', - family_name = 'Mouse', - nick_name = 'Mini', - display_name = 'Minnie Mouse', - preferred_language = 'en', - gender = 'GENDER_UNSPECIFIED', ), - email = zitadel_client.models.v2_set_human_email.v2SetHumanEmail( - email = 'mini@mouse.com', - send_code = zitadel_client.models.v2_send_email_verification_code.v2SendEmailVerificationCode( - url_template = 'https://example.com/email/verify?userID={{.UserID}}&code={{.Code}}&orgID={{.OrgID}}', ), - return_code = zitadel_client.models.v2_return_email_verification_code.v2ReturnEmailVerificationCode(), - is_verified = True, ), - phone = zitadel_client.models.v2_set_human_phone.v2SetHumanPhone( - is_verified = True, ), - metadata = [ - zitadel_client.models.v2_set_metadata_entry.v2SetMetadataEntry( - key = 'my-key', - value = '[B@4a67318f', ) - ], - password = zitadel_client.models.v2_password.v2Password( - password = 'Secr3tP4ssw0rd!', - change_required = True, ), - hashed_password = zitadel_client.models.v2_hashed_password.v2HashedPassword( - hash = '$2a$12$lJ08fqVr8bFJilRVnDT9QeULI7YW.nT3iwUv6dyg0aCrfm3UY8XR2', - change_required = True, ), - idp_links = [ - zitadel_client.models.v2_idp_link.v2IDPLink( - idp_id = 'd654e6ba-70a3-48ef-a95d-37c8d8a7901a', - user_id = '6516849804890468048461403518', - user_name = 'user@external.com', ) - ], - totp_secret = 'TJOPWSDYILLHXFV4MLKNNJOWFG7VSDCK', ), - roles = [ - '' - ] - ) - else: - return AddOrganizationRequestAdmin( - ) - """ - - def testAddOrganizationRequestAdmin(self): - """Test AddOrganizationRequestAdmin""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_add_organization_response_created_admin.py b/test/test_add_organization_response_created_admin.py deleted file mode 100644 index 1a97988d..00000000 --- a/test/test_add_organization_response_created_admin.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.add_organization_response_created_admin import AddOrganizationResponseCreatedAdmin - -class TestAddOrganizationResponseCreatedAdmin(unittest.TestCase): - """AddOrganizationResponseCreatedAdmin unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> AddOrganizationResponseCreatedAdmin: - """Test AddOrganizationResponseCreatedAdmin - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `AddOrganizationResponseCreatedAdmin` - """ - model = AddOrganizationResponseCreatedAdmin() - if include_optional: - return AddOrganizationResponseCreatedAdmin( - user_id = '', - email_code = '', - phone_code = '' - ) - else: - return AddOrganizationResponseCreatedAdmin( - ) - """ - - def testAddOrganizationResponseCreatedAdmin(self): - """Test AddOrganizationResponseCreatedAdmin""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_feature_service_api.py b/test/test_feature_service_api.py deleted file mode 100644 index 16da419e..00000000 --- a/test/test_feature_service_api.py +++ /dev/null @@ -1,115 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.api.feature_service_api import FeatureServiceApi - - -class TestFeatureServiceApi(unittest.TestCase): - """FeatureServiceApi unit test stubs""" - - def setUp(self) -> None: - self.api = FeatureServiceApi() - - def tearDown(self) -> None: - pass - - def test_get_instance_features(self) -> None: - """Test case for get_instance_features - - Get instance level features - """ - pass - - def test_get_organization_features(self) -> None: - """Test case for get_organization_features - - Get organization level features - """ - pass - - def test_get_system_features(self) -> None: - """Test case for get_system_features - - Get system level features - """ - pass - - def test_get_user_features(self) -> None: - """Test case for get_user_features - - Get organization level features - """ - pass - - def test_reset_instance_features(self) -> None: - """Test case for reset_instance_features - - Reset instance level features - """ - pass - - def test_reset_organization_features(self) -> None: - """Test case for reset_organization_features - - Reset organization level features - """ - pass - - def test_reset_system_features(self) -> None: - """Test case for reset_system_features - - Reset system level features - """ - pass - - def test_reset_user_features(self) -> None: - """Test case for reset_user_features - - Reset user level features - """ - pass - - def test_set_instance_features(self) -> None: - """Test case for set_instance_features - - Set instance level features - """ - pass - - def test_set_organization_features(self) -> None: - """Test case for set_organization_features - - Set organization level features - """ - pass - - def test_set_system_features(self) -> None: - """Test case for set_system_features - - Set system level features - """ - pass - - def test_set_user_features(self) -> None: - """Test case for set_user_features - - Set user level features - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_identity_provider_service_api.py b/test/test_identity_provider_service_api.py deleted file mode 100644 index a8ecf0fe..00000000 --- a/test/test_identity_provider_service_api.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.api.identity_provider_service_api import IdentityProviderServiceApi - - -class TestIdentityProviderServiceApi(unittest.TestCase): - """IdentityProviderServiceApi unit test stubs""" - - def setUp(self) -> None: - self.api = IdentityProviderServiceApi() - - def tearDown(self) -> None: - pass - - def test_get_idpby_id(self) -> None: - """Test case for get_idpby_id - - Get identity provider (IdP) by ID - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_objectv2_list_details.py b/test/test_objectv2_list_details.py deleted file mode 100644 index b646dce1..00000000 --- a/test/test_objectv2_list_details.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.objectv2_list_details import Objectv2ListDetails - -class TestObjectv2ListDetails(unittest.TestCase): - """Objectv2ListDetails unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Objectv2ListDetails: - """Test Objectv2ListDetails - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Objectv2ListDetails` - """ - model = Objectv2ListDetails() - if include_optional: - return Objectv2ListDetails( - total_result = '2', - processed_sequence = '267831', - timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') - ) - else: - return Objectv2ListDetails( - ) - """ - - def testObjectv2ListDetails(self): - """Test Objectv2ListDetails""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_objectv2_list_query.py b/test/test_objectv2_list_query.py deleted file mode 100644 index 68b27a75..00000000 --- a/test/test_objectv2_list_query.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.objectv2_list_query import Objectv2ListQuery - -class TestObjectv2ListQuery(unittest.TestCase): - """Objectv2ListQuery unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Objectv2ListQuery: - """Test Objectv2ListQuery - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Objectv2ListQuery` - """ - model = Objectv2ListQuery() - if include_optional: - return Objectv2ListQuery( - offset = '0', - limit = 100, - asc = True - ) - else: - return Objectv2ListQuery( - ) - """ - - def testObjectv2ListQuery(self): - """Test Objectv2ListQuery""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_oidc_service_api.py b/test/test_oidc_service_api.py deleted file mode 100644 index e5b2c9a8..00000000 --- a/test/test_oidc_service_api.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.api.oidc_service_api import OIDCServiceApi - - -class TestOIDCServiceApi(unittest.TestCase): - """OIDCServiceApi unit test stubs""" - - def setUp(self) -> None: - self.api = OIDCServiceApi() - - def tearDown(self) -> None: - pass - - def test_create_callback(self) -> None: - """Test case for create_callback - - Finalize an Auth Request and get the callback URL. - """ - pass - - def test_get_auth_request(self) -> None: - """Test case for get_auth_request - - Get OIDC Auth Request details - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_oidc_service_create_callback_body.py b/test/test_oidc_service_create_callback_body.py deleted file mode 100644 index ea583d3b..00000000 --- a/test/test_oidc_service_create_callback_body.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.oidc_service_create_callback_body import OIDCServiceCreateCallbackBody - -class TestOIDCServiceCreateCallbackBody(unittest.TestCase): - """OIDCServiceCreateCallbackBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> OIDCServiceCreateCallbackBody: - """Test OIDCServiceCreateCallbackBody - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `OIDCServiceCreateCallbackBody` - """ - model = OIDCServiceCreateCallbackBody() - if include_optional: - return OIDCServiceCreateCallbackBody( - session = zitadel_client.models.v2_session.v2Session( - session_id = '163840776835432705', - session_token = '0', ), - error = zitadel_client.models.v2_authorization_error.v2AuthorizationError( - error = 'ERROR_REASON_UNSPECIFIED', - error_description = '', - error_uri = '', ) - ) - else: - return OIDCServiceCreateCallbackBody( - ) - """ - - def testOIDCServiceCreateCallbackBody(self): - """Test OIDCServiceCreateCallbackBody""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_organization_service_api.py b/test/test_organization_service_api.py deleted file mode 100644 index c3e26603..00000000 --- a/test/test_organization_service_api.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.api.organization_service_api import OrganizationServiceApi - - -class TestOrganizationServiceApi(unittest.TestCase): - """OrganizationServiceApi unit test stubs""" - - def setUp(self) -> None: - self.api = OrganizationServiceApi() - - def tearDown(self) -> None: - pass - - def test_add_organization(self) -> None: - """Test case for add_organization - - Create an Organization - """ - pass - - def test_list_organizations(self) -> None: - """Test case for list_organizations - - Search Organizations - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_otp_email_send_code.py b/test/test_otp_email_send_code.py deleted file mode 100644 index bba5522e..00000000 --- a/test/test_otp_email_send_code.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.otp_email_send_code import OTPEmailSendCode - -class TestOTPEmailSendCode(unittest.TestCase): - """OTPEmailSendCode unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> OTPEmailSendCode: - """Test OTPEmailSendCode - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `OTPEmailSendCode` - """ - model = OTPEmailSendCode() - if include_optional: - return OTPEmailSendCode( - url_template = 'https://example.com/otp/verify?userID={{.UserID}}&code={{.Code}}' - ) - else: - return OTPEmailSendCode( - ) - """ - - def testOTPEmailSendCode(self): - """Test OTPEmailSendCode""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_protobuf_any.py b/test/test_protobuf_any.py deleted file mode 100644 index 817015dd..00000000 --- a/test/test_protobuf_any.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.protobuf_any import ProtobufAny - -class TestProtobufAny(unittest.TestCase): - """ProtobufAny unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ProtobufAny: - """Test ProtobufAny - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ProtobufAny` - """ - model = ProtobufAny() - if include_optional: - return ProtobufAny( - type = '' - ) - else: - return ProtobufAny( - ) - """ - - def testProtobufAny(self): - """Test ProtobufAny""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_request_challenges_otp_email.py b/test/test_request_challenges_otp_email.py deleted file mode 100644 index 05a39503..00000000 --- a/test/test_request_challenges_otp_email.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.request_challenges_otp_email import RequestChallengesOTPEmail - -class TestRequestChallengesOTPEmail(unittest.TestCase): - """RequestChallengesOTPEmail unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> RequestChallengesOTPEmail: - """Test RequestChallengesOTPEmail - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `RequestChallengesOTPEmail` - """ - model = RequestChallengesOTPEmail() - if include_optional: - return RequestChallengesOTPEmail( - send_code = zitadel_client.models.otp_email_send_code.OTPEmailSendCode( - url_template = 'https://example.com/otp/verify?userID={{.UserID}}&code={{.Code}}', ), - return_code = zitadel_client.models.otp_email_return_code.OTPEmailReturnCode() - ) - else: - return RequestChallengesOTPEmail( - ) - """ - - def testRequestChallengesOTPEmail(self): - """Test RequestChallengesOTPEmail""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_request_challenges_otpsms.py b/test/test_request_challenges_otpsms.py deleted file mode 100644 index 2fc4cb62..00000000 --- a/test/test_request_challenges_otpsms.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.request_challenges_otpsms import RequestChallengesOTPSMS - -class TestRequestChallengesOTPSMS(unittest.TestCase): - """RequestChallengesOTPSMS unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> RequestChallengesOTPSMS: - """Test RequestChallengesOTPSMS - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `RequestChallengesOTPSMS` - """ - model = RequestChallengesOTPSMS() - if include_optional: - return RequestChallengesOTPSMS( - return_code = True - ) - else: - return RequestChallengesOTPSMS( - ) - """ - - def testRequestChallengesOTPSMS(self): - """Test RequestChallengesOTPSMS""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_rpc_status.py b/test/test_rpc_status.py deleted file mode 100644 index cbcc7b15..00000000 --- a/test/test_rpc_status.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.rpc_status import RpcStatus - -class TestRpcStatus(unittest.TestCase): - """RpcStatus unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> RpcStatus: - """Test RpcStatus - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `RpcStatus` - """ - model = RpcStatus() - if include_optional: - return RpcStatus( - code = 56, - message = '', - details = [ - { - 'key' : None - } - ] - ) - else: - return RpcStatus( - ) - """ - - def testRpcStatus(self): - """Test RpcStatus""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_session_service_api.py b/test/test_session_service_api.py deleted file mode 100644 index 321956a4..00000000 --- a/test/test_session_service_api.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.api.session_service_api import SessionServiceApi - - -class TestSessionServiceApi(unittest.TestCase): - """SessionServiceApi unit test stubs""" - - def setUp(self) -> None: - self.api = SessionServiceApi() - - def tearDown(self) -> None: - pass - - def test_create_session(self) -> None: - """Test case for create_session - - Create a new session - """ - pass - - def test_delete_session(self) -> None: - """Test case for delete_session - - Terminate an existing session - """ - pass - - def test_get_session(self) -> None: - """Test case for get_session - - Get a session - """ - pass - - def test_list_sessions(self) -> None: - """Test case for list_sessions - - Search sessions - """ - pass - - def test_set_session(self) -> None: - """Test case for set_session - - Update an existing session - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_session_service_delete_session_body.py b/test/test_session_service_delete_session_body.py deleted file mode 100644 index 704f6bf3..00000000 --- a/test/test_session_service_delete_session_body.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.session_service_delete_session_body import SessionServiceDeleteSessionBody - -class TestSessionServiceDeleteSessionBody(unittest.TestCase): - """SessionServiceDeleteSessionBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> SessionServiceDeleteSessionBody: - """Test SessionServiceDeleteSessionBody - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `SessionServiceDeleteSessionBody` - """ - model = SessionServiceDeleteSessionBody() - if include_optional: - return SessionServiceDeleteSessionBody( - session_token = '' - ) - else: - return SessionServiceDeleteSessionBody( - ) - """ - - def testSessionServiceDeleteSessionBody(self): - """Test SessionServiceDeleteSessionBody""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_session_service_set_session_body.py b/test/test_session_service_set_session_body.py deleted file mode 100644 index a23aa9d5..00000000 --- a/test/test_session_service_set_session_body.py +++ /dev/null @@ -1,81 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.session_service_set_session_body import SessionServiceSetSessionBody - -class TestSessionServiceSetSessionBody(unittest.TestCase): - """SessionServiceSetSessionBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> SessionServiceSetSessionBody: - """Test SessionServiceSetSessionBody - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `SessionServiceSetSessionBody` - """ - model = SessionServiceSetSessionBody() - if include_optional: - return SessionServiceSetSessionBody( - session_token = '0', - checks = zitadel_client.models.v2_checks.v2Checks( - user = zitadel_client.models.v2_check_user.v2CheckUser( - user_id = 'd654e6ba-70a3-48ef-a95d-37c8d8a7901a', - login_name = 'mini@mouse.com', ), - password = zitadel_client.models.v2_check_password.v2CheckPassword(), - web_auth_n = zitadel_client.models.v2_check_web_auth_n.v2CheckWebAuthN( - credential_assertion_data = zitadel_client.models.credential_assertion_data.credentialAssertionData(), ), - idp_intent = zitadel_client.models.v2_check_idp_intent.v2CheckIDPIntent( - idp_intent_id = 'd654e6ba-70a3-48ef-a95d-37c8d8a7901a', - idp_intent_token = 'SJKL3ioIDpo342ioqw98fjp3sdf32wahb=', ), - totp = zitadel_client.models.v2_check_totp.v2CheckTOTP( - code = '323764', ), - otp_sms = zitadel_client.models.v2_check_otp.v2CheckOTP( - code = '3237642', ), - otp_email = zitadel_client.models.v2_check_otp.v2CheckOTP( - code = '3237642', ), ), - metadata = { - 'key' : 'YQ==' - }, - challenges = zitadel_client.models.v2_request_challenges.v2RequestChallenges( - web_auth_n = zitadel_client.models.v2_request_challenges_web_auth_n.v2RequestChallengesWebAuthN( - domain = '', - user_verification_requirement = 'USER_VERIFICATION_REQUIREMENT_UNSPECIFIED', ), - otp_sms = zitadel_client.models.request_challenges_otpsms.RequestChallengesOTPSMS( - return_code = True, ), - otp_email = zitadel_client.models.request_challenges_otp_email.RequestChallengesOTPEmail( - send_code = zitadel_client.models.otp_email_send_code.OTPEmailSendCode( - url_template = 'https://example.com/otp/verify?userID={{.UserID}}&code={{.Code}}', ), - return_code = zitadel_client.models.otp_email_return_code.OTPEmailReturnCode(), ), ), - lifetime = '18000s' - ) - else: - return SessionServiceSetSessionBody( - ) - """ - - def testSessionServiceSetSessionBody(self): - """Test SessionServiceSetSessionBody""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_settings_api.py b/test/test_settings_api.py deleted file mode 100644 index f7e08a45..00000000 --- a/test/test_settings_api.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.api.settings_api import SettingsApi - - -class TestSettingsApi(unittest.TestCase): - """SettingsApi unit test stubs""" - - def setUp(self) -> None: - self.api = SettingsApi() - - def tearDown(self) -> None: - pass - - def test_get_security_settings(self) -> None: - """Test case for get_security_settings - - Get Security Settings - """ - pass - - def test_set_security_settings(self) -> None: - """Test case for set_security_settings - - Set Security Settings - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_settings_service_api.py b/test/test_settings_service_api.py deleted file mode 100644 index c3d7d3a2..00000000 --- a/test/test_settings_service_api.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.api.settings_service_api import SettingsServiceApi - - -class TestSettingsServiceApi(unittest.TestCase): - """SettingsServiceApi unit test stubs""" - - def setUp(self) -> None: - self.api = SettingsServiceApi() - - def tearDown(self) -> None: - pass - - def test_get_active_identity_providers(self) -> None: - """Test case for get_active_identity_providers - - Get the current active identity providers - """ - pass - - def test_get_branding_settings(self) -> None: - """Test case for get_branding_settings - - Get the current active branding settings - """ - pass - - def test_get_domain_settings(self) -> None: - """Test case for get_domain_settings - - Get the domain settings - """ - pass - - def test_get_general_settings(self) -> None: - """Test case for get_general_settings - - Get basic information over the instance - """ - pass - - def test_get_legal_and_support_settings(self) -> None: - """Test case for get_legal_and_support_settings - - Get the legal and support settings - """ - pass - - def test_get_lockout_settings(self) -> None: - """Test case for get_lockout_settings - - Get the lockout settings - """ - pass - - def test_get_login_settings(self) -> None: - """Test case for get_login_settings - - Get the login settings - """ - pass - - def test_get_password_complexity_settings(self) -> None: - """Test case for get_password_complexity_settings - - Get the password complexity settings - """ - pass - - def test_get_password_expiry_settings(self) -> None: - """Test case for get_password_expiry_settings - - Get the password expiry settings - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_user_agent_header_values.py b/test/test_user_agent_header_values.py deleted file mode 100644 index 49e9c7ba..00000000 --- a/test/test_user_agent_header_values.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.user_agent_header_values import UserAgentHeaderValues - -class TestUserAgentHeaderValues(unittest.TestCase): - """UserAgentHeaderValues unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserAgentHeaderValues: - """Test UserAgentHeaderValues - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `UserAgentHeaderValues` - """ - model = UserAgentHeaderValues() - if include_optional: - return UserAgentHeaderValues( - values = [ - '' - ] - ) - else: - return UserAgentHeaderValues( - ) - """ - - def testUserAgentHeaderValues(self): - """Test UserAgentHeaderValues""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_user_service_add_idp_link_body.py b/test/test_user_service_add_idp_link_body.py deleted file mode 100644 index 92779f4b..00000000 --- a/test/test_user_service_add_idp_link_body.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.user_service_add_idp_link_body import UserServiceAddIDPLinkBody - -class TestUserServiceAddIDPLinkBody(unittest.TestCase): - """UserServiceAddIDPLinkBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserServiceAddIDPLinkBody: - """Test UserServiceAddIDPLinkBody - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `UserServiceAddIDPLinkBody` - """ - model = UserServiceAddIDPLinkBody() - if include_optional: - return UserServiceAddIDPLinkBody( - idp_link = zitadel_client.models.v2_idp_link.v2IDPLink( - idp_id = 'd654e6ba-70a3-48ef-a95d-37c8d8a7901a', - user_id = '6516849804890468048461403518', - user_name = 'user@external.com', ) - ) - else: - return UserServiceAddIDPLinkBody( - ) - """ - - def testUserServiceAddIDPLinkBody(self): - """Test UserServiceAddIDPLinkBody""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_user_service_api.py b/test/test_user_service_api.py deleted file mode 100644 index 9e8af75d..00000000 --- a/test/test_user_service_api.py +++ /dev/null @@ -1,345 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.api.user_service_api import UserServiceApi - - -class TestUserServiceApi(unittest.TestCase): - """UserServiceApi unit test stubs""" - - def setUp(self) -> None: - self.api = UserServiceApi() - - def tearDown(self) -> None: - pass - - def test_add_human_user(self) -> None: - """Test case for add_human_user - - Create a new human user - """ - pass - - def test_add_idp_link(self) -> None: - """Test case for add_idp_link - - Add link to an identity provider to an user - """ - pass - - def test_add_otp_email(self) -> None: - """Test case for add_otp_email - - Add OTP Email for a user - """ - pass - - def test_add_otpsms(self) -> None: - """Test case for add_otpsms - - Add OTP SMS for a user - """ - pass - - def test_create_invite_code(self) -> None: - """Test case for create_invite_code - - Create an invite code for a user - """ - pass - - def test_create_passkey_registration_link(self) -> None: - """Test case for create_passkey_registration_link - - Create a passkey registration link for a user - """ - pass - - def test_deactivate_user(self) -> None: - """Test case for deactivate_user - - Deactivate user - """ - pass - - def test_delete_user(self) -> None: - """Test case for delete_user - - Delete user - """ - pass - - def test_get_user_by_id(self) -> None: - """Test case for get_user_by_id - - User by ID - """ - pass - - def test_human_mfa_init_skipped(self) -> None: - """Test case for human_mfa_init_skipped - - MFA Init Skipped - """ - pass - - def test_list_authentication_factors(self) -> None: - """Test case for list_authentication_factors - - """ - pass - - def test_list_authentication_method_types(self) -> None: - """Test case for list_authentication_method_types - - List all possible authentication methods of a user - """ - pass - - def test_list_idp_links(self) -> None: - """Test case for list_idp_links - - List links to an identity provider of an user - """ - pass - - def test_list_passkeys(self) -> None: - """Test case for list_passkeys - - List passkeys of an user - """ - pass - - def test_list_users(self) -> None: - """Test case for list_users - - Search Users - """ - pass - - def test_lock_user(self) -> None: - """Test case for lock_user - - Lock user - """ - pass - - def test_password_reset(self) -> None: - """Test case for password_reset - - Request a code to reset a password - """ - pass - - def test_reactivate_user(self) -> None: - """Test case for reactivate_user - - Reactivate user - """ - pass - - def test_register_passkey(self) -> None: - """Test case for register_passkey - - Start the registration of passkey for a user - """ - pass - - def test_register_totp(self) -> None: - """Test case for register_totp - - Start the registration of a TOTP generator for a user - """ - pass - - def test_register_u2_f(self) -> None: - """Test case for register_u2_f - - Start the registration of a u2f token for a user - """ - pass - - def test_remove_idp_link(self) -> None: - """Test case for remove_idp_link - - Remove link of an identity provider to an user - """ - pass - - def test_remove_otp_email(self) -> None: - """Test case for remove_otp_email - - Remove One-Time Password (OTP) Email from a user - """ - pass - - def test_remove_otpsms(self) -> None: - """Test case for remove_otpsms - - Remove One-Time Password (OTP) SMS from a user - """ - pass - - def test_remove_passkey(self) -> None: - """Test case for remove_passkey - - Remove passkey from a user - """ - pass - - def test_remove_phone(self) -> None: - """Test case for remove_phone - - Delete the user phone - """ - pass - - def test_remove_totp(self) -> None: - """Test case for remove_totp - - Remove TOTP generator from a user - """ - pass - - def test_remove_u2_f(self) -> None: - """Test case for remove_u2_f - - Remove u2f token from a user - """ - pass - - def test_resend_email_code(self) -> None: - """Test case for resend_email_code - - Resend code to verify user email - """ - pass - - def test_resend_invite_code(self) -> None: - """Test case for resend_invite_code - - Resend an invite code for a user - """ - pass - - def test_resend_phone_code(self) -> None: - """Test case for resend_phone_code - - Resend code to verify user phone - """ - pass - - def test_retrieve_identity_provider_intent(self) -> None: - """Test case for retrieve_identity_provider_intent - - Retrieve the information returned by the identity provider - """ - pass - - def test_send_email_code(self) -> None: - """Test case for send_email_code - - Send code to verify user email - """ - pass - - def test_set_email(self) -> None: - """Test case for set_email - - Change the user email - """ - pass - - def test_set_password(self) -> None: - """Test case for set_password - - Change password - """ - pass - - def test_set_phone(self) -> None: - """Test case for set_phone - - Set the user phone - """ - pass - - def test_start_identity_provider_intent(self) -> None: - """Test case for start_identity_provider_intent - - Start flow with an identity provider - """ - pass - - def test_unlock_user(self) -> None: - """Test case for unlock_user - - Unlock user - """ - pass - - def test_update_human_user(self) -> None: - """Test case for update_human_user - - Update User - """ - pass - - def test_verify_email(self) -> None: - """Test case for verify_email - - Verify the email - """ - pass - - def test_verify_invite_code(self) -> None: - """Test case for verify_invite_code - - Verify an invite code for a user - """ - pass - - def test_verify_passkey_registration(self) -> None: - """Test case for verify_passkey_registration - - Verify a passkey for a user - """ - pass - - def test_verify_phone(self) -> None: - """Test case for verify_phone - - Verify the phone - """ - pass - - def test_verify_totp_registration(self) -> None: - """Test case for verify_totp_registration - - Verify a TOTP generator for a user - """ - pass - - def test_verify_u2_f_registration(self) -> None: - """Test case for verify_u2_f_registration - - Verify a u2f token for a user - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_user_service_create_invite_code_body.py b/test/test_user_service_create_invite_code_body.py deleted file mode 100644 index c4e34785..00000000 --- a/test/test_user_service_create_invite_code_body.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.user_service_create_invite_code_body import UserServiceCreateInviteCodeBody - -class TestUserServiceCreateInviteCodeBody(unittest.TestCase): - """UserServiceCreateInviteCodeBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserServiceCreateInviteCodeBody: - """Test UserServiceCreateInviteCodeBody - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `UserServiceCreateInviteCodeBody` - """ - model = UserServiceCreateInviteCodeBody() - if include_optional: - return UserServiceCreateInviteCodeBody( - send_code = zitadel_client.models.v2_send_invite_code.v2SendInviteCode( - url_template = 'https://example.com/user/invite?userID={{.UserID}}&code={{.Code}}&orgID={{.OrgID}}', - application_name = 'CustomerPortal', ), - return_code = None - ) - else: - return UserServiceCreateInviteCodeBody( - ) - """ - - def testUserServiceCreateInviteCodeBody(self): - """Test UserServiceCreateInviteCodeBody""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_user_service_create_passkey_registration_link_body.py b/test/test_user_service_create_passkey_registration_link_body.py deleted file mode 100644 index b3c47025..00000000 --- a/test/test_user_service_create_passkey_registration_link_body.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.user_service_create_passkey_registration_link_body import UserServiceCreatePasskeyRegistrationLinkBody - -class TestUserServiceCreatePasskeyRegistrationLinkBody(unittest.TestCase): - """UserServiceCreatePasskeyRegistrationLinkBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserServiceCreatePasskeyRegistrationLinkBody: - """Test UserServiceCreatePasskeyRegistrationLinkBody - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `UserServiceCreatePasskeyRegistrationLinkBody` - """ - model = UserServiceCreatePasskeyRegistrationLinkBody() - if include_optional: - return UserServiceCreatePasskeyRegistrationLinkBody( - send_link = zitadel_client.models.v2_send_passkey_registration_link.v2SendPasskeyRegistrationLink( - url_template = 'https://example.com/passkey/register?userID={{.UserID}}&orgID={{.OrgID}}&codeID={{.CodeID}}&code={{.Code}}', ), - return_code = None - ) - else: - return UserServiceCreatePasskeyRegistrationLinkBody( - ) - """ - - def testUserServiceCreatePasskeyRegistrationLinkBody(self): - """Test UserServiceCreatePasskeyRegistrationLinkBody""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_user_service_list_idp_links_body.py b/test/test_user_service_list_idp_links_body.py deleted file mode 100644 index 2a39e10a..00000000 --- a/test/test_user_service_list_idp_links_body.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.user_service_list_idp_links_body import UserServiceListIDPLinksBody - -class TestUserServiceListIDPLinksBody(unittest.TestCase): - """UserServiceListIDPLinksBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserServiceListIDPLinksBody: - """Test UserServiceListIDPLinksBody - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `UserServiceListIDPLinksBody` - """ - model = UserServiceListIDPLinksBody() - if include_optional: - return UserServiceListIDPLinksBody( - query = zitadel_client.models.general_list_query.General List Query( - offset = '0', - limit = 100, - asc = True, ) - ) - else: - return UserServiceListIDPLinksBody( - ) - """ - - def testUserServiceListIDPLinksBody(self): - """Test UserServiceListIDPLinksBody""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_user_service_password_reset_body.py b/test/test_user_service_password_reset_body.py deleted file mode 100644 index d0fd4773..00000000 --- a/test/test_user_service_password_reset_body.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.user_service_password_reset_body import UserServicePasswordResetBody - -class TestUserServicePasswordResetBody(unittest.TestCase): - """UserServicePasswordResetBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserServicePasswordResetBody: - """Test UserServicePasswordResetBody - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `UserServicePasswordResetBody` - """ - model = UserServicePasswordResetBody() - if include_optional: - return UserServicePasswordResetBody( - send_link = zitadel_client.models.v2_send_password_reset_link.v2SendPasswordResetLink( - notification_type = 'NOTIFICATION_TYPE_Unspecified', - url_template = 'https://example.com/password/changey?userID={{.UserID}}&code={{.Code}}&orgID={{.OrgID}}', ), - return_code = None - ) - else: - return UserServicePasswordResetBody( - ) - """ - - def testUserServicePasswordResetBody(self): - """Test UserServicePasswordResetBody""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_user_service_register_passkey_body.py b/test/test_user_service_register_passkey_body.py deleted file mode 100644 index 2f5981f1..00000000 --- a/test/test_user_service_register_passkey_body.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.user_service_register_passkey_body import UserServiceRegisterPasskeyBody - -class TestUserServiceRegisterPasskeyBody(unittest.TestCase): - """UserServiceRegisterPasskeyBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserServiceRegisterPasskeyBody: - """Test UserServiceRegisterPasskeyBody - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `UserServiceRegisterPasskeyBody` - """ - model = UserServiceRegisterPasskeyBody() - if include_optional: - return UserServiceRegisterPasskeyBody( - code = zitadel_client.models.v2_passkey_registration_code.v2PasskeyRegistrationCode( - id = 'e2a48d6a-362b-4db6-a1fb-34feab84dc62', - code = 'SomeSpecialCode', ), - authenticator = 'PASSKEY_AUTHENTICATOR_UNSPECIFIED', - domain = '' - ) - else: - return UserServiceRegisterPasskeyBody( - ) - """ - - def testUserServiceRegisterPasskeyBody(self): - """Test UserServiceRegisterPasskeyBody""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_user_service_register_u2_f_body.py b/test/test_user_service_register_u2_f_body.py deleted file mode 100644 index cf0c4522..00000000 --- a/test/test_user_service_register_u2_f_body.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.user_service_register_u2_f_body import UserServiceRegisterU2FBody - -class TestUserServiceRegisterU2FBody(unittest.TestCase): - """UserServiceRegisterU2FBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserServiceRegisterU2FBody: - """Test UserServiceRegisterU2FBody - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `UserServiceRegisterU2FBody` - """ - model = UserServiceRegisterU2FBody() - if include_optional: - return UserServiceRegisterU2FBody( - domain = '' - ) - else: - return UserServiceRegisterU2FBody( - ) - """ - - def testUserServiceRegisterU2FBody(self): - """Test UserServiceRegisterU2FBody""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_user_service_resend_email_code_body.py b/test/test_user_service_resend_email_code_body.py deleted file mode 100644 index b8237bf4..00000000 --- a/test/test_user_service_resend_email_code_body.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.user_service_resend_email_code_body import UserServiceResendEmailCodeBody - -class TestUserServiceResendEmailCodeBody(unittest.TestCase): - """UserServiceResendEmailCodeBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserServiceResendEmailCodeBody: - """Test UserServiceResendEmailCodeBody - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `UserServiceResendEmailCodeBody` - """ - model = UserServiceResendEmailCodeBody() - if include_optional: - return UserServiceResendEmailCodeBody( - send_code = zitadel_client.models.v2_send_email_verification_code.v2SendEmailVerificationCode( - url_template = 'https://example.com/email/verify?userID={{.UserID}}&code={{.Code}}&orgID={{.OrgID}}', ), - return_code = zitadel_client.models.v2_return_email_verification_code.v2ReturnEmailVerificationCode() - ) - else: - return UserServiceResendEmailCodeBody( - ) - """ - - def testUserServiceResendEmailCodeBody(self): - """Test UserServiceResendEmailCodeBody""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_user_service_resend_phone_code_body.py b/test/test_user_service_resend_phone_code_body.py deleted file mode 100644 index 183c1c3d..00000000 --- a/test/test_user_service_resend_phone_code_body.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.user_service_resend_phone_code_body import UserServiceResendPhoneCodeBody - -class TestUserServiceResendPhoneCodeBody(unittest.TestCase): - """UserServiceResendPhoneCodeBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserServiceResendPhoneCodeBody: - """Test UserServiceResendPhoneCodeBody - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `UserServiceResendPhoneCodeBody` - """ - model = UserServiceResendPhoneCodeBody() - if include_optional: - return UserServiceResendPhoneCodeBody( - send_code = zitadel_client.models.v2_send_phone_verification_code.v2SendPhoneVerificationCode(), - return_code = zitadel_client.models.v2_return_phone_verification_code.v2ReturnPhoneVerificationCode() - ) - else: - return UserServiceResendPhoneCodeBody( - ) - """ - - def testUserServiceResendPhoneCodeBody(self): - """Test UserServiceResendPhoneCodeBody""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_user_service_retrieve_identity_provider_intent_body.py b/test/test_user_service_retrieve_identity_provider_intent_body.py deleted file mode 100644 index 708b968e..00000000 --- a/test/test_user_service_retrieve_identity_provider_intent_body.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.user_service_retrieve_identity_provider_intent_body import UserServiceRetrieveIdentityProviderIntentBody - -class TestUserServiceRetrieveIdentityProviderIntentBody(unittest.TestCase): - """UserServiceRetrieveIdentityProviderIntentBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserServiceRetrieveIdentityProviderIntentBody: - """Test UserServiceRetrieveIdentityProviderIntentBody - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `UserServiceRetrieveIdentityProviderIntentBody` - """ - model = UserServiceRetrieveIdentityProviderIntentBody() - if include_optional: - return UserServiceRetrieveIdentityProviderIntentBody( - idp_intent_token = 'SJKL3ioIDpo342ioqw98fjp3sdf32wahb=' - ) - else: - return UserServiceRetrieveIdentityProviderIntentBody( - ) - """ - - def testUserServiceRetrieveIdentityProviderIntentBody(self): - """Test UserServiceRetrieveIdentityProviderIntentBody""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_user_service_send_email_code_body.py b/test/test_user_service_send_email_code_body.py deleted file mode 100644 index ac9952af..00000000 --- a/test/test_user_service_send_email_code_body.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.user_service_send_email_code_body import UserServiceSendEmailCodeBody - -class TestUserServiceSendEmailCodeBody(unittest.TestCase): - """UserServiceSendEmailCodeBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserServiceSendEmailCodeBody: - """Test UserServiceSendEmailCodeBody - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `UserServiceSendEmailCodeBody` - """ - model = UserServiceSendEmailCodeBody() - if include_optional: - return UserServiceSendEmailCodeBody( - send_code = zitadel_client.models.v2_send_email_verification_code.v2SendEmailVerificationCode( - url_template = 'https://example.com/email/verify?userID={{.UserID}}&code={{.Code}}&orgID={{.OrgID}}', ), - return_code = zitadel_client.models.v2_return_email_verification_code.v2ReturnEmailVerificationCode() - ) - else: - return UserServiceSendEmailCodeBody( - ) - """ - - def testUserServiceSendEmailCodeBody(self): - """Test UserServiceSendEmailCodeBody""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_user_service_set_email_body.py b/test/test_user_service_set_email_body.py deleted file mode 100644 index 9ada29e1..00000000 --- a/test/test_user_service_set_email_body.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.user_service_set_email_body import UserServiceSetEmailBody - -class TestUserServiceSetEmailBody(unittest.TestCase): - """UserServiceSetEmailBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserServiceSetEmailBody: - """Test UserServiceSetEmailBody - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `UserServiceSetEmailBody` - """ - model = UserServiceSetEmailBody() - if include_optional: - return UserServiceSetEmailBody( - email = 'mini@mouse.com', - send_code = zitadel_client.models.v2_send_email_verification_code.v2SendEmailVerificationCode( - url_template = 'https://example.com/email/verify?userID={{.UserID}}&code={{.Code}}&orgID={{.OrgID}}', ), - return_code = zitadel_client.models.v2_return_email_verification_code.v2ReturnEmailVerificationCode(), - is_verified = True - ) - else: - return UserServiceSetEmailBody( - email = 'mini@mouse.com', - ) - """ - - def testUserServiceSetEmailBody(self): - """Test UserServiceSetEmailBody""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_user_service_set_phone_body.py b/test/test_user_service_set_phone_body.py deleted file mode 100644 index 63635da1..00000000 --- a/test/test_user_service_set_phone_body.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.user_service_set_phone_body import UserServiceSetPhoneBody - -class TestUserServiceSetPhoneBody(unittest.TestCase): - """UserServiceSetPhoneBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserServiceSetPhoneBody: - """Test UserServiceSetPhoneBody - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `UserServiceSetPhoneBody` - """ - model = UserServiceSetPhoneBody() - if include_optional: - return UserServiceSetPhoneBody( - phone = '+41791234567', - send_code = zitadel_client.models.v2_send_phone_verification_code.v2SendPhoneVerificationCode(), - return_code = zitadel_client.models.v2_return_phone_verification_code.v2ReturnPhoneVerificationCode(), - is_verified = True - ) - else: - return UserServiceSetPhoneBody( - phone = '+41791234567', - ) - """ - - def testUserServiceSetPhoneBody(self): - """Test UserServiceSetPhoneBody""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_user_service_update_human_user_body.py b/test/test_user_service_update_human_user_body.py deleted file mode 100644 index ecfa6f45..00000000 --- a/test/test_user_service_update_human_user_body.py +++ /dev/null @@ -1,78 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.user_service_update_human_user_body import UserServiceUpdateHumanUserBody - -class TestUserServiceUpdateHumanUserBody(unittest.TestCase): - """UserServiceUpdateHumanUserBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserServiceUpdateHumanUserBody: - """Test UserServiceUpdateHumanUserBody - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `UserServiceUpdateHumanUserBody` - """ - model = UserServiceUpdateHumanUserBody() - if include_optional: - return UserServiceUpdateHumanUserBody( - username = 'minnie-mouse', - profile = zitadel_client.models.v2_set_human_profile_1.v2SetHumanProfile_1( - given_name = 'Minnie', - family_name = 'Mouse', - nick_name = 'Mini', - display_name = 'Minnie Mouse', - preferred_language = 'en', - gender = 'GENDER_UNSPECIFIED', ), - email = zitadel_client.models.v2_set_human_email_1.v2SetHumanEmail_1( - email = 'mini@mouse.com', - send_code = zitadel_client.models.v2_send_email_verification_code.v2SendEmailVerificationCode( - url_template = 'https://example.com/email/verify?userID={{.UserID}}&code={{.Code}}&orgID={{.OrgID}}', ), - return_code = zitadel_client.models.v2_return_email_verification_code.v2ReturnEmailVerificationCode(), - is_verified = True, ), - phone = zitadel_client.models.v2_set_human_phone_1.v2SetHumanPhone_1( - phone = '+41791234567', - send_code = zitadel_client.models.v2_send_phone_verification_code.v2SendPhoneVerificationCode(), - return_code = zitadel_client.models.v2_return_phone_verification_code.v2ReturnPhoneVerificationCode(), - is_verified = True, ), - password = zitadel_client.models.userv2_set_password.userv2SetPassword( - password = zitadel_client.models.v2_password.v2Password( - password = 'Secr3tP4ssw0rd!', - change_required = True, ), - hashed_password = zitadel_client.models.v2_hashed_password.v2HashedPassword( - hash = '$2a$12$lJ08fqVr8bFJilRVnDT9QeULI7YW.nT3iwUv6dyg0aCrfm3UY8XR2', - change_required = True, ), - current_password = 'Secr3tP4ssw0rd!', - verification_code = 'SKJd342k', ) - ) - else: - return UserServiceUpdateHumanUserBody( - ) - """ - - def testUserServiceUpdateHumanUserBody(self): - """Test UserServiceUpdateHumanUserBody""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_user_service_verify_email_body.py b/test/test_user_service_verify_email_body.py deleted file mode 100644 index 92484fbc..00000000 --- a/test/test_user_service_verify_email_body.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.user_service_verify_email_body import UserServiceVerifyEmailBody - -class TestUserServiceVerifyEmailBody(unittest.TestCase): - """UserServiceVerifyEmailBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserServiceVerifyEmailBody: - """Test UserServiceVerifyEmailBody - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `UserServiceVerifyEmailBody` - """ - model = UserServiceVerifyEmailBody() - if include_optional: - return UserServiceVerifyEmailBody( - verification_code = 'SKJd342k' - ) - else: - return UserServiceVerifyEmailBody( - verification_code = 'SKJd342k', - ) - """ - - def testUserServiceVerifyEmailBody(self): - """Test UserServiceVerifyEmailBody""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_user_service_verify_invite_code_body.py b/test/test_user_service_verify_invite_code_body.py deleted file mode 100644 index 1cd6645c..00000000 --- a/test/test_user_service_verify_invite_code_body.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.user_service_verify_invite_code_body import UserServiceVerifyInviteCodeBody - -class TestUserServiceVerifyInviteCodeBody(unittest.TestCase): - """UserServiceVerifyInviteCodeBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserServiceVerifyInviteCodeBody: - """Test UserServiceVerifyInviteCodeBody - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `UserServiceVerifyInviteCodeBody` - """ - model = UserServiceVerifyInviteCodeBody() - if include_optional: - return UserServiceVerifyInviteCodeBody( - verification_code = 'SKJd342k' - ) - else: - return UserServiceVerifyInviteCodeBody( - verification_code = 'SKJd342k', - ) - """ - - def testUserServiceVerifyInviteCodeBody(self): - """Test UserServiceVerifyInviteCodeBody""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_user_service_verify_passkey_registration_body.py b/test/test_user_service_verify_passkey_registration_body.py deleted file mode 100644 index 51d4a0d7..00000000 --- a/test/test_user_service_verify_passkey_registration_body.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.user_service_verify_passkey_registration_body import UserServiceVerifyPasskeyRegistrationBody - -class TestUserServiceVerifyPasskeyRegistrationBody(unittest.TestCase): - """UserServiceVerifyPasskeyRegistrationBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserServiceVerifyPasskeyRegistrationBody: - """Test UserServiceVerifyPasskeyRegistrationBody - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `UserServiceVerifyPasskeyRegistrationBody` - """ - model = UserServiceVerifyPasskeyRegistrationBody() - if include_optional: - return UserServiceVerifyPasskeyRegistrationBody( - public_key_credential = {"type":"public-key","id":"pawVarF4xPxLFmfCnRkwXWeTrKGzabcAi92LEI1WC00","rawId":"pawVarF4xPxLFmfCnRkwXWeTrKGzabcAi92LEI1WC00","response":{"attestationObject":"o2NmbXRmcGFja2VkZ2F0dFN0bXSiY2FsZyZjc2lnWEcwRQIgRKS3VpeE9tfExXRzkoUKnG4rQWPvtSSt4YtDGgTx32oCIQDPey-2YJ4uIg-QCM4jj6aE2U3tgMFM_RP7Efx6xRu3JGhhdXRoRGF0YVikSZYN5YgOjGh0NBcPZHZgW4_krrmihjLHmVzzuoMdl2NFAAAAADju76085Yhmlt1CEOHkwLQAIKWsFWqxeMT8SxZnwp0ZMF1nk6yhs2m3AIvdixCNVgtNpQECAyYgASFYIMGUDSP2FAQn2MIfPMy7cyB_Y30VqixVgGULTBtFjfRiIlggjUGfQo3_-CrMmH3S-ZQkFKWKnNBQEAMkFtG-9A4zqW0","clientDataJSON":"eyJ0eXBlIjoid2ViYXV0aG4uY3JlYXRlIiwiY2hhbGxlbmdlIjoiQlhXdHh0WGxJeFZZa0pHT1dVaUVmM25zby02aXZKdWw2YmNmWHdMVlFIayIsIm9yaWdpbiI6Imh0dHBzOi8vbG9jYWxob3N0OjgwODAifQ"}}, - passkey_name = 'fido key' - ) - else: - return UserServiceVerifyPasskeyRegistrationBody( - public_key_credential = {"type":"public-key","id":"pawVarF4xPxLFmfCnRkwXWeTrKGzabcAi92LEI1WC00","rawId":"pawVarF4xPxLFmfCnRkwXWeTrKGzabcAi92LEI1WC00","response":{"attestationObject":"o2NmbXRmcGFja2VkZ2F0dFN0bXSiY2FsZyZjc2lnWEcwRQIgRKS3VpeE9tfExXRzkoUKnG4rQWPvtSSt4YtDGgTx32oCIQDPey-2YJ4uIg-QCM4jj6aE2U3tgMFM_RP7Efx6xRu3JGhhdXRoRGF0YVikSZYN5YgOjGh0NBcPZHZgW4_krrmihjLHmVzzuoMdl2NFAAAAADju76085Yhmlt1CEOHkwLQAIKWsFWqxeMT8SxZnwp0ZMF1nk6yhs2m3AIvdixCNVgtNpQECAyYgASFYIMGUDSP2FAQn2MIfPMy7cyB_Y30VqixVgGULTBtFjfRiIlggjUGfQo3_-CrMmH3S-ZQkFKWKnNBQEAMkFtG-9A4zqW0","clientDataJSON":"eyJ0eXBlIjoid2ViYXV0aG4uY3JlYXRlIiwiY2hhbGxlbmdlIjoiQlhXdHh0WGxJeFZZa0pHT1dVaUVmM25zby02aXZKdWw2YmNmWHdMVlFIayIsIm9yaWdpbiI6Imh0dHBzOi8vbG9jYWxob3N0OjgwODAifQ"}}, - passkey_name = 'fido key', - ) - """ - - def testUserServiceVerifyPasskeyRegistrationBody(self): - """Test UserServiceVerifyPasskeyRegistrationBody""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_user_service_verify_phone_body.py b/test/test_user_service_verify_phone_body.py deleted file mode 100644 index fcee82c8..00000000 --- a/test/test_user_service_verify_phone_body.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.user_service_verify_phone_body import UserServiceVerifyPhoneBody - -class TestUserServiceVerifyPhoneBody(unittest.TestCase): - """UserServiceVerifyPhoneBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserServiceVerifyPhoneBody: - """Test UserServiceVerifyPhoneBody - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `UserServiceVerifyPhoneBody` - """ - model = UserServiceVerifyPhoneBody() - if include_optional: - return UserServiceVerifyPhoneBody( - verification_code = 'SKJd342k' - ) - else: - return UserServiceVerifyPhoneBody( - verification_code = 'SKJd342k', - ) - """ - - def testUserServiceVerifyPhoneBody(self): - """Test UserServiceVerifyPhoneBody""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_user_service_verify_totp_registration_body.py b/test/test_user_service_verify_totp_registration_body.py deleted file mode 100644 index f7cb04d7..00000000 --- a/test/test_user_service_verify_totp_registration_body.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.user_service_verify_totp_registration_body import UserServiceVerifyTOTPRegistrationBody - -class TestUserServiceVerifyTOTPRegistrationBody(unittest.TestCase): - """UserServiceVerifyTOTPRegistrationBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserServiceVerifyTOTPRegistrationBody: - """Test UserServiceVerifyTOTPRegistrationBody - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `UserServiceVerifyTOTPRegistrationBody` - """ - model = UserServiceVerifyTOTPRegistrationBody() - if include_optional: - return UserServiceVerifyTOTPRegistrationBody( - code = '123456' - ) - else: - return UserServiceVerifyTOTPRegistrationBody( - code = '123456', - ) - """ - - def testUserServiceVerifyTOTPRegistrationBody(self): - """Test UserServiceVerifyTOTPRegistrationBody""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_user_service_verify_u2_f_registration_body.py b/test/test_user_service_verify_u2_f_registration_body.py deleted file mode 100644 index 5abc34f2..00000000 --- a/test/test_user_service_verify_u2_f_registration_body.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.user_service_verify_u2_f_registration_body import UserServiceVerifyU2FRegistrationBody - -class TestUserServiceVerifyU2FRegistrationBody(unittest.TestCase): - """UserServiceVerifyU2FRegistrationBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserServiceVerifyU2FRegistrationBody: - """Test UserServiceVerifyU2FRegistrationBody - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `UserServiceVerifyU2FRegistrationBody` - """ - model = UserServiceVerifyU2FRegistrationBody() - if include_optional: - return UserServiceVerifyU2FRegistrationBody( - public_key_credential = {"type":"public-key","id":"pawVarF4xPxLFmfCnRkwXWeTrKGzabcAi92LEI1WC00","rawId":"pawVarF4xPxLFmfCnRkwXWeTrKGzabcAi92LEI1WC00","response":{"attestationObject":"o2NmbXRmcGFja2VkZ2F0dFN0bXSiY2FsZyZjc2lnWEcwRQIgRKS3VpeE9tfExXRzkoUKnG4rQWPvtSSt4YtDGgTx32oCIQDPey-2YJ4uIg-QCM4jj6aE2U3tgMFM_RP7Efx6xRu3JGhhdXRoRGF0YVikSZYN5YgOjGh0NBcPZHZgW4_krrmihjLHmVzzuoMdl2NFAAAAADju76085Yhmlt1CEOHkwLQAIKWsFWqxeMT8SxZnwp0ZMF1nk6yhs2m3AIvdixCNVgtNpQECAyYgASFYIMGUDSP2FAQn2MIfPMy7cyB_Y30VqixVgGULTBtFjfRiIlggjUGfQo3_-CrMmH3S-ZQkFKWKnNBQEAMkFtG-9A4zqW0","clientDataJSON":"eyJ0eXBlIjoid2ViYXV0aG4uY3JlYXRlIiwiY2hhbGxlbmdlIjoiQlhXdHh0WGxJeFZZa0pHT1dVaUVmM25zby02aXZKdWw2YmNmWHdMVlFIayIsIm9yaWdpbiI6Imh0dHBzOi8vbG9jYWxob3N0OjgwODAifQ"}}, - token_name = 'fido key' - ) - else: - return UserServiceVerifyU2FRegistrationBody( - public_key_credential = {"type":"public-key","id":"pawVarF4xPxLFmfCnRkwXWeTrKGzabcAi92LEI1WC00","rawId":"pawVarF4xPxLFmfCnRkwXWeTrKGzabcAi92LEI1WC00","response":{"attestationObject":"o2NmbXRmcGFja2VkZ2F0dFN0bXSiY2FsZyZjc2lnWEcwRQIgRKS3VpeE9tfExXRzkoUKnG4rQWPvtSSt4YtDGgTx32oCIQDPey-2YJ4uIg-QCM4jj6aE2U3tgMFM_RP7Efx6xRu3JGhhdXRoRGF0YVikSZYN5YgOjGh0NBcPZHZgW4_krrmihjLHmVzzuoMdl2NFAAAAADju76085Yhmlt1CEOHkwLQAIKWsFWqxeMT8SxZnwp0ZMF1nk6yhs2m3AIvdixCNVgtNpQECAyYgASFYIMGUDSP2FAQn2MIfPMy7cyB_Y30VqixVgGULTBtFjfRiIlggjUGfQo3_-CrMmH3S-ZQkFKWKnNBQEAMkFtG-9A4zqW0","clientDataJSON":"eyJ0eXBlIjoid2ViYXV0aG4uY3JlYXRlIiwiY2hhbGxlbmdlIjoiQlhXdHh0WGxJeFZZa0pHT1dVaUVmM25zby02aXZKdWw2YmNmWHdMVlFIayIsIm9yaWdpbiI6Imh0dHBzOi8vbG9jYWxob3N0OjgwODAifQ"}}, - token_name = 'fido key', - ) - """ - - def testUserServiceVerifyU2FRegistrationBody(self): - """Test UserServiceVerifyU2FRegistrationBody""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_userv2_set_password.py b/test/test_userv2_set_password.py deleted file mode 100644 index dabab085..00000000 --- a/test/test_userv2_set_password.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.userv2_set_password import Userv2SetPassword - -class TestUserv2SetPassword(unittest.TestCase): - """Userv2SetPassword unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Userv2SetPassword: - """Test Userv2SetPassword - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Userv2SetPassword` - """ - model = Userv2SetPassword() - if include_optional: - return Userv2SetPassword( - password = zitadel_client.models.v2_password.v2Password( - password = 'Secr3tP4ssw0rd!', - change_required = True, ), - hashed_password = zitadel_client.models.v2_hashed_password.v2HashedPassword( - hash = '$2a$12$lJ08fqVr8bFJilRVnDT9QeULI7YW.nT3iwUv6dyg0aCrfm3UY8XR2', - change_required = True, ), - current_password = 'Secr3tP4ssw0rd!', - verification_code = 'SKJd342k' - ) - else: - return Userv2SetPassword( - current_password = 'Secr3tP4ssw0rd!', - verification_code = 'SKJd342k', - ) - """ - - def testUserv2SetPassword(self): - """Test Userv2SetPassword""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_userv2_type.py b/test/test_userv2_type.py deleted file mode 100644 index 9af433b3..00000000 --- a/test/test_userv2_type.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.userv2_type import Userv2Type - -class TestUserv2Type(unittest.TestCase): - """Userv2Type unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testUserv2Type(self): - """Test Userv2Type""" - # inst = Userv2Type() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_access_token_type.py b/test/test_v2_access_token_type.py deleted file mode 100644 index a5352fce..00000000 --- a/test/test_v2_access_token_type.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_access_token_type import V2AccessTokenType - -class TestV2AccessTokenType(unittest.TestCase): - """V2AccessTokenType unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2AccessTokenType(self): - """Test V2AccessTokenType""" - # inst = V2AccessTokenType() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_add_human_user_request.py b/test/test_v2_add_human_user_request.py deleted file mode 100644 index fde634be..00000000 --- a/test/test_v2_add_human_user_request.py +++ /dev/null @@ -1,103 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_add_human_user_request import V2AddHumanUserRequest - -class TestV2AddHumanUserRequest(unittest.TestCase): - """V2AddHumanUserRequest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2AddHumanUserRequest: - """Test V2AddHumanUserRequest - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2AddHumanUserRequest` - """ - model = V2AddHumanUserRequest() - if include_optional: - return V2AddHumanUserRequest( - user_id = 'd654e6ba-70a3-48ef-a95d-37c8d8a7901a', - username = 'minnie-mouse', - organization = zitadel_client.models.zitadelobjectv2_organization.zitadelobjectv2Organization( - org_id = '', - org_domain = '', ), - profile = zitadel_client.models.v2_set_human_profile.v2SetHumanProfile( - given_name = 'Minnie', - family_name = 'Mouse', - nick_name = 'Mini', - display_name = 'Minnie Mouse', - preferred_language = 'en', - gender = 'GENDER_UNSPECIFIED', ), - email = zitadel_client.models.v2_set_human_email.v2SetHumanEmail( - email = 'mini@mouse.com', - send_code = zitadel_client.models.v2_send_email_verification_code.v2SendEmailVerificationCode( - url_template = 'https://example.com/email/verify?userID={{.UserID}}&code={{.Code}}&orgID={{.OrgID}}', ), - return_code = zitadel_client.models.v2_return_email_verification_code.v2ReturnEmailVerificationCode(), - is_verified = True, ), - phone = zitadel_client.models.v2_set_human_phone.v2SetHumanPhone( - send_code = zitadel_client.models.v2_send_phone_verification_code.v2SendPhoneVerificationCode(), - return_code = zitadel_client.models.v2_return_phone_verification_code.v2ReturnPhoneVerificationCode(), - is_verified = True, ), - metadata = [ - zitadel_client.models.v2_set_metadata_entry.v2SetMetadataEntry( - key = 'my-key', - value = '[B@4a67318f', ) - ], - password = zitadel_client.models.v2_password.v2Password( - password = 'Secr3tP4ssw0rd!', - change_required = True, ), - hashed_password = zitadel_client.models.v2_hashed_password.v2HashedPassword( - hash = '$2a$12$lJ08fqVr8bFJilRVnDT9QeULI7YW.nT3iwUv6dyg0aCrfm3UY8XR2', - change_required = True, ), - idp_links = [ - zitadel_client.models.v2_idp_link.v2IDPLink( - idp_id = 'd654e6ba-70a3-48ef-a95d-37c8d8a7901a', - user_id = '6516849804890468048461403518', - user_name = 'user@external.com', ) - ], - totp_secret = 'TJOPWSDYILLHXFV4MLKNNJOWFG7VSDCK' - ) - else: - return V2AddHumanUserRequest( - profile = zitadel_client.models.v2_set_human_profile.v2SetHumanProfile( - given_name = 'Minnie', - family_name = 'Mouse', - nick_name = 'Mini', - display_name = 'Minnie Mouse', - preferred_language = 'en', - gender = 'GENDER_UNSPECIFIED', ), - email = zitadel_client.models.v2_set_human_email.v2SetHumanEmail( - email = 'mini@mouse.com', - send_code = zitadel_client.models.v2_send_email_verification_code.v2SendEmailVerificationCode( - url_template = 'https://example.com/email/verify?userID={{.UserID}}&code={{.Code}}&orgID={{.OrgID}}', ), - return_code = zitadel_client.models.v2_return_email_verification_code.v2ReturnEmailVerificationCode(), - is_verified = True, ), - ) - """ - - def testV2AddHumanUserRequest(self): - """Test V2AddHumanUserRequest""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_add_human_user_request1.py b/test/test_v2_add_human_user_request1.py deleted file mode 100644 index e7e30619..00000000 --- a/test/test_v2_add_human_user_request1.py +++ /dev/null @@ -1,104 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_add_human_user_request1 import V2AddHumanUserRequest1 - -class TestV2AddHumanUserRequest1(unittest.TestCase): - """V2AddHumanUserRequest1 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2AddHumanUserRequest1: - """Test V2AddHumanUserRequest1 - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2AddHumanUserRequest1` - """ - model = V2AddHumanUserRequest1() - if include_optional: - return V2AddHumanUserRequest1( - user_id = 'd654e6ba-70a3-48ef-a95d-37c8d8a7901a', - username = 'minnie-mouse', - organization = zitadel_client.models.v2_organization.v2Organization( - org_id = '', - org_domain = '', ), - profile = zitadel_client.models.v2_set_human_profile_1.v2SetHumanProfile_1( - given_name = 'Minnie', - family_name = 'Mouse', - nick_name = 'Mini', - display_name = 'Minnie Mouse', - preferred_language = 'en', - gender = 'GENDER_UNSPECIFIED', ), - email = zitadel_client.models.v2_set_human_email_1.v2SetHumanEmail_1( - email = 'mini@mouse.com', - send_code = zitadel_client.models.v2_send_email_verification_code.v2SendEmailVerificationCode( - url_template = 'https://example.com/email/verify?userID={{.UserID}}&code={{.Code}}&orgID={{.OrgID}}', ), - return_code = zitadel_client.models.v2_return_email_verification_code.v2ReturnEmailVerificationCode(), - is_verified = True, ), - phone = zitadel_client.models.v2_set_human_phone_1.v2SetHumanPhone_1( - phone = '+41791234567', - send_code = zitadel_client.models.v2_send_phone_verification_code.v2SendPhoneVerificationCode(), - return_code = zitadel_client.models.v2_return_phone_verification_code.v2ReturnPhoneVerificationCode(), - is_verified = True, ), - metadata = [ - zitadel_client.models.v2_set_metadata_entry_1.v2SetMetadataEntry_1( - key = 'my-key', - value = '[B@34448e6c', ) - ], - password = zitadel_client.models.v2_password.v2Password( - password = 'Secr3tP4ssw0rd!', - change_required = True, ), - hashed_password = zitadel_client.models.v2_hashed_password.v2HashedPassword( - hash = '$2a$12$lJ08fqVr8bFJilRVnDT9QeULI7YW.nT3iwUv6dyg0aCrfm3UY8XR2', - change_required = True, ), - idp_links = [ - zitadel_client.models.v2_idp_link.v2IDPLink( - idp_id = 'd654e6ba-70a3-48ef-a95d-37c8d8a7901a', - user_id = '6516849804890468048461403518', - user_name = 'user@external.com', ) - ], - totp_secret = 'TJOPWSDYILLHXFV4MLKNNJOWFG7VSDCK' - ) - else: - return V2AddHumanUserRequest1( - profile = zitadel_client.models.v2_set_human_profile_1.v2SetHumanProfile_1( - given_name = 'Minnie', - family_name = 'Mouse', - nick_name = 'Mini', - display_name = 'Minnie Mouse', - preferred_language = 'en', - gender = 'GENDER_UNSPECIFIED', ), - email = zitadel_client.models.v2_set_human_email_1.v2SetHumanEmail_1( - email = 'mini@mouse.com', - send_code = zitadel_client.models.v2_send_email_verification_code.v2SendEmailVerificationCode( - url_template = 'https://example.com/email/verify?userID={{.UserID}}&code={{.Code}}&orgID={{.OrgID}}', ), - return_code = zitadel_client.models.v2_return_email_verification_code.v2ReturnEmailVerificationCode(), - is_verified = True, ), - ) - """ - - def testV2AddHumanUserRequest1(self): - """Test V2AddHumanUserRequest1""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_add_human_user_response.py b/test/test_v2_add_human_user_response.py deleted file mode 100644 index 4be2da13..00000000 --- a/test/test_v2_add_human_user_response.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_add_human_user_response import V2AddHumanUserResponse - -class TestV2AddHumanUserResponse(unittest.TestCase): - """V2AddHumanUserResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2AddHumanUserResponse: - """Test V2AddHumanUserResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2AddHumanUserResponse` - """ - model = V2AddHumanUserResponse() - if include_optional: - return V2AddHumanUserResponse( - user_id = '', - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - email_code = '', - phone_code = '' - ) - else: - return V2AddHumanUserResponse( - ) - """ - - def testV2AddHumanUserResponse(self): - """Test V2AddHumanUserResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_add_idp_link_response.py b/test/test_v2_add_idp_link_response.py deleted file mode 100644 index 841bc98f..00000000 --- a/test/test_v2_add_idp_link_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_add_idp_link_response import V2AddIDPLinkResponse - -class TestV2AddIDPLinkResponse(unittest.TestCase): - """V2AddIDPLinkResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2AddIDPLinkResponse: - """Test V2AddIDPLinkResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2AddIDPLinkResponse` - """ - model = V2AddIDPLinkResponse() - if include_optional: - return V2AddIDPLinkResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2AddIDPLinkResponse( - ) - """ - - def testV2AddIDPLinkResponse(self): - """Test V2AddIDPLinkResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_add_organization_request.py b/test/test_v2_add_organization_request.py deleted file mode 100644 index 8e92a673..00000000 --- a/test/test_v2_add_organization_request.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_add_organization_request import V2AddOrganizationRequest - -class TestV2AddOrganizationRequest(unittest.TestCase): - """V2AddOrganizationRequest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2AddOrganizationRequest: - """Test V2AddOrganizationRequest - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2AddOrganizationRequest` - """ - model = V2AddOrganizationRequest() - if include_optional: - return V2AddOrganizationRequest( - name = 'ZITADEL', - admins = [ - zitadel_client.models.add_organization_request_admin.AddOrganizationRequestAdmin( - user_id = '', - human = zitadel_client.models.v2_add_human_user_request.v2AddHumanUserRequest( - user_id = 'd654e6ba-70a3-48ef-a95d-37c8d8a7901a', - username = 'minnie-mouse', - organization = zitadel_client.models.zitadelobjectv2_organization.zitadelobjectv2Organization( - org_id = '', - org_domain = '', ), - profile = zitadel_client.models.v2_set_human_profile.v2SetHumanProfile( - given_name = 'Minnie', - family_name = 'Mouse', - nick_name = 'Mini', - display_name = 'Minnie Mouse', - preferred_language = 'en', - gender = 'GENDER_UNSPECIFIED', ), - email = zitadel_client.models.v2_set_human_email.v2SetHumanEmail( - email = 'mini@mouse.com', - send_code = zitadel_client.models.v2_send_email_verification_code.v2SendEmailVerificationCode( - url_template = 'https://example.com/email/verify?userID={{.UserID}}&code={{.Code}}&orgID={{.OrgID}}', ), - return_code = zitadel_client.models.v2_return_email_verification_code.v2ReturnEmailVerificationCode(), - is_verified = True, ), - phone = zitadel_client.models.v2_set_human_phone.v2SetHumanPhone( - is_verified = True, ), - metadata = [ - zitadel_client.models.v2_set_metadata_entry.v2SetMetadataEntry( - key = 'my-key', - value = '[B@4a67318f', ) - ], - password = zitadel_client.models.v2_password.v2Password( - password = 'Secr3tP4ssw0rd!', - change_required = True, ), - hashed_password = zitadel_client.models.v2_hashed_password.v2HashedPassword( - hash = '$2a$12$lJ08fqVr8bFJilRVnDT9QeULI7YW.nT3iwUv6dyg0aCrfm3UY8XR2', - change_required = True, ), - idp_links = [ - zitadel_client.models.v2_idp_link.v2IDPLink( - idp_id = 'd654e6ba-70a3-48ef-a95d-37c8d8a7901a', - user_id = '6516849804890468048461403518', - user_name = 'user@external.com', ) - ], - totp_secret = 'TJOPWSDYILLHXFV4MLKNNJOWFG7VSDCK', ), - roles = [ - '' - ], ) - ] - ) - else: - return V2AddOrganizationRequest( - name = 'ZITADEL', - ) - """ - - def testV2AddOrganizationRequest(self): - """Test V2AddOrganizationRequest""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_add_organization_response.py b/test/test_v2_add_organization_response.py deleted file mode 100644 index cf070b0c..00000000 --- a/test/test_v2_add_organization_response.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_add_organization_response import V2AddOrganizationResponse - -class TestV2AddOrganizationResponse(unittest.TestCase): - """V2AddOrganizationResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2AddOrganizationResponse: - """Test V2AddOrganizationResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2AddOrganizationResponse` - """ - model = V2AddOrganizationResponse() - if include_optional: - return V2AddOrganizationResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - organization_id = '', - created_admins = [ - zitadel_client.models.add_organization_response_created_admin.AddOrganizationResponseCreatedAdmin( - user_id = '', - email_code = '', - phone_code = '', ) - ] - ) - else: - return V2AddOrganizationResponse( - ) - """ - - def testV2AddOrganizationResponse(self): - """Test V2AddOrganizationResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_add_otp_email_response.py b/test/test_v2_add_otp_email_response.py deleted file mode 100644 index 9fe27253..00000000 --- a/test/test_v2_add_otp_email_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_add_otp_email_response import V2AddOTPEmailResponse - -class TestV2AddOTPEmailResponse(unittest.TestCase): - """V2AddOTPEmailResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2AddOTPEmailResponse: - """Test V2AddOTPEmailResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2AddOTPEmailResponse` - """ - model = V2AddOTPEmailResponse() - if include_optional: - return V2AddOTPEmailResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2AddOTPEmailResponse( - ) - """ - - def testV2AddOTPEmailResponse(self): - """Test V2AddOTPEmailResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_add_otpsms_response.py b/test/test_v2_add_otpsms_response.py deleted file mode 100644 index 7aa89ca9..00000000 --- a/test/test_v2_add_otpsms_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_add_otpsms_response import V2AddOTPSMSResponse - -class TestV2AddOTPSMSResponse(unittest.TestCase): - """V2AddOTPSMSResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2AddOTPSMSResponse: - """Test V2AddOTPSMSResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2AddOTPSMSResponse` - """ - model = V2AddOTPSMSResponse() - if include_optional: - return V2AddOTPSMSResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2AddOTPSMSResponse( - ) - """ - - def testV2AddOTPSMSResponse(self): - """Test V2AddOTPSMSResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_and_query.py b/test/test_v2_and_query.py deleted file mode 100644 index 3e350d1f..00000000 --- a/test/test_v2_and_query.py +++ /dev/null @@ -1,90 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_and_query import V2AndQuery - -class TestV2AndQuery(unittest.TestCase): - """V2AndQuery unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2AndQuery: - """Test V2AndQuery - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2AndQuery` - """ - model = V2AndQuery() - if include_optional: - return V2AndQuery( - queries = [ - zitadel_client.models.v2_search_query_1.v2SearchQuery_1( - user_name_query = zitadel_client.models.v2_user_name_query.v2UserNameQuery( - user_name = 'gigi-giraffe', - method = 'TEXT_QUERY_METHOD_EQUALS', ), - first_name_query = zitadel_client.models.v2_first_name_query.v2FirstNameQuery( - first_name = 'Gigi', ), - last_name_query = zitadel_client.models.v2_last_name_query.v2LastNameQuery( - last_name = 'Giraffe', ), - nick_name_query = zitadel_client.models.v2_nick_name_query.v2NickNameQuery( - nick_name = 'Gigi', ), - display_name_query = zitadel_client.models.v2_display_name_query.v2DisplayNameQuery( - display_name = 'Gigi Giraffe', ), - email_query = zitadel_client.models.v2_email_query.v2EmailQuery( - email_address = 'gigi@zitadel.com', ), - state_query = zitadel_client.models.v2_state_query.v2StateQuery( - state = 'USER_STATE_UNSPECIFIED', ), - type_query = zitadel_client.models.v2_type_query.v2TypeQuery( - type = 'TYPE_UNSPECIFIED', ), - login_name_query = zitadel_client.models.v2_login_name_query.v2LoginNameQuery( - login_name = 'gigi@zitadel.cloud', ), - in_user_ids_query = zitadel_client.models.v2_in_user_id_query.v2InUserIDQuery( - user_ids = ["69629023906488334","69622366012355662"], ), - or_query = zitadel_client.models.v2_or_query.v2OrQuery(), - and_query = zitadel_client.models.v2_and_query.v2AndQuery(), - not_query = zitadel_client.models.v2_not_query.v2NotQuery( - query = zitadel_client.models.v2_search_query_1.v2SearchQuery_1( - in_user_emails_query = zitadel_client.models.v2_in_user_emails_query.v2InUserEmailsQuery( - user_emails = ["test@example.com","test@example.org"], ), - organization_id_query = zitadel_client.models.v2_organization_id_query.v2OrganizationIDQuery( - id = '69629023906488334', ), - phone_query = zitadel_client.models.v2_phone_query.v2PhoneQuery( - number = '+41791234567', ), ), ), - in_user_emails_query = zitadel_client.models.v2_in_user_emails_query.v2InUserEmailsQuery( - user_emails = ["test@example.com","test@example.org"], ), - organization_id_query = zitadel_client.models.v2_organization_id_query.v2OrganizationIDQuery( - id = '69629023906488334', ), - phone_query = zitadel_client.models.v2_phone_query.v2PhoneQuery( - number = '+41791234567', ), ) - ] - ) - else: - return V2AndQuery( - ) - """ - - def testV2AndQuery(self): - """Test V2AndQuery""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_apple_config.py b/test/test_v2_apple_config.py deleted file mode 100644 index 328a1c22..00000000 --- a/test/test_v2_apple_config.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_apple_config import V2AppleConfig - -class TestV2AppleConfig(unittest.TestCase): - """V2AppleConfig unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2AppleConfig: - """Test V2AppleConfig - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2AppleConfig` - """ - model = V2AppleConfig() - if include_optional: - return V2AppleConfig( - client_id = 'com.client.id', - team_id = 'ALT03JV3OS', - key_id = 'OGKDK25KD', - scopes = ["name","email"] - ) - else: - return V2AppleConfig( - ) - """ - - def testV2AppleConfig(self): - """Test V2AppleConfig""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_auth_factor.py b/test/test_v2_auth_factor.py deleted file mode 100644 index f907a1b1..00000000 --- a/test/test_v2_auth_factor.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_auth_factor import V2AuthFactor - -class TestV2AuthFactor(unittest.TestCase): - """V2AuthFactor unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2AuthFactor: - """Test V2AuthFactor - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2AuthFactor` - """ - model = V2AuthFactor() - if include_optional: - return V2AuthFactor( - state = 'AUTH_FACTOR_STATE_UNSPECIFIED', - otp = zitadel_client.models.v2_auth_factor_otp.v2AuthFactorOTP(), - u2f = zitadel_client.models.v2_auth_factor_u2_f.v2AuthFactorU2F( - id = '69629023906488334', - name = 'fido key', ), - otp_sms = zitadel_client.models.v2_auth_factor_otpsms.v2AuthFactorOTPSMS(), - otp_email = zitadel_client.models.v2_auth_factor_otp_email.v2AuthFactorOTPEmail() - ) - else: - return V2AuthFactor( - ) - """ - - def testV2AuthFactor(self): - """Test V2AuthFactor""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_auth_factor_state.py b/test/test_v2_auth_factor_state.py deleted file mode 100644 index 1648247b..00000000 --- a/test/test_v2_auth_factor_state.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_auth_factor_state import V2AuthFactorState - -class TestV2AuthFactorState(unittest.TestCase): - """V2AuthFactorState unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2AuthFactorState(self): - """Test V2AuthFactorState""" - # inst = V2AuthFactorState() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_auth_factor_u2_f.py b/test/test_v2_auth_factor_u2_f.py deleted file mode 100644 index 6f9afd1d..00000000 --- a/test/test_v2_auth_factor_u2_f.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_auth_factor_u2_f import V2AuthFactorU2F - -class TestV2AuthFactorU2F(unittest.TestCase): - """V2AuthFactorU2F unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2AuthFactorU2F: - """Test V2AuthFactorU2F - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2AuthFactorU2F` - """ - model = V2AuthFactorU2F() - if include_optional: - return V2AuthFactorU2F( - id = '69629023906488334', - name = 'fido key' - ) - else: - return V2AuthFactorU2F( - ) - """ - - def testV2AuthFactorU2F(self): - """Test V2AuthFactorU2F""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_auth_request.py b/test/test_v2_auth_request.py deleted file mode 100644 index fef5c5ce..00000000 --- a/test/test_v2_auth_request.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_auth_request import V2AuthRequest - -class TestV2AuthRequest(unittest.TestCase): - """V2AuthRequest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2AuthRequest: - """Test V2AuthRequest - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2AuthRequest` - """ - model = V2AuthRequest() - if include_optional: - return V2AuthRequest( - id = '', - creation_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - client_id = '', - scope = [ - '' - ], - redirect_uri = '', - prompt = [ - 'PROMPT_UNSPECIFIED' - ], - ui_locales = [ - '' - ], - login_hint = '', - max_age = '', - hint_user_id = '' - ) - else: - return V2AuthRequest( - ) - """ - - def testV2AuthRequest(self): - """Test V2AuthRequest""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_authentication_method_type.py b/test/test_v2_authentication_method_type.py deleted file mode 100644 index bf89410e..00000000 --- a/test/test_v2_authentication_method_type.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_authentication_method_type import V2AuthenticationMethodType - -class TestV2AuthenticationMethodType(unittest.TestCase): - """V2AuthenticationMethodType unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2AuthenticationMethodType(self): - """Test V2AuthenticationMethodType""" - # inst = V2AuthenticationMethodType() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_authorization_error.py b/test/test_v2_authorization_error.py deleted file mode 100644 index 2c7e103b..00000000 --- a/test/test_v2_authorization_error.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_authorization_error import V2AuthorizationError - -class TestV2AuthorizationError(unittest.TestCase): - """V2AuthorizationError unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2AuthorizationError: - """Test V2AuthorizationError - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2AuthorizationError` - """ - model = V2AuthorizationError() - if include_optional: - return V2AuthorizationError( - error = 'ERROR_REASON_UNSPECIFIED', - error_description = '', - error_uri = '' - ) - else: - return V2AuthorizationError( - ) - """ - - def testV2AuthorizationError(self): - """Test V2AuthorizationError""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_auto_linking_option.py b/test/test_v2_auto_linking_option.py deleted file mode 100644 index 0c8553d1..00000000 --- a/test/test_v2_auto_linking_option.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_auto_linking_option import V2AutoLinkingOption - -class TestV2AutoLinkingOption(unittest.TestCase): - """V2AutoLinkingOption unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2AutoLinkingOption(self): - """Test V2AutoLinkingOption""" - # inst = V2AutoLinkingOption() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_azure_ad_config.py b/test/test_v2_azure_ad_config.py deleted file mode 100644 index af85b5b2..00000000 --- a/test/test_v2_azure_ad_config.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_azure_ad_config import V2AzureADConfig - -class TestV2AzureADConfig(unittest.TestCase): - """V2AzureADConfig unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2AzureADConfig: - """Test V2AzureADConfig - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2AzureADConfig` - """ - model = V2AzureADConfig() - if include_optional: - return V2AzureADConfig( - client_id = 'client-id', - tenant = zitadel_client.models.v2_azure_ad_tenant.v2AzureADTenant( - tenant_type = 'AZURE_AD_TENANT_TYPE_COMMON', - tenant_id = '', ), - email_verified = True, - scopes = ["openid","profile","email","User.Read"] - ) - else: - return V2AzureADConfig( - ) - """ - - def testV2AzureADConfig(self): - """Test V2AzureADConfig""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_azure_ad_tenant.py b/test/test_v2_azure_ad_tenant.py deleted file mode 100644 index 292ff0c4..00000000 --- a/test/test_v2_azure_ad_tenant.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_azure_ad_tenant import V2AzureADTenant - -class TestV2AzureADTenant(unittest.TestCase): - """V2AzureADTenant unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2AzureADTenant: - """Test V2AzureADTenant - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2AzureADTenant` - """ - model = V2AzureADTenant() - if include_optional: - return V2AzureADTenant( - tenant_type = 'AZURE_AD_TENANT_TYPE_COMMON', - tenant_id = '' - ) - else: - return V2AzureADTenant( - ) - """ - - def testV2AzureADTenant(self): - """Test V2AzureADTenant""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_azure_ad_tenant_type.py b/test/test_v2_azure_ad_tenant_type.py deleted file mode 100644 index 660677ee..00000000 --- a/test/test_v2_azure_ad_tenant_type.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_azure_ad_tenant_type import V2AzureADTenantType - -class TestV2AzureADTenantType(unittest.TestCase): - """V2AzureADTenantType unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2AzureADTenantType(self): - """Test V2AzureADTenantType""" - # inst = V2AzureADTenantType() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_branding_settings.py b/test/test_v2_branding_settings.py deleted file mode 100644 index 2b8a237e..00000000 --- a/test/test_v2_branding_settings.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_branding_settings import V2BrandingSettings - -class TestV2BrandingSettings(unittest.TestCase): - """V2BrandingSettings unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2BrandingSettings: - """Test V2BrandingSettings - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2BrandingSettings` - """ - model = V2BrandingSettings() - if include_optional: - return V2BrandingSettings( - light_theme = zitadel_client.models.v2_theme.v2Theme( - primary_color = '#5469d4', - background_color = '#FAFAFA', - warn_color = '#CD3D56', - font_color = '#000000', - logo_url = 'https://acme.com/assets/v1/165617850692654601/policy/label/logo-180950416321494657', - icon_url = 'https://acme.com/assets/v1/165617850692654601/policy/label/icon-180950498874178817', ), - dark_theme = zitadel_client.models.v2_theme.v2Theme( - primary_color = '#5469d4', - background_color = '#FAFAFA', - warn_color = '#CD3D56', - font_color = '#000000', - logo_url = 'https://acme.com/assets/v1/165617850692654601/policy/label/logo-180950416321494657', - icon_url = 'https://acme.com/assets/v1/165617850692654601/policy/label/icon-180950498874178817', ), - font_url = 'https://acme.com/assets/v1/165617850692654601/policy/label/font-180950243237405441', - hide_login_name_suffix = True, - disable_watermark = True, - resource_owner_type = 'RESOURCE_OWNER_TYPE_UNSPECIFIED', - theme_mode = 'THEME_MODE_UNSPECIFIED' - ) - else: - return V2BrandingSettings( - ) - """ - - def testV2BrandingSettings(self): - """Test V2BrandingSettings""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_challenges.py b/test/test_v2_challenges.py deleted file mode 100644 index d255552f..00000000 --- a/test/test_v2_challenges.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_challenges import V2Challenges - -class TestV2Challenges(unittest.TestCase): - """V2Challenges unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2Challenges: - """Test V2Challenges - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2Challenges` - """ - model = V2Challenges() - if include_optional: - return V2Challenges( - web_auth_n = zitadel_client.models.v2_challenges_web_auth_n.v2ChallengesWebAuthN( - public_key_credential_request_options = {"publicKey":{"allowCredentials":[{"id":"ATmqBg-99qyOZk2zloPdJQyS2R7IkFT7v9Hoos_B_nM","type":"public-key"}],"challenge":"GAOHYz2jE69kJMYo6Laij8yWw9-dKKgbViNhfuy0StA","rpId":"localhost","timeout":300000,"userVerification":"required"}}, ), - otp_sms = '', - otp_email = '' - ) - else: - return V2Challenges( - ) - """ - - def testV2Challenges(self): - """Test V2Challenges""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_challenges_web_auth_n.py b/test/test_v2_challenges_web_auth_n.py deleted file mode 100644 index 7239cf87..00000000 --- a/test/test_v2_challenges_web_auth_n.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_challenges_web_auth_n import V2ChallengesWebAuthN - -class TestV2ChallengesWebAuthN(unittest.TestCase): - """V2ChallengesWebAuthN unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2ChallengesWebAuthN: - """Test V2ChallengesWebAuthN - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2ChallengesWebAuthN` - """ - model = V2ChallengesWebAuthN() - if include_optional: - return V2ChallengesWebAuthN( - public_key_credential_request_options = {"publicKey":{"allowCredentials":[{"id":"ATmqBg-99qyOZk2zloPdJQyS2R7IkFT7v9Hoos_B_nM","type":"public-key"}],"challenge":"GAOHYz2jE69kJMYo6Laij8yWw9-dKKgbViNhfuy0StA","rpId":"localhost","timeout":300000,"userVerification":"required"}} - ) - else: - return V2ChallengesWebAuthN( - ) - """ - - def testV2ChallengesWebAuthN(self): - """Test V2ChallengesWebAuthN""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_check_idp_intent.py b/test/test_v2_check_idp_intent.py deleted file mode 100644 index 4e8a5947..00000000 --- a/test/test_v2_check_idp_intent.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_check_idp_intent import V2CheckIDPIntent - -class TestV2CheckIDPIntent(unittest.TestCase): - """V2CheckIDPIntent unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2CheckIDPIntent: - """Test V2CheckIDPIntent - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2CheckIDPIntent` - """ - model = V2CheckIDPIntent() - if include_optional: - return V2CheckIDPIntent( - idp_intent_id = 'd654e6ba-70a3-48ef-a95d-37c8d8a7901a', - idp_intent_token = 'SJKL3ioIDpo342ioqw98fjp3sdf32wahb=' - ) - else: - return V2CheckIDPIntent( - ) - """ - - def testV2CheckIDPIntent(self): - """Test V2CheckIDPIntent""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_check_otp.py b/test/test_v2_check_otp.py deleted file mode 100644 index 437ab30a..00000000 --- a/test/test_v2_check_otp.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_check_otp import V2CheckOTP - -class TestV2CheckOTP(unittest.TestCase): - """V2CheckOTP unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2CheckOTP: - """Test V2CheckOTP - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2CheckOTP` - """ - model = V2CheckOTP() - if include_optional: - return V2CheckOTP( - code = '3237642' - ) - else: - return V2CheckOTP( - ) - """ - - def testV2CheckOTP(self): - """Test V2CheckOTP""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_check_password.py b/test/test_v2_check_password.py deleted file mode 100644 index 81438d4c..00000000 --- a/test/test_v2_check_password.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_check_password import V2CheckPassword - -class TestV2CheckPassword(unittest.TestCase): - """V2CheckPassword unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2CheckPassword: - """Test V2CheckPassword - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2CheckPassword` - """ - model = V2CheckPassword() - if include_optional: - return V2CheckPassword( - password = 'V3ryS3cure!' - ) - else: - return V2CheckPassword( - ) - """ - - def testV2CheckPassword(self): - """Test V2CheckPassword""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_check_totp.py b/test/test_v2_check_totp.py deleted file mode 100644 index 8cd8061f..00000000 --- a/test/test_v2_check_totp.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_check_totp import V2CheckTOTP - -class TestV2CheckTOTP(unittest.TestCase): - """V2CheckTOTP unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2CheckTOTP: - """Test V2CheckTOTP - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2CheckTOTP` - """ - model = V2CheckTOTP() - if include_optional: - return V2CheckTOTP( - code = '323764' - ) - else: - return V2CheckTOTP( - ) - """ - - def testV2CheckTOTP(self): - """Test V2CheckTOTP""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_check_user.py b/test/test_v2_check_user.py deleted file mode 100644 index 479a8185..00000000 --- a/test/test_v2_check_user.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_check_user import V2CheckUser - -class TestV2CheckUser(unittest.TestCase): - """V2CheckUser unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2CheckUser: - """Test V2CheckUser - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2CheckUser` - """ - model = V2CheckUser() - if include_optional: - return V2CheckUser( - user_id = 'd654e6ba-70a3-48ef-a95d-37c8d8a7901a', - login_name = 'mini@mouse.com' - ) - else: - return V2CheckUser( - ) - """ - - def testV2CheckUser(self): - """Test V2CheckUser""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_check_web_auth_n.py b/test/test_v2_check_web_auth_n.py deleted file mode 100644 index 40a91908..00000000 --- a/test/test_v2_check_web_auth_n.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_check_web_auth_n import V2CheckWebAuthN - -class TestV2CheckWebAuthN(unittest.TestCase): - """V2CheckWebAuthN unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2CheckWebAuthN: - """Test V2CheckWebAuthN - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2CheckWebAuthN` - """ - model = V2CheckWebAuthN() - if include_optional: - return V2CheckWebAuthN( - credential_assertion_data = zitadel_client.models.credential_assertion_data.credentialAssertionData() - ) - else: - return V2CheckWebAuthN( - credential_assertion_data = zitadel_client.models.credential_assertion_data.credentialAssertionData(), - ) - """ - - def testV2CheckWebAuthN(self): - """Test V2CheckWebAuthN""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_checks.py b/test/test_v2_checks.py deleted file mode 100644 index 5023d7b3..00000000 --- a/test/test_v2_checks.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_checks import V2Checks - -class TestV2Checks(unittest.TestCase): - """V2Checks unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2Checks: - """Test V2Checks - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2Checks` - """ - model = V2Checks() - if include_optional: - return V2Checks( - user = zitadel_client.models.v2_check_user.v2CheckUser( - user_id = 'd654e6ba-70a3-48ef-a95d-37c8d8a7901a', - login_name = 'mini@mouse.com', ), - password = zitadel_client.models.v2_check_password.v2CheckPassword(), - web_auth_n = zitadel_client.models.v2_check_web_auth_n.v2CheckWebAuthN( - credential_assertion_data = zitadel_client.models.credential_assertion_data.credentialAssertionData(), ), - idp_intent = zitadel_client.models.v2_check_idp_intent.v2CheckIDPIntent( - idp_intent_id = 'd654e6ba-70a3-48ef-a95d-37c8d8a7901a', - idp_intent_token = 'SJKL3ioIDpo342ioqw98fjp3sdf32wahb=', ), - totp = zitadel_client.models.v2_check_totp.v2CheckTOTP( - code = '323764', ), - otp_sms = zitadel_client.models.v2_check_otp.v2CheckOTP( - code = '3237642', ), - otp_email = zitadel_client.models.v2_check_otp.v2CheckOTP( - code = '3237642', ) - ) - else: - return V2Checks( - ) - """ - - def testV2Checks(self): - """Test V2Checks""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_create_callback_response.py b/test/test_v2_create_callback_response.py deleted file mode 100644 index fab052ef..00000000 --- a/test/test_v2_create_callback_response.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_create_callback_response import V2CreateCallbackResponse - -class TestV2CreateCallbackResponse(unittest.TestCase): - """V2CreateCallbackResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2CreateCallbackResponse: - """Test V2CreateCallbackResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2CreateCallbackResponse` - """ - model = V2CreateCallbackResponse() - if include_optional: - return V2CreateCallbackResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - callback_url = 'https://client.example.org/cb?code=SplxlOBeZQQYbYS6WxSbIA&state=af0ifjsldkj' - ) - else: - return V2CreateCallbackResponse( - ) - """ - - def testV2CreateCallbackResponse(self): - """Test V2CreateCallbackResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_create_invite_code_response.py b/test/test_v2_create_invite_code_response.py deleted file mode 100644 index 885fbc95..00000000 --- a/test/test_v2_create_invite_code_response.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_create_invite_code_response import V2CreateInviteCodeResponse - -class TestV2CreateInviteCodeResponse(unittest.TestCase): - """V2CreateInviteCodeResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2CreateInviteCodeResponse: - """Test V2CreateInviteCodeResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2CreateInviteCodeResponse` - """ - model = V2CreateInviteCodeResponse() - if include_optional: - return V2CreateInviteCodeResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - invite_code = '' - ) - else: - return V2CreateInviteCodeResponse( - ) - """ - - def testV2CreateInviteCodeResponse(self): - """Test V2CreateInviteCodeResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_create_passkey_registration_link_response.py b/test/test_v2_create_passkey_registration_link_response.py deleted file mode 100644 index e282e0df..00000000 --- a/test/test_v2_create_passkey_registration_link_response.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_create_passkey_registration_link_response import V2CreatePasskeyRegistrationLinkResponse - -class TestV2CreatePasskeyRegistrationLinkResponse(unittest.TestCase): - """V2CreatePasskeyRegistrationLinkResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2CreatePasskeyRegistrationLinkResponse: - """Test V2CreatePasskeyRegistrationLinkResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2CreatePasskeyRegistrationLinkResponse` - """ - model = V2CreatePasskeyRegistrationLinkResponse() - if include_optional: - return V2CreatePasskeyRegistrationLinkResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - code = zitadel_client.models.v2_passkey_registration_code.v2PasskeyRegistrationCode( - id = 'e2a48d6a-362b-4db6-a1fb-34feab84dc62', - code = 'SomeSpecialCode', ) - ) - else: - return V2CreatePasskeyRegistrationLinkResponse( - ) - """ - - def testV2CreatePasskeyRegistrationLinkResponse(self): - """Test V2CreatePasskeyRegistrationLinkResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_create_session_request.py b/test/test_v2_create_session_request.py deleted file mode 100644 index 7533c6e6..00000000 --- a/test/test_v2_create_session_request.py +++ /dev/null @@ -1,90 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_create_session_request import V2CreateSessionRequest - -class TestV2CreateSessionRequest(unittest.TestCase): - """V2CreateSessionRequest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2CreateSessionRequest: - """Test V2CreateSessionRequest - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2CreateSessionRequest` - """ - model = V2CreateSessionRequest() - if include_optional: - return V2CreateSessionRequest( - checks = zitadel_client.models.v2_checks.v2Checks( - user = zitadel_client.models.v2_check_user.v2CheckUser( - user_id = 'd654e6ba-70a3-48ef-a95d-37c8d8a7901a', - login_name = 'mini@mouse.com', ), - password = zitadel_client.models.v2_check_password.v2CheckPassword(), - web_auth_n = zitadel_client.models.v2_check_web_auth_n.v2CheckWebAuthN( - credential_assertion_data = zitadel_client.models.credential_assertion_data.credentialAssertionData(), ), - idp_intent = zitadel_client.models.v2_check_idp_intent.v2CheckIDPIntent( - idp_intent_id = 'd654e6ba-70a3-48ef-a95d-37c8d8a7901a', - idp_intent_token = 'SJKL3ioIDpo342ioqw98fjp3sdf32wahb=', ), - totp = zitadel_client.models.v2_check_totp.v2CheckTOTP( - code = '323764', ), - otp_sms = zitadel_client.models.v2_check_otp.v2CheckOTP( - code = '3237642', ), - otp_email = zitadel_client.models.v2_check_otp.v2CheckOTP( - code = '3237642', ), ), - metadata = { - 'key' : 'YQ==' - }, - challenges = zitadel_client.models.v2_request_challenges.v2RequestChallenges( - web_auth_n = zitadel_client.models.v2_request_challenges_web_auth_n.v2RequestChallengesWebAuthN( - domain = '', - user_verification_requirement = 'USER_VERIFICATION_REQUIREMENT_UNSPECIFIED', ), - otp_sms = zitadel_client.models.request_challenges_otpsms.RequestChallengesOTPSMS( - return_code = True, ), - otp_email = zitadel_client.models.request_challenges_otp_email.RequestChallengesOTPEmail( - send_code = zitadel_client.models.otp_email_send_code.OTPEmailSendCode( - url_template = 'https://example.com/otp/verify?userID={{.UserID}}&code={{.Code}}', ), - return_code = zitadel_client.models.otp_email_return_code.OTPEmailReturnCode(), ), ), - user_agent = zitadel_client.models.v2_user_agent.v2UserAgent( - fingerprint_id = '', - ip = '', - description = '', - header = { - 'key' : zitadel_client.models.user_agent_header_values.UserAgentHeaderValues( - values = [ - '' - ], ) - }, ), - lifetime = '18000s' - ) - else: - return V2CreateSessionRequest( - ) - """ - - def testV2CreateSessionRequest(self): - """Test V2CreateSessionRequest""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_create_session_response.py b/test/test_v2_create_session_response.py deleted file mode 100644 index f96634bc..00000000 --- a/test/test_v2_create_session_response.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_create_session_response import V2CreateSessionResponse - -class TestV2CreateSessionResponse(unittest.TestCase): - """V2CreateSessionResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2CreateSessionResponse: - """Test V2CreateSessionResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2CreateSessionResponse` - """ - model = V2CreateSessionResponse() - if include_optional: - return V2CreateSessionResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - session_id = '222430354126975533', - session_token = '', - challenges = zitadel_client.models.v2_challenges.v2Challenges( - web_auth_n = zitadel_client.models.v2_challenges_web_auth_n.v2ChallengesWebAuthN( - public_key_credential_request_options = {"publicKey":{"allowCredentials":[{"id":"ATmqBg-99qyOZk2zloPdJQyS2R7IkFT7v9Hoos_B_nM","type":"public-key"}],"challenge":"GAOHYz2jE69kJMYo6Laij8yWw9-dKKgbViNhfuy0StA","rpId":"localhost","timeout":300000,"userVerification":"required"}}, ), - otp_sms = '', - otp_email = '', ) - ) - else: - return V2CreateSessionResponse( - ) - """ - - def testV2CreateSessionResponse(self): - """Test V2CreateSessionResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_creation_date_query.py b/test/test_v2_creation_date_query.py deleted file mode 100644 index a2f909d7..00000000 --- a/test/test_v2_creation_date_query.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_creation_date_query import V2CreationDateQuery - -class TestV2CreationDateQuery(unittest.TestCase): - """V2CreationDateQuery unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2CreationDateQuery: - """Test V2CreationDateQuery - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2CreationDateQuery` - """ - model = V2CreationDateQuery() - if include_optional: - return V2CreationDateQuery( - creation_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - method = 'TIMESTAMP_QUERY_METHOD_EQUALS' - ) - else: - return V2CreationDateQuery( - ) - """ - - def testV2CreationDateQuery(self): - """Test V2CreationDateQuery""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_creator_query.py b/test/test_v2_creator_query.py deleted file mode 100644 index 17bca07f..00000000 --- a/test/test_v2_creator_query.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_creator_query import V2CreatorQuery - -class TestV2CreatorQuery(unittest.TestCase): - """V2CreatorQuery unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2CreatorQuery: - """Test V2CreatorQuery - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2CreatorQuery` - """ - model = V2CreatorQuery() - if include_optional: - return V2CreatorQuery( - id = '69629023906488334' - ) - else: - return V2CreatorQuery( - ) - """ - - def testV2CreatorQuery(self): - """Test V2CreatorQuery""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_deactivate_user_response.py b/test/test_v2_deactivate_user_response.py deleted file mode 100644 index 1a0109aa..00000000 --- a/test/test_v2_deactivate_user_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_deactivate_user_response import V2DeactivateUserResponse - -class TestV2DeactivateUserResponse(unittest.TestCase): - """V2DeactivateUserResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2DeactivateUserResponse: - """Test V2DeactivateUserResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2DeactivateUserResponse` - """ - model = V2DeactivateUserResponse() - if include_optional: - return V2DeactivateUserResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2DeactivateUserResponse( - ) - """ - - def testV2DeactivateUserResponse(self): - """Test V2DeactivateUserResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_delete_session_response.py b/test/test_v2_delete_session_response.py deleted file mode 100644 index 986d68e5..00000000 --- a/test/test_v2_delete_session_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_delete_session_response import V2DeleteSessionResponse - -class TestV2DeleteSessionResponse(unittest.TestCase): - """V2DeleteSessionResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2DeleteSessionResponse: - """Test V2DeleteSessionResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2DeleteSessionResponse` - """ - model = V2DeleteSessionResponse() - if include_optional: - return V2DeleteSessionResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2DeleteSessionResponse( - ) - """ - - def testV2DeleteSessionResponse(self): - """Test V2DeleteSessionResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_delete_user_response.py b/test/test_v2_delete_user_response.py deleted file mode 100644 index aa9b6cd6..00000000 --- a/test/test_v2_delete_user_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_delete_user_response import V2DeleteUserResponse - -class TestV2DeleteUserResponse(unittest.TestCase): - """V2DeleteUserResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2DeleteUserResponse: - """Test V2DeleteUserResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2DeleteUserResponse` - """ - model = V2DeleteUserResponse() - if include_optional: - return V2DeleteUserResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2DeleteUserResponse( - ) - """ - - def testV2DeleteUserResponse(self): - """Test V2DeleteUserResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_details.py b/test/test_v2_details.py deleted file mode 100644 index 076cd460..00000000 --- a/test/test_v2_details.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_details import V2Details - -class TestV2Details(unittest.TestCase): - """V2Details unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2Details: - """Test V2Details - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2Details` - """ - model = V2Details() - if include_optional: - return V2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334' - ) - else: - return V2Details( - ) - """ - - def testV2Details(self): - """Test V2Details""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_display_name_query.py b/test/test_v2_display_name_query.py deleted file mode 100644 index 7f39ad20..00000000 --- a/test/test_v2_display_name_query.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_display_name_query import V2DisplayNameQuery - -class TestV2DisplayNameQuery(unittest.TestCase): - """V2DisplayNameQuery unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2DisplayNameQuery: - """Test V2DisplayNameQuery - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2DisplayNameQuery` - """ - model = V2DisplayNameQuery() - if include_optional: - return V2DisplayNameQuery( - display_name = 'Gigi Giraffe', - method = 'TEXT_QUERY_METHOD_EQUALS' - ) - else: - return V2DisplayNameQuery( - display_name = 'Gigi Giraffe', - ) - """ - - def testV2DisplayNameQuery(self): - """Test V2DisplayNameQuery""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_domain_settings.py b/test/test_v2_domain_settings.py deleted file mode 100644 index 680ab973..00000000 --- a/test/test_v2_domain_settings.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_domain_settings import V2DomainSettings - -class TestV2DomainSettings(unittest.TestCase): - """V2DomainSettings unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2DomainSettings: - """Test V2DomainSettings - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2DomainSettings` - """ - model = V2DomainSettings() - if include_optional: - return V2DomainSettings( - login_name_includes_domain = True, - require_org_domain_verification = True, - smtp_sender_address_matches_instance_domain = True, - resource_owner_type = 'RESOURCE_OWNER_TYPE_UNSPECIFIED' - ) - else: - return V2DomainSettings( - ) - """ - - def testV2DomainSettings(self): - """Test V2DomainSettings""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_email_query.py b/test/test_v2_email_query.py deleted file mode 100644 index c0e0f7ab..00000000 --- a/test/test_v2_email_query.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_email_query import V2EmailQuery - -class TestV2EmailQuery(unittest.TestCase): - """V2EmailQuery unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2EmailQuery: - """Test V2EmailQuery - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2EmailQuery` - """ - model = V2EmailQuery() - if include_optional: - return V2EmailQuery( - email_address = 'gigi@zitadel.com', - method = 'TEXT_QUERY_METHOD_EQUALS' - ) - else: - return V2EmailQuery( - email_address = 'gigi@zitadel.com', - ) - """ - - def testV2EmailQuery(self): - """Test V2EmailQuery""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_embedded_iframe_settings.py b/test/test_v2_embedded_iframe_settings.py deleted file mode 100644 index 78e66c3c..00000000 --- a/test/test_v2_embedded_iframe_settings.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_embedded_iframe_settings import V2EmbeddedIframeSettings - -class TestV2EmbeddedIframeSettings(unittest.TestCase): - """V2EmbeddedIframeSettings unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2EmbeddedIframeSettings: - """Test V2EmbeddedIframeSettings - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2EmbeddedIframeSettings` - """ - model = V2EmbeddedIframeSettings() - if include_optional: - return V2EmbeddedIframeSettings( - enabled = True, - allowed_origins = ["foo.bar.com","localhost:8080"] - ) - else: - return V2EmbeddedIframeSettings( - ) - """ - - def testV2EmbeddedIframeSettings(self): - """Test V2EmbeddedIframeSettings""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_error_reason.py b/test/test_v2_error_reason.py deleted file mode 100644 index a67a6b5d..00000000 --- a/test/test_v2_error_reason.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_error_reason import V2ErrorReason - -class TestV2ErrorReason(unittest.TestCase): - """V2ErrorReason unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2ErrorReason(self): - """Test V2ErrorReason""" - # inst = V2ErrorReason() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_factors.py b/test/test_v2_factors.py deleted file mode 100644 index 53f68d5e..00000000 --- a/test/test_v2_factors.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_factors import V2Factors - -class TestV2Factors(unittest.TestCase): - """V2Factors unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2Factors: - """Test V2Factors - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2Factors` - """ - model = V2Factors() - if include_optional: - return V2Factors( - user = zitadel_client.models.v2_user_factor.v2UserFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - id = '', - login_name = '', - display_name = '', - organization_id = '', ), - password = zitadel_client.models.v2_password_factor.v2PasswordFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), - web_auth_n = zitadel_client.models.v2_web_auth_n_factor.v2WebAuthNFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - user_verified = True, ), - intent = zitadel_client.models.v2_intent_factor.v2IntentFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), - totp = zitadel_client.models.v2_totp_factor.v2TOTPFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), - otp_sms = zitadel_client.models.v2_otp_factor.v2OTPFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), - otp_email = zitadel_client.models.v2_otp_factor.v2OTPFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) - ) - else: - return V2Factors( - ) - """ - - def testV2Factors(self): - """Test V2Factors""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_feature_flag.py b/test/test_v2_feature_flag.py deleted file mode 100644 index e5567b05..00000000 --- a/test/test_v2_feature_flag.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_feature_flag import V2FeatureFlag - -class TestV2FeatureFlag(unittest.TestCase): - """V2FeatureFlag unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2FeatureFlag: - """Test V2FeatureFlag - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2FeatureFlag` - """ - model = V2FeatureFlag() - if include_optional: - return V2FeatureFlag( - enabled = False, - source = 'SOURCE_UNSPECIFIED' - ) - else: - return V2FeatureFlag( - ) - """ - - def testV2FeatureFlag(self): - """Test V2FeatureFlag""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_first_name_query.py b/test/test_v2_first_name_query.py deleted file mode 100644 index e477d3d6..00000000 --- a/test/test_v2_first_name_query.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_first_name_query import V2FirstNameQuery - -class TestV2FirstNameQuery(unittest.TestCase): - """V2FirstNameQuery unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2FirstNameQuery: - """Test V2FirstNameQuery - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2FirstNameQuery` - """ - model = V2FirstNameQuery() - if include_optional: - return V2FirstNameQuery( - first_name = 'Gigi', - method = 'TEXT_QUERY_METHOD_EQUALS' - ) - else: - return V2FirstNameQuery( - first_name = 'Gigi', - ) - """ - - def testV2FirstNameQuery(self): - """Test V2FirstNameQuery""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_gender.py b/test/test_v2_gender.py deleted file mode 100644 index c1e94671..00000000 --- a/test/test_v2_gender.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_gender import V2Gender - -class TestV2Gender(unittest.TestCase): - """V2Gender unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2Gender(self): - """Test V2Gender""" - # inst = V2Gender() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_generic_oidc_config.py b/test/test_v2_generic_oidc_config.py deleted file mode 100644 index a83eb0a6..00000000 --- a/test/test_v2_generic_oidc_config.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_generic_oidc_config import V2GenericOIDCConfig - -class TestV2GenericOIDCConfig(unittest.TestCase): - """V2GenericOIDCConfig unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2GenericOIDCConfig: - """Test V2GenericOIDCConfig - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2GenericOIDCConfig` - """ - model = V2GenericOIDCConfig() - if include_optional: - return V2GenericOIDCConfig( - issuer = 'https://accounts.google.com/', - client_id = 'client-id', - scopes = ["openid","profile","email"], - is_id_token_mapping = True - ) - else: - return V2GenericOIDCConfig( - ) - """ - - def testV2GenericOIDCConfig(self): - """Test V2GenericOIDCConfig""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_get_active_identity_providers_response.py b/test/test_v2_get_active_identity_providers_response.py deleted file mode 100644 index fa571632..00000000 --- a/test/test_v2_get_active_identity_providers_response.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_get_active_identity_providers_response import V2GetActiveIdentityProvidersResponse - -class TestV2GetActiveIdentityProvidersResponse(unittest.TestCase): - """V2GetActiveIdentityProvidersResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2GetActiveIdentityProvidersResponse: - """Test V2GetActiveIdentityProvidersResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2GetActiveIdentityProvidersResponse` - """ - model = V2GetActiveIdentityProvidersResponse() - if include_optional: - return V2GetActiveIdentityProvidersResponse( - details = zitadel_client.models.v2_list_details.v2ListDetails( - total_result = '2', - processed_sequence = '267831', - timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), - identity_providers = [ - zitadel_client.models.v2_identity_provider.v2IdentityProvider( - id = '', - name = '', - type = 'IDENTITY_PROVIDER_TYPE_UNSPECIFIED', - options = zitadel_client.models.zitadelidpv2_options_1.zitadelidpv2Options_1( - is_linking_allowed = True, - is_creation_allowed = True, - is_auto_creation = True, - is_auto_update = True, - auto_linking = 'AUTO_LINKING_OPTION_UNSPECIFIED', ), ) - ] - ) - else: - return V2GetActiveIdentityProvidersResponse( - ) - """ - - def testV2GetActiveIdentityProvidersResponse(self): - """Test V2GetActiveIdentityProvidersResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_get_auth_request_response.py b/test/test_v2_get_auth_request_response.py deleted file mode 100644 index 095a7e23..00000000 --- a/test/test_v2_get_auth_request_response.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_get_auth_request_response import V2GetAuthRequestResponse - -class TestV2GetAuthRequestResponse(unittest.TestCase): - """V2GetAuthRequestResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2GetAuthRequestResponse: - """Test V2GetAuthRequestResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2GetAuthRequestResponse` - """ - model = V2GetAuthRequestResponse() - if include_optional: - return V2GetAuthRequestResponse( - auth_request = zitadel_client.models.v2_auth_request.v2AuthRequest( - id = '', - creation_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - client_id = '', - scope = [ - '' - ], - redirect_uri = '', - prompt = [ - 'PROMPT_UNSPECIFIED' - ], - ui_locales = [ - '' - ], - login_hint = '', - max_age = '', - hint_user_id = '', ) - ) - else: - return V2GetAuthRequestResponse( - ) - """ - - def testV2GetAuthRequestResponse(self): - """Test V2GetAuthRequestResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_get_branding_settings_response.py b/test/test_v2_get_branding_settings_response.py deleted file mode 100644 index a96433b7..00000000 --- a/test/test_v2_get_branding_settings_response.py +++ /dev/null @@ -1,74 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_get_branding_settings_response import V2GetBrandingSettingsResponse - -class TestV2GetBrandingSettingsResponse(unittest.TestCase): - """V2GetBrandingSettingsResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2GetBrandingSettingsResponse: - """Test V2GetBrandingSettingsResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2GetBrandingSettingsResponse` - """ - model = V2GetBrandingSettingsResponse() - if include_optional: - return V2GetBrandingSettingsResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - settings = zitadel_client.models.v2_branding_settings.v2BrandingSettings( - light_theme = zitadel_client.models.v2_theme.v2Theme( - primary_color = '#5469d4', - background_color = '#FAFAFA', - warn_color = '#CD3D56', - font_color = '#000000', - logo_url = 'https://acme.com/assets/v1/165617850692654601/policy/label/logo-180950416321494657', - icon_url = 'https://acme.com/assets/v1/165617850692654601/policy/label/icon-180950498874178817', ), - dark_theme = zitadel_client.models.v2_theme.v2Theme( - primary_color = '#5469d4', - background_color = '#FAFAFA', - warn_color = '#CD3D56', - font_color = '#000000', - logo_url = 'https://acme.com/assets/v1/165617850692654601/policy/label/logo-180950416321494657', - icon_url = 'https://acme.com/assets/v1/165617850692654601/policy/label/icon-180950498874178817', ), - font_url = 'https://acme.com/assets/v1/165617850692654601/policy/label/font-180950243237405441', - hide_login_name_suffix = True, - disable_watermark = True, - resource_owner_type = 'RESOURCE_OWNER_TYPE_UNSPECIFIED', - theme_mode = 'THEME_MODE_UNSPECIFIED', ) - ) - else: - return V2GetBrandingSettingsResponse( - ) - """ - - def testV2GetBrandingSettingsResponse(self): - """Test V2GetBrandingSettingsResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_get_domain_settings_response.py b/test/test_v2_get_domain_settings_response.py deleted file mode 100644 index 638e6de6..00000000 --- a/test/test_v2_get_domain_settings_response.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_get_domain_settings_response import V2GetDomainSettingsResponse - -class TestV2GetDomainSettingsResponse(unittest.TestCase): - """V2GetDomainSettingsResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2GetDomainSettingsResponse: - """Test V2GetDomainSettingsResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2GetDomainSettingsResponse` - """ - model = V2GetDomainSettingsResponse() - if include_optional: - return V2GetDomainSettingsResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - settings = zitadel_client.models.v2_domain_settings.v2DomainSettings( - login_name_includes_domain = True, - require_org_domain_verification = True, - smtp_sender_address_matches_instance_domain = True, - resource_owner_type = 'RESOURCE_OWNER_TYPE_UNSPECIFIED', ) - ) - else: - return V2GetDomainSettingsResponse( - ) - """ - - def testV2GetDomainSettingsResponse(self): - """Test V2GetDomainSettingsResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_get_general_settings_response.py b/test/test_v2_get_general_settings_response.py deleted file mode 100644 index 78509a01..00000000 --- a/test/test_v2_get_general_settings_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_get_general_settings_response import V2GetGeneralSettingsResponse - -class TestV2GetGeneralSettingsResponse(unittest.TestCase): - """V2GetGeneralSettingsResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2GetGeneralSettingsResponse: - """Test V2GetGeneralSettingsResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2GetGeneralSettingsResponse` - """ - model = V2GetGeneralSettingsResponse() - if include_optional: - return V2GetGeneralSettingsResponse( - default_org_id = '', - default_language = 'en', - supported_languages = ["en","de","it"] - ) - else: - return V2GetGeneralSettingsResponse( - ) - """ - - def testV2GetGeneralSettingsResponse(self): - """Test V2GetGeneralSettingsResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_get_idpby_id_response.py b/test/test_v2_get_idpby_id_response.py deleted file mode 100644 index 9f57fb3f..00000000 --- a/test/test_v2_get_idpby_id_response.py +++ /dev/null @@ -1,149 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_get_idpby_id_response import V2GetIDPByIDResponse - -class TestV2GetIDPByIDResponse(unittest.TestCase): - """V2GetIDPByIDResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2GetIDPByIDResponse: - """Test V2GetIDPByIDResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2GetIDPByIDResponse` - """ - model = V2GetIDPByIDResponse() - if include_optional: - return V2GetIDPByIDResponse( - idp = zitadel_client.models.v2_idp.v2IDP( - id = '69629023906488334', - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - state = 'IDP_STATE_UNSPECIFIED', - name = 'Google', - type = 'IDP_TYPE_UNSPECIFIED', - config = zitadel_client.models.v2_idp_config.v2IDPConfig( - options = zitadel_client.models.zitadelidpv2_options.zitadelidpv2Options( - is_linking_allowed = True, - is_creation_allowed = True, - is_auto_creation = True, - is_auto_update = True, - auto_linking = 'AUTO_LINKING_OPTION_UNSPECIFIED', ), - ldap = zitadel_client.models.v2_ldap_config.v2LDAPConfig( - servers = [ - '' - ], - start_tls = True, - base_dn = '', - bind_dn = '', - user_base = '', - user_object_classes = [ - '' - ], - user_filters = [ - '' - ], - timeout = '', - attributes = zitadel_client.models.v2_ldap_attributes.v2LDAPAttributes( - id_attribute = '', - first_name_attribute = '', - last_name_attribute = '', - display_name_attribute = '', - nick_name_attribute = '', - preferred_username_attribute = '', - email_attribute = '', - email_verified_attribute = '', - phone_attribute = '', - phone_verified_attribute = '', - preferred_language_attribute = '', - avatar_url_attribute = '', - profile_attribute = '', ), ), - google = zitadel_client.models.v2_google_config.v2GoogleConfig( - client_id = 'client-id', - scopes = ["openid","profile","email"], ), - oauth = zitadel_client.models.v2_o_auth_config.v2OAuthConfig( - client_id = 'client-id', - authorization_endpoint = 'https://accounts.google.com/o/oauth2/v2/auth', - token_endpoint = 'https://oauth2.googleapis.com/token', - user_endpoint = 'https://openidconnect.googleapis.com/v1/userinfo', - scopes = ["openid","profile","email"], - id_attribute = 'user_id', ), - oidc = zitadel_client.models.v2_generic_oidc_config.v2GenericOIDCConfig( - issuer = 'https://accounts.google.com/', - client_id = 'client-id', - scopes = ["openid","profile","email"], - is_id_token_mapping = True, ), - jwt = zitadel_client.models.v2_jwt_config.v2JWTConfig( - jwt_endpoint = 'https://accounts.google.com', - issuer = 'https://accounts.google.com', - keys_endpoint = 'https://accounts.google.com/keys', - header_name = 'x-auth-token', ), - github = zitadel_client.models.v2_git_hub_config.v2GitHubConfig( - client_id = 'client-id', - scopes = ["openid","profile","email"], ), - github_es = zitadel_client.models.v2_git_hub_enterprise_server_config.v2GitHubEnterpriseServerConfig( - client_id = 'client-id', - authorization_endpoint = '', - token_endpoint = '', - user_endpoint = '', - scopes = ["openid","profile","email"], ), - gitlab = zitadel_client.models.v2_git_lab_config.v2GitLabConfig( - client_id = 'client-id', - scopes = ["openid","profile","email"], ), - gitlab_self_hosted = zitadel_client.models.v2_git_lab_self_hosted_config.v2GitLabSelfHostedConfig( - issuer = '', - client_id = 'client-id', - scopes = ["openid","profile","email"], ), - azure_ad = zitadel_client.models.v2_azure_ad_config.v2AzureADConfig( - client_id = 'client-id', - tenant = zitadel_client.models.v2_azure_ad_tenant.v2AzureADTenant( - tenant_type = 'AZURE_AD_TENANT_TYPE_COMMON', - tenant_id = '', ), - email_verified = True, - scopes = ["openid","profile","email","User.Read"], ), - apple = zitadel_client.models.v2_apple_config.v2AppleConfig( - client_id = 'com.client.id', - team_id = 'ALT03JV3OS', - key_id = 'OGKDK25KD', - scopes = ["name","email"], ), - saml = zitadel_client.models.v2_saml_config.v2SAMLConfig( - metadata_xml = 'YQ==', - binding = 'SAML_BINDING_UNSPECIFIED', - with_signed_request = True, - name_id_format = 'SAML_NAME_ID_FORMAT_UNSPECIFIED', - transient_mapping_attribute_name = '', ), ), ) - ) - else: - return V2GetIDPByIDResponse( - ) - """ - - def testV2GetIDPByIDResponse(self): - """Test V2GetIDPByIDResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_get_instance_features_response.py b/test/test_v2_get_instance_features_response.py deleted file mode 100644 index 9bc17259..00000000 --- a/test/test_v2_get_instance_features_response.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_get_instance_features_response import V2GetInstanceFeaturesResponse - -class TestV2GetInstanceFeaturesResponse(unittest.TestCase): - """V2GetInstanceFeaturesResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2GetInstanceFeaturesResponse: - """Test V2GetInstanceFeaturesResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2GetInstanceFeaturesResponse` - """ - model = V2GetInstanceFeaturesResponse() - if include_optional: - return V2GetInstanceFeaturesResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - login_default_org = zitadel_client.models.v2_feature_flag.v2FeatureFlag( - enabled = False, - source = 'SOURCE_UNSPECIFIED', ), - oidc_trigger_introspection_projections = zitadel_client.models.v2_feature_flag.v2FeatureFlag( - enabled = False, - source = 'SOURCE_UNSPECIFIED', ), - oidc_legacy_introspection = zitadel_client.models.v2_feature_flag.v2FeatureFlag( - enabled = False, - source = 'SOURCE_UNSPECIFIED', ), - user_schema = zitadel_client.models.v2_feature_flag.v2FeatureFlag( - enabled = False, - source = 'SOURCE_UNSPECIFIED', ), - oidc_token_exchange = zitadel_client.models.v2_feature_flag.v2FeatureFlag( - enabled = False, - source = 'SOURCE_UNSPECIFIED', ), - actions = zitadel_client.models.v2_feature_flag.v2FeatureFlag( - enabled = False, - source = 'SOURCE_UNSPECIFIED', ), - improved_performance = zitadel_client.models.v2_improved_performance_feature_flag.v2ImprovedPerformanceFeatureFlag( - execution_paths = [1], - source = 'SOURCE_UNSPECIFIED', ), - web_key = zitadel_client.models.v2_feature_flag.v2FeatureFlag( - enabled = False, - source = 'SOURCE_UNSPECIFIED', ), - debug_oidc_parent_error = zitadel_client.models.v2_feature_flag.v2FeatureFlag( - enabled = False, - source = 'SOURCE_UNSPECIFIED', ), - oidc_single_v1_session_termination = zitadel_client.models.v2_feature_flag.v2FeatureFlag( - enabled = False, - source = 'SOURCE_UNSPECIFIED', ), - disable_user_token_event = zitadel_client.models.v2_feature_flag.v2FeatureFlag( - enabled = False, - source = 'SOURCE_UNSPECIFIED', ), - enable_back_channel_logout = zitadel_client.models.v2_feature_flag.v2FeatureFlag( - enabled = False, - source = 'SOURCE_UNSPECIFIED', ), - login_v2 = zitadel_client.models.v2_login_v2_feature_flag.v2LoginV2FeatureFlag( - required = True, - base_uri = '', - source = 'SOURCE_UNSPECIFIED', ), - permission_check_v2 = zitadel_client.models.v2_feature_flag.v2FeatureFlag( - enabled = False, - source = 'SOURCE_UNSPECIFIED', ) - ) - else: - return V2GetInstanceFeaturesResponse( - ) - """ - - def testV2GetInstanceFeaturesResponse(self): - """Test V2GetInstanceFeaturesResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_get_legal_and_support_settings_response.py b/test/test_v2_get_legal_and_support_settings_response.py deleted file mode 100644 index 8abd49b0..00000000 --- a/test/test_v2_get_legal_and_support_settings_response.py +++ /dev/null @@ -1,63 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_get_legal_and_support_settings_response import V2GetLegalAndSupportSettingsResponse - -class TestV2GetLegalAndSupportSettingsResponse(unittest.TestCase): - """V2GetLegalAndSupportSettingsResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2GetLegalAndSupportSettingsResponse: - """Test V2GetLegalAndSupportSettingsResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2GetLegalAndSupportSettingsResponse` - """ - model = V2GetLegalAndSupportSettingsResponse() - if include_optional: - return V2GetLegalAndSupportSettingsResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - settings = zitadel_client.models.v2_legal_and_support_settings.v2LegalAndSupportSettings( - tos_link = 'https://zitadel.com/docs/legal/terms-of-service', - privacy_policy_link = 'https://zitadel.com/docs/legal/privacy-policy', - help_link = 'https://zitadel.com/docs/manuals/introduction', - support_email = 'support-email@test.com', - resource_owner_type = 'RESOURCE_OWNER_TYPE_UNSPECIFIED', - docs_link = 'https://zitadel.com/docs', - custom_link = 'https://external.link', - custom_link_text = 'External', ) - ) - else: - return V2GetLegalAndSupportSettingsResponse( - ) - """ - - def testV2GetLegalAndSupportSettingsResponse(self): - """Test V2GetLegalAndSupportSettingsResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_get_lockout_settings_response.py b/test/test_v2_get_lockout_settings_response.py deleted file mode 100644 index 244282d9..00000000 --- a/test/test_v2_get_lockout_settings_response.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_get_lockout_settings_response import V2GetLockoutSettingsResponse - -class TestV2GetLockoutSettingsResponse(unittest.TestCase): - """V2GetLockoutSettingsResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2GetLockoutSettingsResponse: - """Test V2GetLockoutSettingsResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2GetLockoutSettingsResponse` - """ - model = V2GetLockoutSettingsResponse() - if include_optional: - return V2GetLockoutSettingsResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - settings = zitadel_client.models.v2_lockout_settings.v2LockoutSettings( - max_password_attempts = '10', - resource_owner_type = 'RESOURCE_OWNER_TYPE_UNSPECIFIED', - max_otp_attempts = '10', ) - ) - else: - return V2GetLockoutSettingsResponse( - ) - """ - - def testV2GetLockoutSettingsResponse(self): - """Test V2GetLockoutSettingsResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_get_login_settings_response.py b/test/test_v2_get_login_settings_response.py deleted file mode 100644 index 4f71502a..00000000 --- a/test/test_v2_get_login_settings_response.py +++ /dev/null @@ -1,79 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_get_login_settings_response import V2GetLoginSettingsResponse - -class TestV2GetLoginSettingsResponse(unittest.TestCase): - """V2GetLoginSettingsResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2GetLoginSettingsResponse: - """Test V2GetLoginSettingsResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2GetLoginSettingsResponse` - """ - model = V2GetLoginSettingsResponse() - if include_optional: - return V2GetLoginSettingsResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - settings = zitadel_client.models.v2_login_settings.v2LoginSettings( - allow_username_password = True, - allow_register = True, - allow_external_idp = True, - force_mfa = True, - passkeys_type = 'PASSKEYS_TYPE_NOT_ALLOWED', - hide_password_reset = True, - ignore_unknown_usernames = True, - default_redirect_uri = 'https://acme.com/ui/console', - password_check_lifetime = '864000s', - external_login_check_lifetime = '864000s', - mfa_init_skip_lifetime = '2592000s', - second_factor_check_lifetime = '64800s', - multi_factor_check_lifetime = '43200s', - second_factors = [ - 'SECOND_FACTOR_TYPE_UNSPECIFIED' - ], - multi_factors = [ - 'MULTI_FACTOR_TYPE_UNSPECIFIED' - ], - allow_domain_discovery = True, - disable_login_with_email = True, - disable_login_with_phone = True, - resource_owner_type = 'RESOURCE_OWNER_TYPE_UNSPECIFIED', - force_mfa_local_only = True, ) - ) - else: - return V2GetLoginSettingsResponse( - ) - """ - - def testV2GetLoginSettingsResponse(self): - """Test V2GetLoginSettingsResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_get_organization_features_response.py b/test/test_v2_get_organization_features_response.py deleted file mode 100644 index 43473812..00000000 --- a/test/test_v2_get_organization_features_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_get_organization_features_response import V2GetOrganizationFeaturesResponse - -class TestV2GetOrganizationFeaturesResponse(unittest.TestCase): - """V2GetOrganizationFeaturesResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2GetOrganizationFeaturesResponse: - """Test V2GetOrganizationFeaturesResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2GetOrganizationFeaturesResponse` - """ - model = V2GetOrganizationFeaturesResponse() - if include_optional: - return V2GetOrganizationFeaturesResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2GetOrganizationFeaturesResponse( - ) - """ - - def testV2GetOrganizationFeaturesResponse(self): - """Test V2GetOrganizationFeaturesResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_get_password_complexity_settings_response.py b/test/test_v2_get_password_complexity_settings_response.py deleted file mode 100644 index da6e6479..00000000 --- a/test/test_v2_get_password_complexity_settings_response.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_get_password_complexity_settings_response import V2GetPasswordComplexitySettingsResponse - -class TestV2GetPasswordComplexitySettingsResponse(unittest.TestCase): - """V2GetPasswordComplexitySettingsResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2GetPasswordComplexitySettingsResponse: - """Test V2GetPasswordComplexitySettingsResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2GetPasswordComplexitySettingsResponse` - """ - model = V2GetPasswordComplexitySettingsResponse() - if include_optional: - return V2GetPasswordComplexitySettingsResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - settings = zitadel_client.models.v2_password_complexity_settings.v2PasswordComplexitySettings( - min_length = '8', - requires_uppercase = True, - requires_lowercase = True, - requires_number = True, - requires_symbol = True, - resource_owner_type = 'RESOURCE_OWNER_TYPE_UNSPECIFIED', ) - ) - else: - return V2GetPasswordComplexitySettingsResponse( - ) - """ - - def testV2GetPasswordComplexitySettingsResponse(self): - """Test V2GetPasswordComplexitySettingsResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_get_password_expiry_settings_response.py b/test/test_v2_get_password_expiry_settings_response.py deleted file mode 100644 index ae3fbc41..00000000 --- a/test/test_v2_get_password_expiry_settings_response.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_get_password_expiry_settings_response import V2GetPasswordExpirySettingsResponse - -class TestV2GetPasswordExpirySettingsResponse(unittest.TestCase): - """V2GetPasswordExpirySettingsResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2GetPasswordExpirySettingsResponse: - """Test V2GetPasswordExpirySettingsResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2GetPasswordExpirySettingsResponse` - """ - model = V2GetPasswordExpirySettingsResponse() - if include_optional: - return V2GetPasswordExpirySettingsResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - settings = zitadel_client.models.v2_password_expiry_settings.v2PasswordExpirySettings( - max_age_days = '365', - expire_warn_days = '10', - resource_owner_type = 'RESOURCE_OWNER_TYPE_UNSPECIFIED', ) - ) - else: - return V2GetPasswordExpirySettingsResponse( - ) - """ - - def testV2GetPasswordExpirySettingsResponse(self): - """Test V2GetPasswordExpirySettingsResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_get_security_settings_response.py b/test/test_v2_get_security_settings_response.py deleted file mode 100644 index 86a1ae09..00000000 --- a/test/test_v2_get_security_settings_response.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_get_security_settings_response import V2GetSecuritySettingsResponse - -class TestV2GetSecuritySettingsResponse(unittest.TestCase): - """V2GetSecuritySettingsResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2GetSecuritySettingsResponse: - """Test V2GetSecuritySettingsResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2GetSecuritySettingsResponse` - """ - model = V2GetSecuritySettingsResponse() - if include_optional: - return V2GetSecuritySettingsResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - settings = zitadel_client.models.v2_security_settings.v2SecuritySettings( - embedded_iframe = zitadel_client.models.v2_embedded_iframe_settings.v2EmbeddedIframeSettings( - enabled = True, - allowed_origins = ["foo.bar.com","localhost:8080"], ), - enable_impersonation = False, ) - ) - else: - return V2GetSecuritySettingsResponse( - ) - """ - - def testV2GetSecuritySettingsResponse(self): - """Test V2GetSecuritySettingsResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_get_session_response.py b/test/test_v2_get_session_response.py deleted file mode 100644 index fd3cde07..00000000 --- a/test/test_v2_get_session_response.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_get_session_response import V2GetSessionResponse - -class TestV2GetSessionResponse(unittest.TestCase): - """V2GetSessionResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2GetSessionResponse: - """Test V2GetSessionResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2GetSessionResponse` - """ - model = V2GetSessionResponse() - if include_optional: - return V2GetSessionResponse( - session = zitadel_client.models.v2_session_1.v2Session_1( - id = '', - creation_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - sequence = '', - factors = zitadel_client.models.v2_factors.v2Factors( - user = zitadel_client.models.v2_user_factor.v2UserFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - id = '', - login_name = '', - display_name = '', - organization_id = '', ), - password = zitadel_client.models.v2_password_factor.v2PasswordFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), - web_auth_n = zitadel_client.models.v2_web_auth_n_factor.v2WebAuthNFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - user_verified = True, ), - intent = zitadel_client.models.v2_intent_factor.v2IntentFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), - totp = zitadel_client.models.v2_totp_factor.v2TOTPFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), - otp_sms = zitadel_client.models.v2_otp_factor.v2OTPFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), - otp_email = zitadel_client.models.v2_otp_factor.v2OTPFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ), - metadata = { - 'key' : 'YQ==' - }, - user_agent = zitadel_client.models.v2_user_agent.v2UserAgent( - fingerprint_id = '', - ip = '', - description = '', - header = { - 'key' : zitadel_client.models.user_agent_header_values.UserAgentHeaderValues( - values = [ - '' - ], ) - }, ), - expiration_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) - ) - else: - return V2GetSessionResponse( - ) - """ - - def testV2GetSessionResponse(self): - """Test V2GetSessionResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_get_system_features_response.py b/test/test_v2_get_system_features_response.py deleted file mode 100644 index f00b524d..00000000 --- a/test/test_v2_get_system_features_response.py +++ /dev/null @@ -1,91 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_get_system_features_response import V2GetSystemFeaturesResponse - -class TestV2GetSystemFeaturesResponse(unittest.TestCase): - """V2GetSystemFeaturesResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2GetSystemFeaturesResponse: - """Test V2GetSystemFeaturesResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2GetSystemFeaturesResponse` - """ - model = V2GetSystemFeaturesResponse() - if include_optional: - return V2GetSystemFeaturesResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - login_default_org = zitadel_client.models.v2_feature_flag.v2FeatureFlag( - enabled = False, - source = 'SOURCE_UNSPECIFIED', ), - oidc_trigger_introspection_projections = zitadel_client.models.v2_feature_flag.v2FeatureFlag( - enabled = False, - source = 'SOURCE_UNSPECIFIED', ), - oidc_legacy_introspection = zitadel_client.models.v2_feature_flag.v2FeatureFlag( - enabled = False, - source = 'SOURCE_UNSPECIFIED', ), - user_schema = zitadel_client.models.v2_feature_flag.v2FeatureFlag( - enabled = False, - source = 'SOURCE_UNSPECIFIED', ), - oidc_token_exchange = zitadel_client.models.v2_feature_flag.v2FeatureFlag( - enabled = False, - source = 'SOURCE_UNSPECIFIED', ), - actions = zitadel_client.models.v2_feature_flag.v2FeatureFlag( - enabled = False, - source = 'SOURCE_UNSPECIFIED', ), - improved_performance = zitadel_client.models.v2_improved_performance_feature_flag.v2ImprovedPerformanceFeatureFlag( - execution_paths = [1], - source = 'SOURCE_UNSPECIFIED', ), - oidc_single_v1_session_termination = zitadel_client.models.v2_feature_flag.v2FeatureFlag( - enabled = False, - source = 'SOURCE_UNSPECIFIED', ), - disable_user_token_event = zitadel_client.models.v2_feature_flag.v2FeatureFlag( - enabled = False, - source = 'SOURCE_UNSPECIFIED', ), - enable_back_channel_logout = zitadel_client.models.v2_feature_flag.v2FeatureFlag( - enabled = False, - source = 'SOURCE_UNSPECIFIED', ), - login_v2 = zitadel_client.models.v2_login_v2_feature_flag.v2LoginV2FeatureFlag( - required = True, - base_uri = '', - source = 'SOURCE_UNSPECIFIED', ), - permission_check_v2 = zitadel_client.models.v2_feature_flag.v2FeatureFlag( - enabled = False, - source = 'SOURCE_UNSPECIFIED', ) - ) - else: - return V2GetSystemFeaturesResponse( - ) - """ - - def testV2GetSystemFeaturesResponse(self): - """Test V2GetSystemFeaturesResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_get_user_by_id_response.py b/test/test_v2_get_user_by_id_response.py deleted file mode 100644 index 7b22f096..00000000 --- a/test/test_v2_get_user_by_id_response.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_get_user_by_id_response import V2GetUserByIDResponse - -class TestV2GetUserByIDResponse(unittest.TestCase): - """V2GetUserByIDResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2GetUserByIDResponse: - """Test V2GetUserByIDResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2GetUserByIDResponse` - """ - model = V2GetUserByIDResponse() - if include_optional: - return V2GetUserByIDResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - user = zitadel_client.models.v2_user.v2User( - user_id = 'd654e6ba-70a3-48ef-a95d-37c8d8a7901a', - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - state = 'USER_STATE_UNSPECIFIED', - username = 'minnie-mouse', - login_names = ["gigi@zitadel.com","gigi@zitadel.zitadel.ch"], - preferred_login_name = 'gigi@zitadel.com', - human = zitadel_client.models.v2_human_user.v2HumanUser( - user_id = 'd654e6ba-70a3-48ef-a95d-37c8d8a7901a', - username = 'minnie-mouse', - login_names = ["gigi@zitadel.com","gigi@zitadel.zitadel.ch"], - preferred_login_name = 'gigi@zitadel.com', - profile = zitadel_client.models.v2_human_profile.v2HumanProfile( - given_name = 'Minnie', - family_name = 'Mouse', - nick_name = 'Mini', - display_name = 'Minnie Mouse', - preferred_language = 'en', - gender = 'GENDER_UNSPECIFIED', - avatar_url = 'https://api.zitadel.ch/assets/v1/avatar-32432jkh4kj32', ), - email = zitadel_client.models.v2_human_email.v2HumanEmail( - is_verified = True, ), - phone = zitadel_client.models.v2_human_phone.v2HumanPhone( - is_verified = True, ), - password_change_required = True, - password_changed = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - mfa_init_skipped = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), - machine = zitadel_client.models.v2_machine_user.v2MachineUser( - name = 'zitadel', - description = 'The one and only IAM', - has_secret = True, - access_token_type = 'ACCESS_TOKEN_TYPE_BEARER', ), ) - ) - else: - return V2GetUserByIDResponse( - ) - """ - - def testV2GetUserByIDResponse(self): - """Test V2GetUserByIDResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_get_user_features_response.py b/test/test_v2_get_user_features_response.py deleted file mode 100644 index 3b531d1d..00000000 --- a/test/test_v2_get_user_features_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_get_user_features_response import V2GetUserFeaturesResponse - -class TestV2GetUserFeaturesResponse(unittest.TestCase): - """V2GetUserFeaturesResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2GetUserFeaturesResponse: - """Test V2GetUserFeaturesResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2GetUserFeaturesResponse` - """ - model = V2GetUserFeaturesResponse() - if include_optional: - return V2GetUserFeaturesResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2GetUserFeaturesResponse( - ) - """ - - def testV2GetUserFeaturesResponse(self): - """Test V2GetUserFeaturesResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_git_hub_config.py b/test/test_v2_git_hub_config.py deleted file mode 100644 index 015a357f..00000000 --- a/test/test_v2_git_hub_config.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_git_hub_config import V2GitHubConfig - -class TestV2GitHubConfig(unittest.TestCase): - """V2GitHubConfig unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2GitHubConfig: - """Test V2GitHubConfig - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2GitHubConfig` - """ - model = V2GitHubConfig() - if include_optional: - return V2GitHubConfig( - client_id = 'client-id', - scopes = ["openid","profile","email"] - ) - else: - return V2GitHubConfig( - ) - """ - - def testV2GitHubConfig(self): - """Test V2GitHubConfig""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_git_hub_enterprise_server_config.py b/test/test_v2_git_hub_enterprise_server_config.py deleted file mode 100644 index e4c51ef1..00000000 --- a/test/test_v2_git_hub_enterprise_server_config.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_git_hub_enterprise_server_config import V2GitHubEnterpriseServerConfig - -class TestV2GitHubEnterpriseServerConfig(unittest.TestCase): - """V2GitHubEnterpriseServerConfig unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2GitHubEnterpriseServerConfig: - """Test V2GitHubEnterpriseServerConfig - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2GitHubEnterpriseServerConfig` - """ - model = V2GitHubEnterpriseServerConfig() - if include_optional: - return V2GitHubEnterpriseServerConfig( - client_id = 'client-id', - authorization_endpoint = '', - token_endpoint = '', - user_endpoint = '', - scopes = ["openid","profile","email"] - ) - else: - return V2GitHubEnterpriseServerConfig( - ) - """ - - def testV2GitHubEnterpriseServerConfig(self): - """Test V2GitHubEnterpriseServerConfig""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_git_lab_config.py b/test/test_v2_git_lab_config.py deleted file mode 100644 index 5a98723a..00000000 --- a/test/test_v2_git_lab_config.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_git_lab_config import V2GitLabConfig - -class TestV2GitLabConfig(unittest.TestCase): - """V2GitLabConfig unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2GitLabConfig: - """Test V2GitLabConfig - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2GitLabConfig` - """ - model = V2GitLabConfig() - if include_optional: - return V2GitLabConfig( - client_id = 'client-id', - scopes = ["openid","profile","email"] - ) - else: - return V2GitLabConfig( - ) - """ - - def testV2GitLabConfig(self): - """Test V2GitLabConfig""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_git_lab_self_hosted_config.py b/test/test_v2_git_lab_self_hosted_config.py deleted file mode 100644 index 07be8a8d..00000000 --- a/test/test_v2_git_lab_self_hosted_config.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_git_lab_self_hosted_config import V2GitLabSelfHostedConfig - -class TestV2GitLabSelfHostedConfig(unittest.TestCase): - """V2GitLabSelfHostedConfig unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2GitLabSelfHostedConfig: - """Test V2GitLabSelfHostedConfig - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2GitLabSelfHostedConfig` - """ - model = V2GitLabSelfHostedConfig() - if include_optional: - return V2GitLabSelfHostedConfig( - issuer = '', - client_id = 'client-id', - scopes = ["openid","profile","email"] - ) - else: - return V2GitLabSelfHostedConfig( - ) - """ - - def testV2GitLabSelfHostedConfig(self): - """Test V2GitLabSelfHostedConfig""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_google_config.py b/test/test_v2_google_config.py deleted file mode 100644 index 87389ca5..00000000 --- a/test/test_v2_google_config.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_google_config import V2GoogleConfig - -class TestV2GoogleConfig(unittest.TestCase): - """V2GoogleConfig unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2GoogleConfig: - """Test V2GoogleConfig - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2GoogleConfig` - """ - model = V2GoogleConfig() - if include_optional: - return V2GoogleConfig( - client_id = 'client-id', - scopes = ["openid","profile","email"] - ) - else: - return V2GoogleConfig( - ) - """ - - def testV2GoogleConfig(self): - """Test V2GoogleConfig""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_hashed_password.py b/test/test_v2_hashed_password.py deleted file mode 100644 index 0c53a9db..00000000 --- a/test/test_v2_hashed_password.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_hashed_password import V2HashedPassword - -class TestV2HashedPassword(unittest.TestCase): - """V2HashedPassword unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2HashedPassword: - """Test V2HashedPassword - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2HashedPassword` - """ - model = V2HashedPassword() - if include_optional: - return V2HashedPassword( - hash = '$2a$12$lJ08fqVr8bFJilRVnDT9QeULI7YW.nT3iwUv6dyg0aCrfm3UY8XR2', - change_required = True - ) - else: - return V2HashedPassword( - hash = '$2a$12$lJ08fqVr8bFJilRVnDT9QeULI7YW.nT3iwUv6dyg0aCrfm3UY8XR2', - ) - """ - - def testV2HashedPassword(self): - """Test V2HashedPassword""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_human_email.py b/test/test_v2_human_email.py deleted file mode 100644 index ee30a675..00000000 --- a/test/test_v2_human_email.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_human_email import V2HumanEmail - -class TestV2HumanEmail(unittest.TestCase): - """V2HumanEmail unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2HumanEmail: - """Test V2HumanEmail - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2HumanEmail` - """ - model = V2HumanEmail() - if include_optional: - return V2HumanEmail( - email = 'mini@mouse.com', - is_verified = True - ) - else: - return V2HumanEmail( - ) - """ - - def testV2HumanEmail(self): - """Test V2HumanEmail""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_human_mfa_init_skipped_response.py b/test/test_v2_human_mfa_init_skipped_response.py deleted file mode 100644 index 4fd49ab0..00000000 --- a/test/test_v2_human_mfa_init_skipped_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_human_mfa_init_skipped_response import V2HumanMFAInitSkippedResponse - -class TestV2HumanMFAInitSkippedResponse(unittest.TestCase): - """V2HumanMFAInitSkippedResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2HumanMFAInitSkippedResponse: - """Test V2HumanMFAInitSkippedResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2HumanMFAInitSkippedResponse` - """ - model = V2HumanMFAInitSkippedResponse() - if include_optional: - return V2HumanMFAInitSkippedResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2HumanMFAInitSkippedResponse( - ) - """ - - def testV2HumanMFAInitSkippedResponse(self): - """Test V2HumanMFAInitSkippedResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_human_phone.py b/test/test_v2_human_phone.py deleted file mode 100644 index 2c66d85f..00000000 --- a/test/test_v2_human_phone.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_human_phone import V2HumanPhone - -class TestV2HumanPhone(unittest.TestCase): - """V2HumanPhone unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2HumanPhone: - """Test V2HumanPhone - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2HumanPhone` - """ - model = V2HumanPhone() - if include_optional: - return V2HumanPhone( - phone = '+41791234567', - is_verified = True - ) - else: - return V2HumanPhone( - ) - """ - - def testV2HumanPhone(self): - """Test V2HumanPhone""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_human_profile.py b/test/test_v2_human_profile.py deleted file mode 100644 index 98259eee..00000000 --- a/test/test_v2_human_profile.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_human_profile import V2HumanProfile - -class TestV2HumanProfile(unittest.TestCase): - """V2HumanProfile unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2HumanProfile: - """Test V2HumanProfile - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2HumanProfile` - """ - model = V2HumanProfile() - if include_optional: - return V2HumanProfile( - given_name = 'Minnie', - family_name = 'Mouse', - nick_name = 'Mini', - display_name = 'Minnie Mouse', - preferred_language = 'en', - gender = 'GENDER_UNSPECIFIED', - avatar_url = 'https://api.zitadel.ch/assets/v1/avatar-32432jkh4kj32' - ) - else: - return V2HumanProfile( - ) - """ - - def testV2HumanProfile(self): - """Test V2HumanProfile""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_human_user.py b/test/test_v2_human_user.py deleted file mode 100644 index 73a4b2fa..00000000 --- a/test/test_v2_human_user.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_human_user import V2HumanUser - -class TestV2HumanUser(unittest.TestCase): - """V2HumanUser unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2HumanUser: - """Test V2HumanUser - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2HumanUser` - """ - model = V2HumanUser() - if include_optional: - return V2HumanUser( - user_id = 'd654e6ba-70a3-48ef-a95d-37c8d8a7901a', - state = 'USER_STATE_UNSPECIFIED', - username = 'minnie-mouse', - login_names = ["gigi@zitadel.com","gigi@zitadel.zitadel.ch"], - preferred_login_name = 'gigi@zitadel.com', - profile = zitadel_client.models.v2_human_profile.v2HumanProfile( - given_name = 'Minnie', - family_name = 'Mouse', - nick_name = 'Mini', - display_name = 'Minnie Mouse', - preferred_language = 'en', - gender = 'GENDER_UNSPECIFIED', - avatar_url = 'https://api.zitadel.ch/assets/v1/avatar-32432jkh4kj32', ), - email = zitadel_client.models.v2_human_email.v2HumanEmail( - is_verified = True, ), - phone = zitadel_client.models.v2_human_phone.v2HumanPhone( - is_verified = True, ), - password_change_required = True, - password_changed = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - mfa_init_skipped = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') - ) - else: - return V2HumanUser( - ) - """ - - def testV2HumanUser(self): - """Test V2HumanUser""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_identity_provider.py b/test/test_v2_identity_provider.py deleted file mode 100644 index 7aad6b5b..00000000 --- a/test/test_v2_identity_provider.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_identity_provider import V2IdentityProvider - -class TestV2IdentityProvider(unittest.TestCase): - """V2IdentityProvider unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2IdentityProvider: - """Test V2IdentityProvider - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2IdentityProvider` - """ - model = V2IdentityProvider() - if include_optional: - return V2IdentityProvider( - id = '', - name = '', - type = 'IDENTITY_PROVIDER_TYPE_UNSPECIFIED', - options = zitadel_client.models.zitadelidpv2_options_1.zitadelidpv2Options_1( - is_linking_allowed = True, - is_creation_allowed = True, - is_auto_creation = True, - is_auto_update = True, - auto_linking = 'AUTO_LINKING_OPTION_UNSPECIFIED', ) - ) - else: - return V2IdentityProvider( - ) - """ - - def testV2IdentityProvider(self): - """Test V2IdentityProvider""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_identity_provider_type.py b/test/test_v2_identity_provider_type.py deleted file mode 100644 index 3cacab89..00000000 --- a/test/test_v2_identity_provider_type.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_identity_provider_type import V2IdentityProviderType - -class TestV2IdentityProviderType(unittest.TestCase): - """V2IdentityProviderType unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2IdentityProviderType(self): - """Test V2IdentityProviderType""" - # inst = V2IdentityProviderType() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_idp.py b/test/test_v2_idp.py deleted file mode 100644 index be00b5e1..00000000 --- a/test/test_v2_idp.py +++ /dev/null @@ -1,148 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_idp import V2IDP - -class TestV2IDP(unittest.TestCase): - """V2IDP unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2IDP: - """Test V2IDP - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2IDP` - """ - model = V2IDP() - if include_optional: - return V2IDP( - id = '69629023906488334', - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - state = 'IDP_STATE_UNSPECIFIED', - name = 'Google', - type = 'IDP_TYPE_UNSPECIFIED', - config = zitadel_client.models.v2_idp_config.v2IDPConfig( - options = zitadel_client.models.zitadelidpv2_options.zitadelidpv2Options( - is_linking_allowed = True, - is_creation_allowed = True, - is_auto_creation = True, - is_auto_update = True, - auto_linking = 'AUTO_LINKING_OPTION_UNSPECIFIED', ), - ldap = zitadel_client.models.v2_ldap_config.v2LDAPConfig( - servers = [ - '' - ], - start_tls = True, - base_dn = '', - bind_dn = '', - user_base = '', - user_object_classes = [ - '' - ], - user_filters = [ - '' - ], - timeout = '', - attributes = zitadel_client.models.v2_ldap_attributes.v2LDAPAttributes( - id_attribute = '', - first_name_attribute = '', - last_name_attribute = '', - display_name_attribute = '', - nick_name_attribute = '', - preferred_username_attribute = '', - email_attribute = '', - email_verified_attribute = '', - phone_attribute = '', - phone_verified_attribute = '', - preferred_language_attribute = '', - avatar_url_attribute = '', - profile_attribute = '', ), ), - google = zitadel_client.models.v2_google_config.v2GoogleConfig( - client_id = 'client-id', - scopes = ["openid","profile","email"], ), - oauth = zitadel_client.models.v2_o_auth_config.v2OAuthConfig( - client_id = 'client-id', - authorization_endpoint = 'https://accounts.google.com/o/oauth2/v2/auth', - token_endpoint = 'https://oauth2.googleapis.com/token', - user_endpoint = 'https://openidconnect.googleapis.com/v1/userinfo', - scopes = ["openid","profile","email"], - id_attribute = 'user_id', ), - oidc = zitadel_client.models.v2_generic_oidc_config.v2GenericOIDCConfig( - issuer = 'https://accounts.google.com/', - client_id = 'client-id', - scopes = ["openid","profile","email"], - is_id_token_mapping = True, ), - jwt = zitadel_client.models.v2_jwt_config.v2JWTConfig( - jwt_endpoint = 'https://accounts.google.com', - issuer = 'https://accounts.google.com', - keys_endpoint = 'https://accounts.google.com/keys', - header_name = 'x-auth-token', ), - github = zitadel_client.models.v2_git_hub_config.v2GitHubConfig( - client_id = 'client-id', - scopes = ["openid","profile","email"], ), - github_es = zitadel_client.models.v2_git_hub_enterprise_server_config.v2GitHubEnterpriseServerConfig( - client_id = 'client-id', - authorization_endpoint = '', - token_endpoint = '', - user_endpoint = '', - scopes = ["openid","profile","email"], ), - gitlab = zitadel_client.models.v2_git_lab_config.v2GitLabConfig( - client_id = 'client-id', - scopes = ["openid","profile","email"], ), - gitlab_self_hosted = zitadel_client.models.v2_git_lab_self_hosted_config.v2GitLabSelfHostedConfig( - issuer = '', - client_id = 'client-id', - scopes = ["openid","profile","email"], ), - azure_ad = zitadel_client.models.v2_azure_ad_config.v2AzureADConfig( - client_id = 'client-id', - tenant = zitadel_client.models.v2_azure_ad_tenant.v2AzureADTenant( - tenant_type = 'AZURE_AD_TENANT_TYPE_COMMON', - tenant_id = '', ), - email_verified = True, - scopes = ["openid","profile","email","User.Read"], ), - apple = zitadel_client.models.v2_apple_config.v2AppleConfig( - client_id = 'com.client.id', - team_id = 'ALT03JV3OS', - key_id = 'OGKDK25KD', - scopes = ["name","email"], ), - saml = zitadel_client.models.v2_saml_config.v2SAMLConfig( - metadata_xml = 'YQ==', - binding = 'SAML_BINDING_UNSPECIFIED', - with_signed_request = True, - name_id_format = 'SAML_NAME_ID_FORMAT_UNSPECIFIED', - transient_mapping_attribute_name = '', ), ) - ) - else: - return V2IDP( - ) - """ - - def testV2IDP(self): - """Test V2IDP""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_idp_config.py b/test/test_v2_idp_config.py deleted file mode 100644 index 8dd162fa..00000000 --- a/test/test_v2_idp_config.py +++ /dev/null @@ -1,139 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_idp_config import V2IDPConfig - -class TestV2IDPConfig(unittest.TestCase): - """V2IDPConfig unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2IDPConfig: - """Test V2IDPConfig - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2IDPConfig` - """ - model = V2IDPConfig() - if include_optional: - return V2IDPConfig( - options = zitadel_client.models.zitadelidpv2_options.zitadelidpv2Options( - is_linking_allowed = True, - is_creation_allowed = True, - is_auto_creation = True, - is_auto_update = True, - auto_linking = 'AUTO_LINKING_OPTION_UNSPECIFIED', ), - ldap = zitadel_client.models.v2_ldap_config.v2LDAPConfig( - servers = [ - '' - ], - start_tls = True, - base_dn = '', - bind_dn = '', - user_base = '', - user_object_classes = [ - '' - ], - user_filters = [ - '' - ], - timeout = '', - attributes = zitadel_client.models.v2_ldap_attributes.v2LDAPAttributes( - id_attribute = '', - first_name_attribute = '', - last_name_attribute = '', - display_name_attribute = '', - nick_name_attribute = '', - preferred_username_attribute = '', - email_attribute = '', - email_verified_attribute = '', - phone_attribute = '', - phone_verified_attribute = '', - preferred_language_attribute = '', - avatar_url_attribute = '', - profile_attribute = '', ), ), - google = zitadel_client.models.v2_google_config.v2GoogleConfig( - client_id = 'client-id', - scopes = ["openid","profile","email"], ), - oauth = zitadel_client.models.v2_o_auth_config.v2OAuthConfig( - client_id = 'client-id', - authorization_endpoint = 'https://accounts.google.com/o/oauth2/v2/auth', - token_endpoint = 'https://oauth2.googleapis.com/token', - user_endpoint = 'https://openidconnect.googleapis.com/v1/userinfo', - scopes = ["openid","profile","email"], - id_attribute = 'user_id', ), - oidc = zitadel_client.models.v2_generic_oidc_config.v2GenericOIDCConfig( - issuer = 'https://accounts.google.com/', - client_id = 'client-id', - scopes = ["openid","profile","email"], - is_id_token_mapping = True, ), - jwt = zitadel_client.models.v2_jwt_config.v2JWTConfig( - jwt_endpoint = 'https://accounts.google.com', - issuer = 'https://accounts.google.com', - keys_endpoint = 'https://accounts.google.com/keys', - header_name = 'x-auth-token', ), - github = zitadel_client.models.v2_git_hub_config.v2GitHubConfig( - client_id = 'client-id', - scopes = ["openid","profile","email"], ), - github_es = zitadel_client.models.v2_git_hub_enterprise_server_config.v2GitHubEnterpriseServerConfig( - client_id = 'client-id', - authorization_endpoint = '', - token_endpoint = '', - user_endpoint = '', - scopes = ["openid","profile","email"], ), - gitlab = zitadel_client.models.v2_git_lab_config.v2GitLabConfig( - client_id = 'client-id', - scopes = ["openid","profile","email"], ), - gitlab_self_hosted = zitadel_client.models.v2_git_lab_self_hosted_config.v2GitLabSelfHostedConfig( - issuer = '', - client_id = 'client-id', - scopes = ["openid","profile","email"], ), - azure_ad = zitadel_client.models.v2_azure_ad_config.v2AzureADConfig( - client_id = 'client-id', - tenant = zitadel_client.models.v2_azure_ad_tenant.v2AzureADTenant( - tenant_type = 'AZURE_AD_TENANT_TYPE_COMMON', - tenant_id = '', ), - email_verified = True, - scopes = ["openid","profile","email","User.Read"], ), - apple = zitadel_client.models.v2_apple_config.v2AppleConfig( - client_id = 'com.client.id', - team_id = 'ALT03JV3OS', - key_id = 'OGKDK25KD', - scopes = ["name","email"], ), - saml = zitadel_client.models.v2_saml_config.v2SAMLConfig( - metadata_xml = 'YQ==', - binding = 'SAML_BINDING_UNSPECIFIED', - with_signed_request = True, - name_id_format = 'SAML_NAME_ID_FORMAT_UNSPECIFIED', - transient_mapping_attribute_name = '', ) - ) - else: - return V2IDPConfig( - ) - """ - - def testV2IDPConfig(self): - """Test V2IDPConfig""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_idp_information.py b/test/test_v2_idp_information.py deleted file mode 100644 index c5d5680e..00000000 --- a/test/test_v2_idp_information.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_idp_information import V2IDPInformation - -class TestV2IDPInformation(unittest.TestCase): - """V2IDPInformation unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2IDPInformation: - """Test V2IDPInformation - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2IDPInformation` - """ - model = V2IDPInformation() - if include_optional: - return V2IDPInformation( - oauth = zitadel_client.models.v2_idpo_auth_access_information.v2IDPOAuthAccessInformation( - access_token = '', - id_token = '', ), - ldap = zitadel_client.models.v2_idpldap_access_information.v2IDPLDAPAccessInformation( - attributes = zitadel_client.models.attributes.attributes(), ), - saml = zitadel_client.models.v2_idpsaml_access_information.v2IDPSAMLAccessInformation( - assertion = 'YQ==', ), - idp_id = 'd654e6ba-70a3-48ef-a95d-37c8d8a7901a', - user_id = '6516849804890468048461403518', - user_name = 'user@external.com', - raw_information = zitadel_client.models.raw_information.rawInformation() - ) - else: - return V2IDPInformation( - ) - """ - - def testV2IDPInformation(self): - """Test V2IDPInformation""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_idp_intent.py b/test/test_v2_idp_intent.py deleted file mode 100644 index 883d5d10..00000000 --- a/test/test_v2_idp_intent.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_idp_intent import V2IDPIntent - -class TestV2IDPIntent(unittest.TestCase): - """V2IDPIntent unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2IDPIntent: - """Test V2IDPIntent - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2IDPIntent` - """ - model = V2IDPIntent() - if include_optional: - return V2IDPIntent( - idp_intent_id = '163840776835432705', - idp_intent_token = 'SJKL3ioIDpo342ioqw98fjp3sdf32wahb=', - user_id = '163840776835432345' - ) - else: - return V2IDPIntent( - ) - """ - - def testV2IDPIntent(self): - """Test V2IDPIntent""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_idp_link.py b/test/test_v2_idp_link.py deleted file mode 100644 index 816359d2..00000000 --- a/test/test_v2_idp_link.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_idp_link import V2IDPLink - -class TestV2IDPLink(unittest.TestCase): - """V2IDPLink unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2IDPLink: - """Test V2IDPLink - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2IDPLink` - """ - model = V2IDPLink() - if include_optional: - return V2IDPLink( - idp_id = 'd654e6ba-70a3-48ef-a95d-37c8d8a7901a', - user_id = '6516849804890468048461403518', - user_name = 'user@external.com' - ) - else: - return V2IDPLink( - ) - """ - - def testV2IDPLink(self): - """Test V2IDPLink""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_idp_state.py b/test/test_v2_idp_state.py deleted file mode 100644 index 46e37abd..00000000 --- a/test/test_v2_idp_state.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_idp_state import V2IDPState - -class TestV2IDPState(unittest.TestCase): - """V2IDPState unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2IDPState(self): - """Test V2IDPState""" - # inst = V2IDPState() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_idp_type.py b/test/test_v2_idp_type.py deleted file mode 100644 index 8bed12c2..00000000 --- a/test/test_v2_idp_type.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_idp_type import V2IDPType - -class TestV2IDPType(unittest.TestCase): - """V2IDPType unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2IDPType(self): - """Test V2IDPType""" - # inst = V2IDPType() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_idpldap_access_information.py b/test/test_v2_idpldap_access_information.py deleted file mode 100644 index 8ba0c062..00000000 --- a/test/test_v2_idpldap_access_information.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_idpldap_access_information import V2IDPLDAPAccessInformation - -class TestV2IDPLDAPAccessInformation(unittest.TestCase): - """V2IDPLDAPAccessInformation unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2IDPLDAPAccessInformation: - """Test V2IDPLDAPAccessInformation - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2IDPLDAPAccessInformation` - """ - model = V2IDPLDAPAccessInformation() - if include_optional: - return V2IDPLDAPAccessInformation( - attributes = zitadel_client.models.attributes.attributes() - ) - else: - return V2IDPLDAPAccessInformation( - ) - """ - - def testV2IDPLDAPAccessInformation(self): - """Test V2IDPLDAPAccessInformation""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_idpo_auth_access_information.py b/test/test_v2_idpo_auth_access_information.py deleted file mode 100644 index e9146c29..00000000 --- a/test/test_v2_idpo_auth_access_information.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_idpo_auth_access_information import V2IDPOAuthAccessInformation - -class TestV2IDPOAuthAccessInformation(unittest.TestCase): - """V2IDPOAuthAccessInformation unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2IDPOAuthAccessInformation: - """Test V2IDPOAuthAccessInformation - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2IDPOAuthAccessInformation` - """ - model = V2IDPOAuthAccessInformation() - if include_optional: - return V2IDPOAuthAccessInformation( - access_token = '', - id_token = '' - ) - else: - return V2IDPOAuthAccessInformation( - ) - """ - - def testV2IDPOAuthAccessInformation(self): - """Test V2IDPOAuthAccessInformation""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_idpsaml_access_information.py b/test/test_v2_idpsaml_access_information.py deleted file mode 100644 index 8e7b9bb5..00000000 --- a/test/test_v2_idpsaml_access_information.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_idpsaml_access_information import V2IDPSAMLAccessInformation - -class TestV2IDPSAMLAccessInformation(unittest.TestCase): - """V2IDPSAMLAccessInformation unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2IDPSAMLAccessInformation: - """Test V2IDPSAMLAccessInformation - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2IDPSAMLAccessInformation` - """ - model = V2IDPSAMLAccessInformation() - if include_optional: - return V2IDPSAMLAccessInformation( - assertion = 'YQ==' - ) - else: - return V2IDPSAMLAccessInformation( - ) - """ - - def testV2IDPSAMLAccessInformation(self): - """Test V2IDPSAMLAccessInformation""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_ids_query.py b/test/test_v2_ids_query.py deleted file mode 100644 index ca033606..00000000 --- a/test/test_v2_ids_query.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_ids_query import V2IDsQuery - -class TestV2IDsQuery(unittest.TestCase): - """V2IDsQuery unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2IDsQuery: - """Test V2IDsQuery - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2IDsQuery` - """ - model = V2IDsQuery() - if include_optional: - return V2IDsQuery( - ids = [ - '' - ] - ) - else: - return V2IDsQuery( - ) - """ - - def testV2IDsQuery(self): - """Test V2IDsQuery""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_improved_performance.py b/test/test_v2_improved_performance.py deleted file mode 100644 index ec04c9a0..00000000 --- a/test/test_v2_improved_performance.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_improved_performance import V2ImprovedPerformance - -class TestV2ImprovedPerformance(unittest.TestCase): - """V2ImprovedPerformance unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2ImprovedPerformance(self): - """Test V2ImprovedPerformance""" - # inst = V2ImprovedPerformance() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_improved_performance_feature_flag.py b/test/test_v2_improved_performance_feature_flag.py deleted file mode 100644 index d01fc2c5..00000000 --- a/test/test_v2_improved_performance_feature_flag.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_improved_performance_feature_flag import V2ImprovedPerformanceFeatureFlag - -class TestV2ImprovedPerformanceFeatureFlag(unittest.TestCase): - """V2ImprovedPerformanceFeatureFlag unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2ImprovedPerformanceFeatureFlag: - """Test V2ImprovedPerformanceFeatureFlag - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2ImprovedPerformanceFeatureFlag` - """ - model = V2ImprovedPerformanceFeatureFlag() - if include_optional: - return V2ImprovedPerformanceFeatureFlag( - execution_paths = [1], - source = 'SOURCE_UNSPECIFIED' - ) - else: - return V2ImprovedPerformanceFeatureFlag( - ) - """ - - def testV2ImprovedPerformanceFeatureFlag(self): - """Test V2ImprovedPerformanceFeatureFlag""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_in_user_emails_query.py b/test/test_v2_in_user_emails_query.py deleted file mode 100644 index 0c23bae6..00000000 --- a/test/test_v2_in_user_emails_query.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_in_user_emails_query import V2InUserEmailsQuery - -class TestV2InUserEmailsQuery(unittest.TestCase): - """V2InUserEmailsQuery unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2InUserEmailsQuery: - """Test V2InUserEmailsQuery - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2InUserEmailsQuery` - """ - model = V2InUserEmailsQuery() - if include_optional: - return V2InUserEmailsQuery( - user_emails = ["test@example.com","test@example.org"] - ) - else: - return V2InUserEmailsQuery( - ) - """ - - def testV2InUserEmailsQuery(self): - """Test V2InUserEmailsQuery""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_in_user_id_query.py b/test/test_v2_in_user_id_query.py deleted file mode 100644 index cefc8e4a..00000000 --- a/test/test_v2_in_user_id_query.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_in_user_id_query import V2InUserIDQuery - -class TestV2InUserIDQuery(unittest.TestCase): - """V2InUserIDQuery unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2InUserIDQuery: - """Test V2InUserIDQuery - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2InUserIDQuery` - """ - model = V2InUserIDQuery() - if include_optional: - return V2InUserIDQuery( - user_ids = ["69629023906488334","69622366012355662"] - ) - else: - return V2InUserIDQuery( - ) - """ - - def testV2InUserIDQuery(self): - """Test V2InUserIDQuery""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_intent_factor.py b/test/test_v2_intent_factor.py deleted file mode 100644 index d0505088..00000000 --- a/test/test_v2_intent_factor.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_intent_factor import V2IntentFactor - -class TestV2IntentFactor(unittest.TestCase): - """V2IntentFactor unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2IntentFactor: - """Test V2IntentFactor - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2IntentFactor` - """ - model = V2IntentFactor() - if include_optional: - return V2IntentFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') - ) - else: - return V2IntentFactor( - ) - """ - - def testV2IntentFactor(self): - """Test V2IntentFactor""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_jwt_config.py b/test/test_v2_jwt_config.py deleted file mode 100644 index 5b8042dc..00000000 --- a/test/test_v2_jwt_config.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_jwt_config import V2JWTConfig - -class TestV2JWTConfig(unittest.TestCase): - """V2JWTConfig unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2JWTConfig: - """Test V2JWTConfig - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2JWTConfig` - """ - model = V2JWTConfig() - if include_optional: - return V2JWTConfig( - jwt_endpoint = 'https://accounts.google.com', - issuer = 'https://accounts.google.com', - keys_endpoint = 'https://accounts.google.com/keys', - header_name = 'x-auth-token' - ) - else: - return V2JWTConfig( - ) - """ - - def testV2JWTConfig(self): - """Test V2JWTConfig""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_last_name_query.py b/test/test_v2_last_name_query.py deleted file mode 100644 index 436041ae..00000000 --- a/test/test_v2_last_name_query.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_last_name_query import V2LastNameQuery - -class TestV2LastNameQuery(unittest.TestCase): - """V2LastNameQuery unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2LastNameQuery: - """Test V2LastNameQuery - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2LastNameQuery` - """ - model = V2LastNameQuery() - if include_optional: - return V2LastNameQuery( - last_name = 'Giraffe', - method = 'TEXT_QUERY_METHOD_EQUALS' - ) - else: - return V2LastNameQuery( - last_name = 'Giraffe', - ) - """ - - def testV2LastNameQuery(self): - """Test V2LastNameQuery""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_ldap_attributes.py b/test/test_v2_ldap_attributes.py deleted file mode 100644 index b049fe00..00000000 --- a/test/test_v2_ldap_attributes.py +++ /dev/null @@ -1,63 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_ldap_attributes import V2LDAPAttributes - -class TestV2LDAPAttributes(unittest.TestCase): - """V2LDAPAttributes unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2LDAPAttributes: - """Test V2LDAPAttributes - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2LDAPAttributes` - """ - model = V2LDAPAttributes() - if include_optional: - return V2LDAPAttributes( - id_attribute = '', - first_name_attribute = '', - last_name_attribute = '', - display_name_attribute = '', - nick_name_attribute = '', - preferred_username_attribute = '', - email_attribute = '', - email_verified_attribute = '', - phone_attribute = '', - phone_verified_attribute = '', - preferred_language_attribute = '', - avatar_url_attribute = '', - profile_attribute = '' - ) - else: - return V2LDAPAttributes( - ) - """ - - def testV2LDAPAttributes(self): - """Test V2LDAPAttributes""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_ldap_config.py b/test/test_v2_ldap_config.py deleted file mode 100644 index 1313f02e..00000000 --- a/test/test_v2_ldap_config.py +++ /dev/null @@ -1,78 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_ldap_config import V2LDAPConfig - -class TestV2LDAPConfig(unittest.TestCase): - """V2LDAPConfig unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2LDAPConfig: - """Test V2LDAPConfig - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2LDAPConfig` - """ - model = V2LDAPConfig() - if include_optional: - return V2LDAPConfig( - servers = [ - '' - ], - start_tls = True, - base_dn = '', - bind_dn = '', - user_base = '', - user_object_classes = [ - '' - ], - user_filters = [ - '' - ], - timeout = '', - attributes = zitadel_client.models.v2_ldap_attributes.v2LDAPAttributes( - id_attribute = '', - first_name_attribute = '', - last_name_attribute = '', - display_name_attribute = '', - nick_name_attribute = '', - preferred_username_attribute = '', - email_attribute = '', - email_verified_attribute = '', - phone_attribute = '', - phone_verified_attribute = '', - preferred_language_attribute = '', - avatar_url_attribute = '', - profile_attribute = '', ) - ) - else: - return V2LDAPConfig( - ) - """ - - def testV2LDAPConfig(self): - """Test V2LDAPConfig""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_ldap_credentials.py b/test/test_v2_ldap_credentials.py deleted file mode 100644 index 76d2ab10..00000000 --- a/test/test_v2_ldap_credentials.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_ldap_credentials import V2LDAPCredentials - -class TestV2LDAPCredentials(unittest.TestCase): - """V2LDAPCredentials unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2LDAPCredentials: - """Test V2LDAPCredentials - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2LDAPCredentials` - """ - model = V2LDAPCredentials() - if include_optional: - return V2LDAPCredentials( - username = 'username', - password = 'Password1!' - ) - else: - return V2LDAPCredentials( - ) - """ - - def testV2LDAPCredentials(self): - """Test V2LDAPCredentials""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_legal_and_support_settings.py b/test/test_v2_legal_and_support_settings.py deleted file mode 100644 index ff121e08..00000000 --- a/test/test_v2_legal_and_support_settings.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_legal_and_support_settings import V2LegalAndSupportSettings - -class TestV2LegalAndSupportSettings(unittest.TestCase): - """V2LegalAndSupportSettings unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2LegalAndSupportSettings: - """Test V2LegalAndSupportSettings - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2LegalAndSupportSettings` - """ - model = V2LegalAndSupportSettings() - if include_optional: - return V2LegalAndSupportSettings( - tos_link = 'https://zitadel.com/docs/legal/terms-of-service', - privacy_policy_link = 'https://zitadel.com/docs/legal/privacy-policy', - help_link = 'https://zitadel.com/docs/manuals/introduction', - support_email = 'support-email@test.com', - resource_owner_type = 'RESOURCE_OWNER_TYPE_UNSPECIFIED', - docs_link = 'https://zitadel.com/docs', - custom_link = 'https://external.link', - custom_link_text = 'External' - ) - else: - return V2LegalAndSupportSettings( - ) - """ - - def testV2LegalAndSupportSettings(self): - """Test V2LegalAndSupportSettings""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_list_authentication_factors_response.py b/test/test_v2_list_authentication_factors_response.py deleted file mode 100644 index 2d283298..00000000 --- a/test/test_v2_list_authentication_factors_response.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_list_authentication_factors_response import V2ListAuthenticationFactorsResponse - -class TestV2ListAuthenticationFactorsResponse(unittest.TestCase): - """V2ListAuthenticationFactorsResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2ListAuthenticationFactorsResponse: - """Test V2ListAuthenticationFactorsResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2ListAuthenticationFactorsResponse` - """ - model = V2ListAuthenticationFactorsResponse() - if include_optional: - return V2ListAuthenticationFactorsResponse( - result = [ - zitadel_client.models.v2_auth_factor.v2AuthFactor( - state = 'AUTH_FACTOR_STATE_UNSPECIFIED', - otp = zitadel_client.models.v2_auth_factor_otp.v2AuthFactorOTP(), - u2f = zitadel_client.models.v2_auth_factor_u2_f.v2AuthFactorU2F( - id = '69629023906488334', - name = 'fido key', ), - otp_sms = zitadel_client.models.v2_auth_factor_otpsms.v2AuthFactorOTPSMS(), - otp_email = zitadel_client.models.v2_auth_factor_otp_email.v2AuthFactorOTPEmail(), ) - ] - ) - else: - return V2ListAuthenticationFactorsResponse( - ) - """ - - def testV2ListAuthenticationFactorsResponse(self): - """Test V2ListAuthenticationFactorsResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_list_authentication_method_types_response.py b/test/test_v2_list_authentication_method_types_response.py deleted file mode 100644 index 7c041546..00000000 --- a/test/test_v2_list_authentication_method_types_response.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_list_authentication_method_types_response import V2ListAuthenticationMethodTypesResponse - -class TestV2ListAuthenticationMethodTypesResponse(unittest.TestCase): - """V2ListAuthenticationMethodTypesResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2ListAuthenticationMethodTypesResponse: - """Test V2ListAuthenticationMethodTypesResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2ListAuthenticationMethodTypesResponse` - """ - model = V2ListAuthenticationMethodTypesResponse() - if include_optional: - return V2ListAuthenticationMethodTypesResponse( - details = zitadel_client.models.v2_list_details.v2ListDetails( - total_result = '2', - processed_sequence = '267831', - timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), - auth_method_types = [ - 'AUTHENTICATION_METHOD_TYPE_UNSPECIFIED' - ] - ) - else: - return V2ListAuthenticationMethodTypesResponse( - ) - """ - - def testV2ListAuthenticationMethodTypesResponse(self): - """Test V2ListAuthenticationMethodTypesResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_list_details.py b/test/test_v2_list_details.py deleted file mode 100644 index 1344fd80..00000000 --- a/test/test_v2_list_details.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_list_details import V2ListDetails - -class TestV2ListDetails(unittest.TestCase): - """V2ListDetails unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2ListDetails: - """Test V2ListDetails - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2ListDetails` - """ - model = V2ListDetails() - if include_optional: - return V2ListDetails( - total_result = '2', - processed_sequence = '267831', - timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') - ) - else: - return V2ListDetails( - ) - """ - - def testV2ListDetails(self): - """Test V2ListDetails""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_list_idp_links_response.py b/test/test_v2_list_idp_links_response.py deleted file mode 100644 index 085b3eb7..00000000 --- a/test/test_v2_list_idp_links_response.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_list_idp_links_response import V2ListIDPLinksResponse - -class TestV2ListIDPLinksResponse(unittest.TestCase): - """V2ListIDPLinksResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2ListIDPLinksResponse: - """Test V2ListIDPLinksResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2ListIDPLinksResponse` - """ - model = V2ListIDPLinksResponse() - if include_optional: - return V2ListIDPLinksResponse( - details = zitadel_client.models.v2_list_details.v2ListDetails( - total_result = '2', - processed_sequence = '267831', - timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), - result = [ - zitadel_client.models.v2_idp_link.v2IDPLink( - idp_id = 'd654e6ba-70a3-48ef-a95d-37c8d8a7901a', - user_id = '6516849804890468048461403518', - user_name = 'user@external.com', ) - ] - ) - else: - return V2ListIDPLinksResponse( - ) - """ - - def testV2ListIDPLinksResponse(self): - """Test V2ListIDPLinksResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_list_organizations_request.py b/test/test_v2_list_organizations_request.py deleted file mode 100644 index a01b0816..00000000 --- a/test/test_v2_list_organizations_request.py +++ /dev/null @@ -1,68 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_list_organizations_request import V2ListOrganizationsRequest - -class TestV2ListOrganizationsRequest(unittest.TestCase): - """V2ListOrganizationsRequest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2ListOrganizationsRequest: - """Test V2ListOrganizationsRequest - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2ListOrganizationsRequest` - """ - model = V2ListOrganizationsRequest() - if include_optional: - return V2ListOrganizationsRequest( - query = zitadel_client.models.general_list_query.General List Query( - offset = '0', - limit = 100, - asc = True, ), - sorting_column = 'ORGANIZATION_FIELD_NAME_UNSPECIFIED', - queries = [ - zitadel_client.models.zitadelorgv2_search_query.zitadelorgv2SearchQuery( - name_query = zitadel_client.models.v2_organization_name_query.v2OrganizationNameQuery( - name = 'gigi-giraffe', - method = 'TEXT_QUERY_METHOD_EQUALS', ), - domain_query = zitadel_client.models.v2_organization_domain_query.v2OrganizationDomainQuery( - domain = 'citadel.cloud', ), - state_query = zitadel_client.models.v2_organization_state_query.v2OrganizationStateQuery( - state = 'ORGANIZATION_STATE_UNSPECIFIED', ), - id_query = zitadel_client.models.v2_organization_id_query.v2OrganizationIDQuery( - id = '69629023906488334', ), - default_query = zitadel_client.models.v2_default_organization_query.v2DefaultOrganizationQuery(), ) - ] - ) - else: - return V2ListOrganizationsRequest( - ) - """ - - def testV2ListOrganizationsRequest(self): - """Test V2ListOrganizationsRequest""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_list_organizations_response.py b/test/test_v2_list_organizations_response.py deleted file mode 100644 index 84795c1a..00000000 --- a/test/test_v2_list_organizations_response.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_list_organizations_response import V2ListOrganizationsResponse - -class TestV2ListOrganizationsResponse(unittest.TestCase): - """V2ListOrganizationsResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2ListOrganizationsResponse: - """Test V2ListOrganizationsResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2ListOrganizationsResponse` - """ - model = V2ListOrganizationsResponse() - if include_optional: - return V2ListOrganizationsResponse( - details = zitadel_client.models.v2_list_details.v2ListDetails( - total_result = '2', - processed_sequence = '267831', - timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), - sorting_column = 'ORGANIZATION_FIELD_NAME_UNSPECIFIED', - result = [ - zitadel_client.models.zitadelorgv2_organization.zitadelorgv2Organization( - id = '69629023906488334', - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - state = 'ORGANIZATION_STATE_UNSPECIFIED', - name = 'ZITADEL', - primary_domain = 'zitadel.cloud', ) - ] - ) - else: - return V2ListOrganizationsResponse( - ) - """ - - def testV2ListOrganizationsResponse(self): - """Test V2ListOrganizationsResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_list_passkeys_response.py b/test/test_v2_list_passkeys_response.py deleted file mode 100644 index ff46b968..00000000 --- a/test/test_v2_list_passkeys_response.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_list_passkeys_response import V2ListPasskeysResponse - -class TestV2ListPasskeysResponse(unittest.TestCase): - """V2ListPasskeysResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2ListPasskeysResponse: - """Test V2ListPasskeysResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2ListPasskeysResponse` - """ - model = V2ListPasskeysResponse() - if include_optional: - return V2ListPasskeysResponse( - details = zitadel_client.models.v2_list_details.v2ListDetails( - total_result = '2', - processed_sequence = '267831', - timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), - result = [ - zitadel_client.models.v2_passkey.v2Passkey( - id = '69629023906488334', - state = 'AUTH_FACTOR_STATE_UNSPECIFIED', - name = 'fido key', ) - ] - ) - else: - return V2ListPasskeysResponse( - ) - """ - - def testV2ListPasskeysResponse(self): - """Test V2ListPasskeysResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_list_query.py b/test/test_v2_list_query.py deleted file mode 100644 index b97ec288..00000000 --- a/test/test_v2_list_query.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_list_query import V2ListQuery - -class TestV2ListQuery(unittest.TestCase): - """V2ListQuery unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2ListQuery: - """Test V2ListQuery - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2ListQuery` - """ - model = V2ListQuery() - if include_optional: - return V2ListQuery( - offset = '0', - limit = 100, - asc = True - ) - else: - return V2ListQuery( - ) - """ - - def testV2ListQuery(self): - """Test V2ListQuery""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_list_sessions_request.py b/test/test_v2_list_sessions_request.py deleted file mode 100644 index 5bdeb4c4..00000000 --- a/test/test_v2_list_sessions_request.py +++ /dev/null @@ -1,71 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_list_sessions_request import V2ListSessionsRequest - -class TestV2ListSessionsRequest(unittest.TestCase): - """V2ListSessionsRequest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2ListSessionsRequest: - """Test V2ListSessionsRequest - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2ListSessionsRequest` - """ - model = V2ListSessionsRequest() - if include_optional: - return V2ListSessionsRequest( - query = zitadel_client.models.general_list_query.General List Query( - offset = '0', - limit = 100, - asc = True, ), - queries = [ - zitadel_client.models.v2_search_query.v2SearchQuery( - ids_query = zitadel_client.models.v2_ids_query.v2IDsQuery( - ids = [ - '' - ], ), - user_id_query = zitadel_client.models.v2_user_id_query.v2UserIDQuery( - id = '', ), - creation_date_query = zitadel_client.models.v2_creation_date_query.v2CreationDateQuery( - creation_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - method = 'TIMESTAMP_QUERY_METHOD_EQUALS', ), - creator_query = zitadel_client.models.v2_creator_query.v2CreatorQuery( - id = '69629023906488334', ), - user_agent_query = zitadel_client.models.v2_user_agent_query.v2UserAgentQuery( - fingerprint_id = '69629023906488334', ), ) - ], - sorting_column = 'SESSION_FIELD_NAME_UNSPECIFIED' - ) - else: - return V2ListSessionsRequest( - ) - """ - - def testV2ListSessionsRequest(self): - """Test V2ListSessionsRequest""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_list_sessions_response.py b/test/test_v2_list_sessions_response.py deleted file mode 100644 index 859e1c51..00000000 --- a/test/test_v2_list_sessions_response.py +++ /dev/null @@ -1,95 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_list_sessions_response import V2ListSessionsResponse - -class TestV2ListSessionsResponse(unittest.TestCase): - """V2ListSessionsResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2ListSessionsResponse: - """Test V2ListSessionsResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2ListSessionsResponse` - """ - model = V2ListSessionsResponse() - if include_optional: - return V2ListSessionsResponse( - details = zitadel_client.models.objectv2_list_details.objectv2ListDetails( - total_result = '2', - processed_sequence = '267831', - timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), - sessions = [ - zitadel_client.models.v2_session_1.v2Session_1( - id = '', - creation_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - sequence = '', - factors = zitadel_client.models.v2_factors.v2Factors( - user = zitadel_client.models.v2_user_factor.v2UserFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - id = '', - login_name = '', - display_name = '', - organization_id = '', ), - password = zitadel_client.models.v2_password_factor.v2PasswordFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), - web_auth_n = zitadel_client.models.v2_web_auth_n_factor.v2WebAuthNFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - user_verified = True, ), - intent = zitadel_client.models.v2_intent_factor.v2IntentFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), - totp = zitadel_client.models.v2_totp_factor.v2TOTPFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), - otp_sms = zitadel_client.models.v2_otp_factor.v2OTPFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), - otp_email = zitadel_client.models.v2_otp_factor.v2OTPFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ), - metadata = { - 'key' : 'YQ==' - }, - user_agent = zitadel_client.models.v2_user_agent.v2UserAgent( - fingerprint_id = '', - ip = '', - description = '', - header = { - 'key' : zitadel_client.models.user_agent_header_values.UserAgentHeaderValues( - values = [ - '' - ], ) - }, ), - expiration_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) - ] - ) - else: - return V2ListSessionsResponse( - ) - """ - - def testV2ListSessionsResponse(self): - """Test V2ListSessionsResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_list_users_request.py b/test/test_v2_list_users_request.py deleted file mode 100644 index 72eda8eb..00000000 --- a/test/test_v2_list_users_request.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_list_users_request import V2ListUsersRequest - -class TestV2ListUsersRequest(unittest.TestCase): - """V2ListUsersRequest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2ListUsersRequest: - """Test V2ListUsersRequest - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2ListUsersRequest` - """ - model = V2ListUsersRequest() - if include_optional: - return V2ListUsersRequest( - query = zitadel_client.models.general_list_query.General List Query( - offset = '0', - limit = 100, - asc = True, ), - sorting_column = 'USER_FIELD_NAME_UNSPECIFIED', - queries = [ - zitadel_client.models.v2_search_query_1.v2SearchQuery_1( - user_name_query = zitadel_client.models.v2_user_name_query.v2UserNameQuery( - user_name = 'gigi-giraffe', - method = 'TEXT_QUERY_METHOD_EQUALS', ), - first_name_query = zitadel_client.models.v2_first_name_query.v2FirstNameQuery( - first_name = 'Gigi', ), - last_name_query = zitadel_client.models.v2_last_name_query.v2LastNameQuery( - last_name = 'Giraffe', ), - nick_name_query = zitadel_client.models.v2_nick_name_query.v2NickNameQuery( - nick_name = 'Gigi', ), - display_name_query = zitadel_client.models.v2_display_name_query.v2DisplayNameQuery( - display_name = 'Gigi Giraffe', ), - email_query = zitadel_client.models.v2_email_query.v2EmailQuery( - email_address = 'gigi@zitadel.com', ), - state_query = zitadel_client.models.v2_state_query.v2StateQuery( - state = 'USER_STATE_UNSPECIFIED', ), - type_query = zitadel_client.models.v2_type_query.v2TypeQuery( - type = 'TYPE_UNSPECIFIED', ), - login_name_query = zitadel_client.models.v2_login_name_query.v2LoginNameQuery( - login_name = 'gigi@zitadel.cloud', ), - in_user_ids_query = zitadel_client.models.v2_in_user_id_query.v2InUserIDQuery( - user_ids = ["69629023906488334","69622366012355662"], ), - or_query = zitadel_client.models.v2_or_query.v2OrQuery( - queries = [ - zitadel_client.models.v2_search_query_1.v2SearchQuery_1( - and_query = zitadel_client.models.v2_and_query.v2AndQuery(), - not_query = zitadel_client.models.v2_not_query.v2NotQuery( - query = , ), - in_user_emails_query = zitadel_client.models.v2_in_user_emails_query.v2InUserEmailsQuery( - user_emails = ["test@example.com","test@example.org"], ), - organization_id_query = zitadel_client.models.v2_organization_id_query.v2OrganizationIDQuery( - id = '69629023906488334', ), - phone_query = zitadel_client.models.v2_phone_query.v2PhoneQuery( - number = '+41791234567', ), ) - ], ), - and_query = zitadel_client.models.v2_and_query.v2AndQuery(), - not_query = zitadel_client.models.v2_not_query.v2NotQuery(), - in_user_emails_query = zitadel_client.models.v2_in_user_emails_query.v2InUserEmailsQuery( - user_emails = ["test@example.com","test@example.org"], ), - organization_id_query = zitadel_client.models.v2_organization_id_query.v2OrganizationIDQuery( - id = '69629023906488334', ), - phone_query = zitadel_client.models.v2_phone_query.v2PhoneQuery( - number = '+41791234567', ), ) - ] - ) - else: - return V2ListUsersRequest( - ) - """ - - def testV2ListUsersRequest(self): - """Test V2ListUsersRequest""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_list_users_response.py b/test/test_v2_list_users_response.py deleted file mode 100644 index 6c753a61..00000000 --- a/test/test_v2_list_users_response.py +++ /dev/null @@ -1,92 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_list_users_response import V2ListUsersResponse - -class TestV2ListUsersResponse(unittest.TestCase): - """V2ListUsersResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2ListUsersResponse: - """Test V2ListUsersResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2ListUsersResponse` - """ - model = V2ListUsersResponse() - if include_optional: - return V2ListUsersResponse( - details = zitadel_client.models.v2_list_details.v2ListDetails( - total_result = '2', - processed_sequence = '267831', - timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), - sorting_column = 'USER_FIELD_NAME_UNSPECIFIED', - result = [ - zitadel_client.models.v2_user.v2User( - user_id = 'd654e6ba-70a3-48ef-a95d-37c8d8a7901a', - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - state = 'USER_STATE_UNSPECIFIED', - username = 'minnie-mouse', - login_names = ["gigi@zitadel.com","gigi@zitadel.zitadel.ch"], - preferred_login_name = 'gigi@zitadel.com', - human = zitadel_client.models.v2_human_user.v2HumanUser( - user_id = 'd654e6ba-70a3-48ef-a95d-37c8d8a7901a', - username = 'minnie-mouse', - login_names = ["gigi@zitadel.com","gigi@zitadel.zitadel.ch"], - preferred_login_name = 'gigi@zitadel.com', - profile = zitadel_client.models.v2_human_profile.v2HumanProfile( - given_name = 'Minnie', - family_name = 'Mouse', - nick_name = 'Mini', - display_name = 'Minnie Mouse', - preferred_language = 'en', - gender = 'GENDER_UNSPECIFIED', - avatar_url = 'https://api.zitadel.ch/assets/v1/avatar-32432jkh4kj32', ), - email = zitadel_client.models.v2_human_email.v2HumanEmail( - is_verified = True, ), - phone = zitadel_client.models.v2_human_phone.v2HumanPhone( - is_verified = True, ), - password_change_required = True, - password_changed = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - mfa_init_skipped = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), - machine = zitadel_client.models.v2_machine_user.v2MachineUser( - name = 'zitadel', - description = 'The one and only IAM', - has_secret = True, - access_token_type = 'ACCESS_TOKEN_TYPE_BEARER', ), ) - ] - ) - else: - return V2ListUsersResponse( - ) - """ - - def testV2ListUsersResponse(self): - """Test V2ListUsersResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_lock_user_response.py b/test/test_v2_lock_user_response.py deleted file mode 100644 index 11783da1..00000000 --- a/test/test_v2_lock_user_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_lock_user_response import V2LockUserResponse - -class TestV2LockUserResponse(unittest.TestCase): - """V2LockUserResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2LockUserResponse: - """Test V2LockUserResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2LockUserResponse` - """ - model = V2LockUserResponse() - if include_optional: - return V2LockUserResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2LockUserResponse( - ) - """ - - def testV2LockUserResponse(self): - """Test V2LockUserResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_lockout_settings.py b/test/test_v2_lockout_settings.py deleted file mode 100644 index 79714366..00000000 --- a/test/test_v2_lockout_settings.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_lockout_settings import V2LockoutSettings - -class TestV2LockoutSettings(unittest.TestCase): - """V2LockoutSettings unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2LockoutSettings: - """Test V2LockoutSettings - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2LockoutSettings` - """ - model = V2LockoutSettings() - if include_optional: - return V2LockoutSettings( - max_password_attempts = '10', - resource_owner_type = 'RESOURCE_OWNER_TYPE_UNSPECIFIED', - max_otp_attempts = '10' - ) - else: - return V2LockoutSettings( - ) - """ - - def testV2LockoutSettings(self): - """Test V2LockoutSettings""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_login_name_query.py b/test/test_v2_login_name_query.py deleted file mode 100644 index 4c6efd71..00000000 --- a/test/test_v2_login_name_query.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_login_name_query import V2LoginNameQuery - -class TestV2LoginNameQuery(unittest.TestCase): - """V2LoginNameQuery unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2LoginNameQuery: - """Test V2LoginNameQuery - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2LoginNameQuery` - """ - model = V2LoginNameQuery() - if include_optional: - return V2LoginNameQuery( - login_name = 'gigi@zitadel.cloud', - method = 'TEXT_QUERY_METHOD_EQUALS' - ) - else: - return V2LoginNameQuery( - login_name = 'gigi@zitadel.cloud', - ) - """ - - def testV2LoginNameQuery(self): - """Test V2LoginNameQuery""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_login_settings.py b/test/test_v2_login_settings.py deleted file mode 100644 index 4ca3f3c2..00000000 --- a/test/test_v2_login_settings.py +++ /dev/null @@ -1,74 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_login_settings import V2LoginSettings - -class TestV2LoginSettings(unittest.TestCase): - """V2LoginSettings unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2LoginSettings: - """Test V2LoginSettings - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2LoginSettings` - """ - model = V2LoginSettings() - if include_optional: - return V2LoginSettings( - allow_username_password = True, - allow_register = True, - allow_external_idp = True, - force_mfa = True, - passkeys_type = 'PASSKEYS_TYPE_NOT_ALLOWED', - hide_password_reset = True, - ignore_unknown_usernames = True, - default_redirect_uri = 'https://acme.com/ui/console', - password_check_lifetime = '864000s', - external_login_check_lifetime = '864000s', - mfa_init_skip_lifetime = '2592000s', - second_factor_check_lifetime = '64800s', - multi_factor_check_lifetime = '43200s', - second_factors = [ - 'SECOND_FACTOR_TYPE_UNSPECIFIED' - ], - multi_factors = [ - 'MULTI_FACTOR_TYPE_UNSPECIFIED' - ], - allow_domain_discovery = True, - disable_login_with_email = True, - disable_login_with_phone = True, - resource_owner_type = 'RESOURCE_OWNER_TYPE_UNSPECIFIED', - force_mfa_local_only = True - ) - else: - return V2LoginSettings( - ) - """ - - def testV2LoginSettings(self): - """Test V2LoginSettings""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_login_v2.py b/test/test_v2_login_v2.py deleted file mode 100644 index 282a9ab8..00000000 --- a/test/test_v2_login_v2.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_login_v2 import V2LoginV2 - -class TestV2LoginV2(unittest.TestCase): - """V2LoginV2 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2LoginV2: - """Test V2LoginV2 - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2LoginV2` - """ - model = V2LoginV2() - if include_optional: - return V2LoginV2( - required = True, - base_uri = '' - ) - else: - return V2LoginV2( - ) - """ - - def testV2LoginV2(self): - """Test V2LoginV2""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_login_v2_feature_flag.py b/test/test_v2_login_v2_feature_flag.py deleted file mode 100644 index 9faec0a3..00000000 --- a/test/test_v2_login_v2_feature_flag.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_login_v2_feature_flag import V2LoginV2FeatureFlag - -class TestV2LoginV2FeatureFlag(unittest.TestCase): - """V2LoginV2FeatureFlag unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2LoginV2FeatureFlag: - """Test V2LoginV2FeatureFlag - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2LoginV2FeatureFlag` - """ - model = V2LoginV2FeatureFlag() - if include_optional: - return V2LoginV2FeatureFlag( - required = True, - base_uri = '', - source = 'SOURCE_UNSPECIFIED' - ) - else: - return V2LoginV2FeatureFlag( - ) - """ - - def testV2LoginV2FeatureFlag(self): - """Test V2LoginV2FeatureFlag""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_machine_user.py b/test/test_v2_machine_user.py deleted file mode 100644 index d0b360fa..00000000 --- a/test/test_v2_machine_user.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_machine_user import V2MachineUser - -class TestV2MachineUser(unittest.TestCase): - """V2MachineUser unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2MachineUser: - """Test V2MachineUser - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2MachineUser` - """ - model = V2MachineUser() - if include_optional: - return V2MachineUser( - name = 'zitadel', - description = 'The one and only IAM', - has_secret = True, - access_token_type = 'ACCESS_TOKEN_TYPE_BEARER' - ) - else: - return V2MachineUser( - ) - """ - - def testV2MachineUser(self): - """Test V2MachineUser""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_multi_factor_type.py b/test/test_v2_multi_factor_type.py deleted file mode 100644 index d1669a3e..00000000 --- a/test/test_v2_multi_factor_type.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_multi_factor_type import V2MultiFactorType - -class TestV2MultiFactorType(unittest.TestCase): - """V2MultiFactorType unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2MultiFactorType(self): - """Test V2MultiFactorType""" - # inst = V2MultiFactorType() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_nick_name_query.py b/test/test_v2_nick_name_query.py deleted file mode 100644 index 4ecdbe10..00000000 --- a/test/test_v2_nick_name_query.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_nick_name_query import V2NickNameQuery - -class TestV2NickNameQuery(unittest.TestCase): - """V2NickNameQuery unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2NickNameQuery: - """Test V2NickNameQuery - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2NickNameQuery` - """ - model = V2NickNameQuery() - if include_optional: - return V2NickNameQuery( - nick_name = 'Gigi', - method = 'TEXT_QUERY_METHOD_EQUALS' - ) - else: - return V2NickNameQuery( - nick_name = 'Gigi', - ) - """ - - def testV2NickNameQuery(self): - """Test V2NickNameQuery""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_not_query.py b/test/test_v2_not_query.py deleted file mode 100644 index a10089ce..00000000 --- a/test/test_v2_not_query.py +++ /dev/null @@ -1,92 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_not_query import V2NotQuery - -class TestV2NotQuery(unittest.TestCase): - """V2NotQuery unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2NotQuery: - """Test V2NotQuery - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2NotQuery` - """ - model = V2NotQuery() - if include_optional: - return V2NotQuery( - query = zitadel_client.models.v2_search_query_1.v2SearchQuery_1( - user_name_query = zitadel_client.models.v2_user_name_query.v2UserNameQuery( - user_name = 'gigi-giraffe', - method = 'TEXT_QUERY_METHOD_EQUALS', ), - first_name_query = zitadel_client.models.v2_first_name_query.v2FirstNameQuery( - first_name = 'Gigi', ), - last_name_query = zitadel_client.models.v2_last_name_query.v2LastNameQuery( - last_name = 'Giraffe', ), - nick_name_query = zitadel_client.models.v2_nick_name_query.v2NickNameQuery( - nick_name = 'Gigi', ), - display_name_query = zitadel_client.models.v2_display_name_query.v2DisplayNameQuery( - display_name = 'Gigi Giraffe', ), - email_query = zitadel_client.models.v2_email_query.v2EmailQuery( - email_address = 'gigi@zitadel.com', ), - state_query = zitadel_client.models.v2_state_query.v2StateQuery( - state = 'USER_STATE_UNSPECIFIED', ), - type_query = zitadel_client.models.v2_type_query.v2TypeQuery( - type = 'TYPE_UNSPECIFIED', ), - login_name_query = zitadel_client.models.v2_login_name_query.v2LoginNameQuery( - login_name = 'gigi@zitadel.cloud', ), - in_user_ids_query = zitadel_client.models.v2_in_user_id_query.v2InUserIDQuery( - user_ids = ["69629023906488334","69622366012355662"], ), - or_query = zitadel_client.models.v2_or_query.v2OrQuery( - queries = [ - zitadel_client.models.v2_search_query_1.v2SearchQuery_1( - and_query = zitadel_client.models.v2_and_query.v2AndQuery(), - not_query = zitadel_client.models.v2_not_query.v2NotQuery(), - in_user_emails_query = zitadel_client.models.v2_in_user_emails_query.v2InUserEmailsQuery( - user_emails = ["test@example.com","test@example.org"], ), - organization_id_query = zitadel_client.models.v2_organization_id_query.v2OrganizationIDQuery( - id = '69629023906488334', ), - phone_query = zitadel_client.models.v2_phone_query.v2PhoneQuery( - number = '+41791234567', ), ) - ], ), - and_query = zitadel_client.models.v2_and_query.v2AndQuery(), - not_query = zitadel_client.models.v2_not_query.v2NotQuery(), - in_user_emails_query = zitadel_client.models.v2_in_user_emails_query.v2InUserEmailsQuery( - user_emails = ["test@example.com","test@example.org"], ), - organization_id_query = zitadel_client.models.v2_organization_id_query.v2OrganizationIDQuery( - id = '69629023906488334', ), - phone_query = zitadel_client.models.v2_phone_query.v2PhoneQuery( - number = '+41791234567', ), ) - ) - else: - return V2NotQuery( - ) - """ - - def testV2NotQuery(self): - """Test V2NotQuery""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_notification_type.py b/test/test_v2_notification_type.py deleted file mode 100644 index 0bc1d433..00000000 --- a/test/test_v2_notification_type.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_notification_type import V2NotificationType - -class TestV2NotificationType(unittest.TestCase): - """V2NotificationType unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2NotificationType(self): - """Test V2NotificationType""" - # inst = V2NotificationType() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_o_auth_config.py b/test/test_v2_o_auth_config.py deleted file mode 100644 index 7f6e47ac..00000000 --- a/test/test_v2_o_auth_config.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_o_auth_config import V2OAuthConfig - -class TestV2OAuthConfig(unittest.TestCase): - """V2OAuthConfig unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2OAuthConfig: - """Test V2OAuthConfig - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2OAuthConfig` - """ - model = V2OAuthConfig() - if include_optional: - return V2OAuthConfig( - client_id = 'client-id', - authorization_endpoint = 'https://accounts.google.com/o/oauth2/v2/auth', - token_endpoint = 'https://oauth2.googleapis.com/token', - user_endpoint = 'https://openidconnect.googleapis.com/v1/userinfo', - scopes = ["openid","profile","email"], - id_attribute = 'user_id' - ) - else: - return V2OAuthConfig( - ) - """ - - def testV2OAuthConfig(self): - """Test V2OAuthConfig""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_or_query.py b/test/test_v2_or_query.py deleted file mode 100644 index a44a3503..00000000 --- a/test/test_v2_or_query.py +++ /dev/null @@ -1,90 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_or_query import V2OrQuery - -class TestV2OrQuery(unittest.TestCase): - """V2OrQuery unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2OrQuery: - """Test V2OrQuery - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2OrQuery` - """ - model = V2OrQuery() - if include_optional: - return V2OrQuery( - queries = [ - zitadel_client.models.v2_search_query_1.v2SearchQuery_1( - user_name_query = zitadel_client.models.v2_user_name_query.v2UserNameQuery( - user_name = 'gigi-giraffe', - method = 'TEXT_QUERY_METHOD_EQUALS', ), - first_name_query = zitadel_client.models.v2_first_name_query.v2FirstNameQuery( - first_name = 'Gigi', ), - last_name_query = zitadel_client.models.v2_last_name_query.v2LastNameQuery( - last_name = 'Giraffe', ), - nick_name_query = zitadel_client.models.v2_nick_name_query.v2NickNameQuery( - nick_name = 'Gigi', ), - display_name_query = zitadel_client.models.v2_display_name_query.v2DisplayNameQuery( - display_name = 'Gigi Giraffe', ), - email_query = zitadel_client.models.v2_email_query.v2EmailQuery( - email_address = 'gigi@zitadel.com', ), - state_query = zitadel_client.models.v2_state_query.v2StateQuery( - state = 'USER_STATE_UNSPECIFIED', ), - type_query = zitadel_client.models.v2_type_query.v2TypeQuery( - type = 'TYPE_UNSPECIFIED', ), - login_name_query = zitadel_client.models.v2_login_name_query.v2LoginNameQuery( - login_name = 'gigi@zitadel.cloud', ), - in_user_ids_query = zitadel_client.models.v2_in_user_id_query.v2InUserIDQuery( - user_ids = ["69629023906488334","69622366012355662"], ), - or_query = zitadel_client.models.v2_or_query.v2OrQuery(), - and_query = zitadel_client.models.v2_and_query.v2AndQuery(), - not_query = zitadel_client.models.v2_not_query.v2NotQuery( - query = zitadel_client.models.v2_search_query_1.v2SearchQuery_1( - in_user_emails_query = zitadel_client.models.v2_in_user_emails_query.v2InUserEmailsQuery( - user_emails = ["test@example.com","test@example.org"], ), - organization_id_query = zitadel_client.models.v2_organization_id_query.v2OrganizationIDQuery( - id = '69629023906488334', ), - phone_query = zitadel_client.models.v2_phone_query.v2PhoneQuery( - number = '+41791234567', ), ), ), - in_user_emails_query = zitadel_client.models.v2_in_user_emails_query.v2InUserEmailsQuery( - user_emails = ["test@example.com","test@example.org"], ), - organization_id_query = zitadel_client.models.v2_organization_id_query.v2OrganizationIDQuery( - id = '69629023906488334', ), - phone_query = zitadel_client.models.v2_phone_query.v2PhoneQuery( - number = '+41791234567', ), ) - ] - ) - else: - return V2OrQuery( - ) - """ - - def testV2OrQuery(self): - """Test V2OrQuery""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_organization.py b/test/test_v2_organization.py deleted file mode 100644 index 1c61e6e9..00000000 --- a/test/test_v2_organization.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_organization import V2Organization - -class TestV2Organization(unittest.TestCase): - """V2Organization unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2Organization: - """Test V2Organization - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2Organization` - """ - model = V2Organization() - if include_optional: - return V2Organization( - org_id = '', - org_domain = '' - ) - else: - return V2Organization( - ) - """ - - def testV2Organization(self): - """Test V2Organization""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_organization_domain_query.py b/test/test_v2_organization_domain_query.py deleted file mode 100644 index 8d316dc6..00000000 --- a/test/test_v2_organization_domain_query.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_organization_domain_query import V2OrganizationDomainQuery - -class TestV2OrganizationDomainQuery(unittest.TestCase): - """V2OrganizationDomainQuery unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2OrganizationDomainQuery: - """Test V2OrganizationDomainQuery - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2OrganizationDomainQuery` - """ - model = V2OrganizationDomainQuery() - if include_optional: - return V2OrganizationDomainQuery( - domain = 'citadel.cloud', - method = 'TEXT_QUERY_METHOD_EQUALS' - ) - else: - return V2OrganizationDomainQuery( - domain = 'citadel.cloud', - ) - """ - - def testV2OrganizationDomainQuery(self): - """Test V2OrganizationDomainQuery""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_organization_field_name.py b/test/test_v2_organization_field_name.py deleted file mode 100644 index 292fdbe7..00000000 --- a/test/test_v2_organization_field_name.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_organization_field_name import V2OrganizationFieldName - -class TestV2OrganizationFieldName(unittest.TestCase): - """V2OrganizationFieldName unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2OrganizationFieldName(self): - """Test V2OrganizationFieldName""" - # inst = V2OrganizationFieldName() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_organization_id_query.py b/test/test_v2_organization_id_query.py deleted file mode 100644 index dba25660..00000000 --- a/test/test_v2_organization_id_query.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_organization_id_query import V2OrganizationIDQuery - -class TestV2OrganizationIDQuery(unittest.TestCase): - """V2OrganizationIDQuery unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2OrganizationIDQuery: - """Test V2OrganizationIDQuery - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2OrganizationIDQuery` - """ - model = V2OrganizationIDQuery() - if include_optional: - return V2OrganizationIDQuery( - id = '69629023906488334' - ) - else: - return V2OrganizationIDQuery( - id = '69629023906488334', - ) - """ - - def testV2OrganizationIDQuery(self): - """Test V2OrganizationIDQuery""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_organization_name_query.py b/test/test_v2_organization_name_query.py deleted file mode 100644 index 8c36425c..00000000 --- a/test/test_v2_organization_name_query.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_organization_name_query import V2OrganizationNameQuery - -class TestV2OrganizationNameQuery(unittest.TestCase): - """V2OrganizationNameQuery unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2OrganizationNameQuery: - """Test V2OrganizationNameQuery - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2OrganizationNameQuery` - """ - model = V2OrganizationNameQuery() - if include_optional: - return V2OrganizationNameQuery( - name = 'gigi-giraffe', - method = 'TEXT_QUERY_METHOD_EQUALS' - ) - else: - return V2OrganizationNameQuery( - name = 'gigi-giraffe', - ) - """ - - def testV2OrganizationNameQuery(self): - """Test V2OrganizationNameQuery""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_organization_state.py b/test/test_v2_organization_state.py deleted file mode 100644 index 2c9a4ae6..00000000 --- a/test/test_v2_organization_state.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_organization_state import V2OrganizationState - -class TestV2OrganizationState(unittest.TestCase): - """V2OrganizationState unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2OrganizationState(self): - """Test V2OrganizationState""" - # inst = V2OrganizationState() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_organization_state_query.py b/test/test_v2_organization_state_query.py deleted file mode 100644 index 6b92b372..00000000 --- a/test/test_v2_organization_state_query.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_organization_state_query import V2OrganizationStateQuery - -class TestV2OrganizationStateQuery(unittest.TestCase): - """V2OrganizationStateQuery unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2OrganizationStateQuery: - """Test V2OrganizationStateQuery - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2OrganizationStateQuery` - """ - model = V2OrganizationStateQuery() - if include_optional: - return V2OrganizationStateQuery( - state = 'ORGANIZATION_STATE_UNSPECIFIED' - ) - else: - return V2OrganizationStateQuery( - ) - """ - - def testV2OrganizationStateQuery(self): - """Test V2OrganizationStateQuery""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_otp_factor.py b/test/test_v2_otp_factor.py deleted file mode 100644 index c121a8a8..00000000 --- a/test/test_v2_otp_factor.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_otp_factor import V2OTPFactor - -class TestV2OTPFactor(unittest.TestCase): - """V2OTPFactor unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2OTPFactor: - """Test V2OTPFactor - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2OTPFactor` - """ - model = V2OTPFactor() - if include_optional: - return V2OTPFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') - ) - else: - return V2OTPFactor( - ) - """ - - def testV2OTPFactor(self): - """Test V2OTPFactor""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_passkey.py b/test/test_v2_passkey.py deleted file mode 100644 index 13d568f0..00000000 --- a/test/test_v2_passkey.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_passkey import V2Passkey - -class TestV2Passkey(unittest.TestCase): - """V2Passkey unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2Passkey: - """Test V2Passkey - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2Passkey` - """ - model = V2Passkey() - if include_optional: - return V2Passkey( - id = '69629023906488334', - state = 'AUTH_FACTOR_STATE_UNSPECIFIED', - name = 'fido key' - ) - else: - return V2Passkey( - ) - """ - - def testV2Passkey(self): - """Test V2Passkey""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_passkey_authenticator.py b/test/test_v2_passkey_authenticator.py deleted file mode 100644 index 3163f6db..00000000 --- a/test/test_v2_passkey_authenticator.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_passkey_authenticator import V2PasskeyAuthenticator - -class TestV2PasskeyAuthenticator(unittest.TestCase): - """V2PasskeyAuthenticator unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2PasskeyAuthenticator(self): - """Test V2PasskeyAuthenticator""" - # inst = V2PasskeyAuthenticator() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_passkey_registration_code.py b/test/test_v2_passkey_registration_code.py deleted file mode 100644 index fd195be9..00000000 --- a/test/test_v2_passkey_registration_code.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_passkey_registration_code import V2PasskeyRegistrationCode - -class TestV2PasskeyRegistrationCode(unittest.TestCase): - """V2PasskeyRegistrationCode unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2PasskeyRegistrationCode: - """Test V2PasskeyRegistrationCode - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2PasskeyRegistrationCode` - """ - model = V2PasskeyRegistrationCode() - if include_optional: - return V2PasskeyRegistrationCode( - id = 'e2a48d6a-362b-4db6-a1fb-34feab84dc62', - code = 'SomeSpecialCode' - ) - else: - return V2PasskeyRegistrationCode( - id = 'e2a48d6a-362b-4db6-a1fb-34feab84dc62', - code = 'SomeSpecialCode', - ) - """ - - def testV2PasskeyRegistrationCode(self): - """Test V2PasskeyRegistrationCode""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_passkeys_type.py b/test/test_v2_passkeys_type.py deleted file mode 100644 index 9388b690..00000000 --- a/test/test_v2_passkeys_type.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_passkeys_type import V2PasskeysType - -class TestV2PasskeysType(unittest.TestCase): - """V2PasskeysType unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2PasskeysType(self): - """Test V2PasskeysType""" - # inst = V2PasskeysType() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_password.py b/test/test_v2_password.py deleted file mode 100644 index fa74e9bf..00000000 --- a/test/test_v2_password.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_password import V2Password - -class TestV2Password(unittest.TestCase): - """V2Password unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2Password: - """Test V2Password - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2Password` - """ - model = V2Password() - if include_optional: - return V2Password( - password = 'Secr3tP4ssw0rd!', - change_required = True - ) - else: - return V2Password( - password = 'Secr3tP4ssw0rd!', - ) - """ - - def testV2Password(self): - """Test V2Password""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_password_complexity_settings.py b/test/test_v2_password_complexity_settings.py deleted file mode 100644 index a7371cd8..00000000 --- a/test/test_v2_password_complexity_settings.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_password_complexity_settings import V2PasswordComplexitySettings - -class TestV2PasswordComplexitySettings(unittest.TestCase): - """V2PasswordComplexitySettings unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2PasswordComplexitySettings: - """Test V2PasswordComplexitySettings - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2PasswordComplexitySettings` - """ - model = V2PasswordComplexitySettings() - if include_optional: - return V2PasswordComplexitySettings( - min_length = '8', - requires_uppercase = True, - requires_lowercase = True, - requires_number = True, - requires_symbol = True, - resource_owner_type = 'RESOURCE_OWNER_TYPE_UNSPECIFIED' - ) - else: - return V2PasswordComplexitySettings( - ) - """ - - def testV2PasswordComplexitySettings(self): - """Test V2PasswordComplexitySettings""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_password_expiry_settings.py b/test/test_v2_password_expiry_settings.py deleted file mode 100644 index 4145eb76..00000000 --- a/test/test_v2_password_expiry_settings.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_password_expiry_settings import V2PasswordExpirySettings - -class TestV2PasswordExpirySettings(unittest.TestCase): - """V2PasswordExpirySettings unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2PasswordExpirySettings: - """Test V2PasswordExpirySettings - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2PasswordExpirySettings` - """ - model = V2PasswordExpirySettings() - if include_optional: - return V2PasswordExpirySettings( - max_age_days = '365', - expire_warn_days = '10', - resource_owner_type = 'RESOURCE_OWNER_TYPE_UNSPECIFIED' - ) - else: - return V2PasswordExpirySettings( - ) - """ - - def testV2PasswordExpirySettings(self): - """Test V2PasswordExpirySettings""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_password_factor.py b/test/test_v2_password_factor.py deleted file mode 100644 index b963533a..00000000 --- a/test/test_v2_password_factor.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_password_factor import V2PasswordFactor - -class TestV2PasswordFactor(unittest.TestCase): - """V2PasswordFactor unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2PasswordFactor: - """Test V2PasswordFactor - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2PasswordFactor` - """ - model = V2PasswordFactor() - if include_optional: - return V2PasswordFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') - ) - else: - return V2PasswordFactor( - ) - """ - - def testV2PasswordFactor(self): - """Test V2PasswordFactor""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_password_reset_response.py b/test/test_v2_password_reset_response.py deleted file mode 100644 index 49d2b52f..00000000 --- a/test/test_v2_password_reset_response.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_password_reset_response import V2PasswordResetResponse - -class TestV2PasswordResetResponse(unittest.TestCase): - """V2PasswordResetResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2PasswordResetResponse: - """Test V2PasswordResetResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2PasswordResetResponse` - """ - model = V2PasswordResetResponse() - if include_optional: - return V2PasswordResetResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - verification_code = '' - ) - else: - return V2PasswordResetResponse( - ) - """ - - def testV2PasswordResetResponse(self): - """Test V2PasswordResetResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_phone_query.py b/test/test_v2_phone_query.py deleted file mode 100644 index b88a4c15..00000000 --- a/test/test_v2_phone_query.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_phone_query import V2PhoneQuery - -class TestV2PhoneQuery(unittest.TestCase): - """V2PhoneQuery unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2PhoneQuery: - """Test V2PhoneQuery - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2PhoneQuery` - """ - model = V2PhoneQuery() - if include_optional: - return V2PhoneQuery( - number = '+41791234567', - method = 'TEXT_QUERY_METHOD_EQUALS' - ) - else: - return V2PhoneQuery( - number = '+41791234567', - ) - """ - - def testV2PhoneQuery(self): - """Test V2PhoneQuery""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_prompt.py b/test/test_v2_prompt.py deleted file mode 100644 index 6c5cb288..00000000 --- a/test/test_v2_prompt.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_prompt import V2Prompt - -class TestV2Prompt(unittest.TestCase): - """V2Prompt unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2Prompt(self): - """Test V2Prompt""" - # inst = V2Prompt() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_reactivate_user_response.py b/test/test_v2_reactivate_user_response.py deleted file mode 100644 index e5133f0d..00000000 --- a/test/test_v2_reactivate_user_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_reactivate_user_response import V2ReactivateUserResponse - -class TestV2ReactivateUserResponse(unittest.TestCase): - """V2ReactivateUserResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2ReactivateUserResponse: - """Test V2ReactivateUserResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2ReactivateUserResponse` - """ - model = V2ReactivateUserResponse() - if include_optional: - return V2ReactivateUserResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2ReactivateUserResponse( - ) - """ - - def testV2ReactivateUserResponse(self): - """Test V2ReactivateUserResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_redirect_urls.py b/test/test_v2_redirect_urls.py deleted file mode 100644 index 3e7d3609..00000000 --- a/test/test_v2_redirect_urls.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_redirect_urls import V2RedirectURLs - -class TestV2RedirectURLs(unittest.TestCase): - """V2RedirectURLs unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2RedirectURLs: - """Test V2RedirectURLs - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2RedirectURLs` - """ - model = V2RedirectURLs() - if include_optional: - return V2RedirectURLs( - success_url = 'https://custom.com/login/idp/success', - failure_url = 'https://custom.com/login/idp/fail' - ) - else: - return V2RedirectURLs( - ) - """ - - def testV2RedirectURLs(self): - """Test V2RedirectURLs""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_register_passkey_response.py b/test/test_v2_register_passkey_response.py deleted file mode 100644 index 2dc1c698..00000000 --- a/test/test_v2_register_passkey_response.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_register_passkey_response import V2RegisterPasskeyResponse - -class TestV2RegisterPasskeyResponse(unittest.TestCase): - """V2RegisterPasskeyResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2RegisterPasskeyResponse: - """Test V2RegisterPasskeyResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2RegisterPasskeyResponse` - """ - model = V2RegisterPasskeyResponse() - if include_optional: - return V2RegisterPasskeyResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - passkey_id = '163840776835432705', - public_key_credential_creation_options = {"publicKey":{"attestation":"none","authenticatorSelection":{"userVerification":"required"},"challenge":"XaMYwWOZ5hj6pwtwJJlpcI-ExkO5TxevBMG4R8DoKQQ","excludeCredentials":[{"id":"tVp1QfYhT8DkyEHVrv7blnpAo2YJzbZgZNBf7zPs6CI","type":"public-key"}],"pubKeyCredParams":[{"alg":-7,"type":"public-key"}],"rp":{"id":"localhost","name":"ZITADEL"},"timeout":300000,"user":{"displayName":"Tim Mohlmann","id":"MjE1NTk4MDAwNDY0OTk4OTQw","name":"tim"}}} - ) - else: - return V2RegisterPasskeyResponse( - ) - """ - - def testV2RegisterPasskeyResponse(self): - """Test V2RegisterPasskeyResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_register_totp_response.py b/test/test_v2_register_totp_response.py deleted file mode 100644 index 3a596a71..00000000 --- a/test/test_v2_register_totp_response.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_register_totp_response import V2RegisterTOTPResponse - -class TestV2RegisterTOTPResponse(unittest.TestCase): - """V2RegisterTOTPResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2RegisterTOTPResponse: - """Test V2RegisterTOTPResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2RegisterTOTPResponse` - """ - model = V2RegisterTOTPResponse() - if include_optional: - return V2RegisterTOTPResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - uri = 'otpauth://totp/ZITADEL:gigi@acme.zitadel.cloud?algorithm=SHA1&digits=6&issuer=ZITADEL&period=30&secret=TJOPWSDYILLHXFV4MLKNNJOWFG7VSDCK', - secret = 'TJOPWSDYILLHXFV4MLKNNJOWFG7VSDCK' - ) - else: - return V2RegisterTOTPResponse( - ) - """ - - def testV2RegisterTOTPResponse(self): - """Test V2RegisterTOTPResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_register_u2_f_response.py b/test/test_v2_register_u2_f_response.py deleted file mode 100644 index 1cb5cf5c..00000000 --- a/test/test_v2_register_u2_f_response.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_register_u2_f_response import V2RegisterU2FResponse - -class TestV2RegisterU2FResponse(unittest.TestCase): - """V2RegisterU2FResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2RegisterU2FResponse: - """Test V2RegisterU2FResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2RegisterU2FResponse` - """ - model = V2RegisterU2FResponse() - if include_optional: - return V2RegisterU2FResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - u2f_id = '163840776835432705', - public_key_credential_creation_options = {"publicKey":{"attestation":"none","authenticatorSelection":{"userVerification":"required"},"challenge":"XaMYwWOZ5hj6pwtwJJlpcI-ExkO5TxevBMG4R8DoKQQ","excludeCredentials":[{"id":"tVp1QfYhT8DkyEHVrv7blnpAo2YJzbZgZNBf7zPs6CI","type":"public-key"}],"pubKeyCredParams":[{"alg":-7,"type":"public-key"}],"rp":{"id":"localhost","name":"ZITADEL"},"timeout":300000,"user":{"displayName":"Tim Mohlmann","id":"MjE1NTk4MDAwNDY0OTk4OTQw","name":"tim"}}} - ) - else: - return V2RegisterU2FResponse( - ) - """ - - def testV2RegisterU2FResponse(self): - """Test V2RegisterU2FResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_remove_idp_link_response.py b/test/test_v2_remove_idp_link_response.py deleted file mode 100644 index 34a8f8a7..00000000 --- a/test/test_v2_remove_idp_link_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_remove_idp_link_response import V2RemoveIDPLinkResponse - -class TestV2RemoveIDPLinkResponse(unittest.TestCase): - """V2RemoveIDPLinkResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2RemoveIDPLinkResponse: - """Test V2RemoveIDPLinkResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2RemoveIDPLinkResponse` - """ - model = V2RemoveIDPLinkResponse() - if include_optional: - return V2RemoveIDPLinkResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2RemoveIDPLinkResponse( - ) - """ - - def testV2RemoveIDPLinkResponse(self): - """Test V2RemoveIDPLinkResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_remove_otp_email_response.py b/test/test_v2_remove_otp_email_response.py deleted file mode 100644 index 43ec7297..00000000 --- a/test/test_v2_remove_otp_email_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_remove_otp_email_response import V2RemoveOTPEmailResponse - -class TestV2RemoveOTPEmailResponse(unittest.TestCase): - """V2RemoveOTPEmailResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2RemoveOTPEmailResponse: - """Test V2RemoveOTPEmailResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2RemoveOTPEmailResponse` - """ - model = V2RemoveOTPEmailResponse() - if include_optional: - return V2RemoveOTPEmailResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2RemoveOTPEmailResponse( - ) - """ - - def testV2RemoveOTPEmailResponse(self): - """Test V2RemoveOTPEmailResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_remove_otpsms_response.py b/test/test_v2_remove_otpsms_response.py deleted file mode 100644 index 8e6915ce..00000000 --- a/test/test_v2_remove_otpsms_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_remove_otpsms_response import V2RemoveOTPSMSResponse - -class TestV2RemoveOTPSMSResponse(unittest.TestCase): - """V2RemoveOTPSMSResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2RemoveOTPSMSResponse: - """Test V2RemoveOTPSMSResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2RemoveOTPSMSResponse` - """ - model = V2RemoveOTPSMSResponse() - if include_optional: - return V2RemoveOTPSMSResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2RemoveOTPSMSResponse( - ) - """ - - def testV2RemoveOTPSMSResponse(self): - """Test V2RemoveOTPSMSResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_remove_passkey_response.py b/test/test_v2_remove_passkey_response.py deleted file mode 100644 index 383c334b..00000000 --- a/test/test_v2_remove_passkey_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_remove_passkey_response import V2RemovePasskeyResponse - -class TestV2RemovePasskeyResponse(unittest.TestCase): - """V2RemovePasskeyResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2RemovePasskeyResponse: - """Test V2RemovePasskeyResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2RemovePasskeyResponse` - """ - model = V2RemovePasskeyResponse() - if include_optional: - return V2RemovePasskeyResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2RemovePasskeyResponse( - ) - """ - - def testV2RemovePasskeyResponse(self): - """Test V2RemovePasskeyResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_remove_phone_response.py b/test/test_v2_remove_phone_response.py deleted file mode 100644 index 84791ec5..00000000 --- a/test/test_v2_remove_phone_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_remove_phone_response import V2RemovePhoneResponse - -class TestV2RemovePhoneResponse(unittest.TestCase): - """V2RemovePhoneResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2RemovePhoneResponse: - """Test V2RemovePhoneResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2RemovePhoneResponse` - """ - model = V2RemovePhoneResponse() - if include_optional: - return V2RemovePhoneResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2RemovePhoneResponse( - ) - """ - - def testV2RemovePhoneResponse(self): - """Test V2RemovePhoneResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_remove_totp_response.py b/test/test_v2_remove_totp_response.py deleted file mode 100644 index 98b47a25..00000000 --- a/test/test_v2_remove_totp_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_remove_totp_response import V2RemoveTOTPResponse - -class TestV2RemoveTOTPResponse(unittest.TestCase): - """V2RemoveTOTPResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2RemoveTOTPResponse: - """Test V2RemoveTOTPResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2RemoveTOTPResponse` - """ - model = V2RemoveTOTPResponse() - if include_optional: - return V2RemoveTOTPResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2RemoveTOTPResponse( - ) - """ - - def testV2RemoveTOTPResponse(self): - """Test V2RemoveTOTPResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_remove_u2_f_response.py b/test/test_v2_remove_u2_f_response.py deleted file mode 100644 index 57233e59..00000000 --- a/test/test_v2_remove_u2_f_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_remove_u2_f_response import V2RemoveU2FResponse - -class TestV2RemoveU2FResponse(unittest.TestCase): - """V2RemoveU2FResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2RemoveU2FResponse: - """Test V2RemoveU2FResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2RemoveU2FResponse` - """ - model = V2RemoveU2FResponse() - if include_optional: - return V2RemoveU2FResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2RemoveU2FResponse( - ) - """ - - def testV2RemoveU2FResponse(self): - """Test V2RemoveU2FResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_request_challenges.py b/test/test_v2_request_challenges.py deleted file mode 100644 index b012750a..00000000 --- a/test/test_v2_request_challenges.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_request_challenges import V2RequestChallenges - -class TestV2RequestChallenges(unittest.TestCase): - """V2RequestChallenges unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2RequestChallenges: - """Test V2RequestChallenges - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2RequestChallenges` - """ - model = V2RequestChallenges() - if include_optional: - return V2RequestChallenges( - web_auth_n = zitadel_client.models.v2_request_challenges_web_auth_n.v2RequestChallengesWebAuthN( - domain = '', - user_verification_requirement = 'USER_VERIFICATION_REQUIREMENT_UNSPECIFIED', ), - otp_sms = zitadel_client.models.request_challenges_otpsms.RequestChallengesOTPSMS( - return_code = True, ), - otp_email = zitadel_client.models.request_challenges_otp_email.RequestChallengesOTPEmail( - send_code = zitadel_client.models.otp_email_send_code.OTPEmailSendCode( - url_template = 'https://example.com/otp/verify?userID={{.UserID}}&code={{.Code}}', ), - return_code = zitadel_client.models.otp_email_return_code.OTPEmailReturnCode(), ) - ) - else: - return V2RequestChallenges( - ) - """ - - def testV2RequestChallenges(self): - """Test V2RequestChallenges""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_request_challenges_web_auth_n.py b/test/test_v2_request_challenges_web_auth_n.py deleted file mode 100644 index 6bf7925b..00000000 --- a/test/test_v2_request_challenges_web_auth_n.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_request_challenges_web_auth_n import V2RequestChallengesWebAuthN - -class TestV2RequestChallengesWebAuthN(unittest.TestCase): - """V2RequestChallengesWebAuthN unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2RequestChallengesWebAuthN: - """Test V2RequestChallengesWebAuthN - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2RequestChallengesWebAuthN` - """ - model = V2RequestChallengesWebAuthN() - if include_optional: - return V2RequestChallengesWebAuthN( - domain = '', - user_verification_requirement = 'USER_VERIFICATION_REQUIREMENT_UNSPECIFIED' - ) - else: - return V2RequestChallengesWebAuthN( - domain = '', - user_verification_requirement = 'USER_VERIFICATION_REQUIREMENT_UNSPECIFIED', - ) - """ - - def testV2RequestChallengesWebAuthN(self): - """Test V2RequestChallengesWebAuthN""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_resend_email_code_response.py b/test/test_v2_resend_email_code_response.py deleted file mode 100644 index bfee2ea9..00000000 --- a/test/test_v2_resend_email_code_response.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_resend_email_code_response import V2ResendEmailCodeResponse - -class TestV2ResendEmailCodeResponse(unittest.TestCase): - """V2ResendEmailCodeResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2ResendEmailCodeResponse: - """Test V2ResendEmailCodeResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2ResendEmailCodeResponse` - """ - model = V2ResendEmailCodeResponse() - if include_optional: - return V2ResendEmailCodeResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - verification_code = '' - ) - else: - return V2ResendEmailCodeResponse( - ) - """ - - def testV2ResendEmailCodeResponse(self): - """Test V2ResendEmailCodeResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_resend_invite_code_response.py b/test/test_v2_resend_invite_code_response.py deleted file mode 100644 index 74ce39c8..00000000 --- a/test/test_v2_resend_invite_code_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_resend_invite_code_response import V2ResendInviteCodeResponse - -class TestV2ResendInviteCodeResponse(unittest.TestCase): - """V2ResendInviteCodeResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2ResendInviteCodeResponse: - """Test V2ResendInviteCodeResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2ResendInviteCodeResponse` - """ - model = V2ResendInviteCodeResponse() - if include_optional: - return V2ResendInviteCodeResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2ResendInviteCodeResponse( - ) - """ - - def testV2ResendInviteCodeResponse(self): - """Test V2ResendInviteCodeResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_resend_phone_code_response.py b/test/test_v2_resend_phone_code_response.py deleted file mode 100644 index e1b13214..00000000 --- a/test/test_v2_resend_phone_code_response.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_resend_phone_code_response import V2ResendPhoneCodeResponse - -class TestV2ResendPhoneCodeResponse(unittest.TestCase): - """V2ResendPhoneCodeResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2ResendPhoneCodeResponse: - """Test V2ResendPhoneCodeResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2ResendPhoneCodeResponse` - """ - model = V2ResendPhoneCodeResponse() - if include_optional: - return V2ResendPhoneCodeResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - verification_code = '' - ) - else: - return V2ResendPhoneCodeResponse( - ) - """ - - def testV2ResendPhoneCodeResponse(self): - """Test V2ResendPhoneCodeResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_reset_instance_features_response.py b/test/test_v2_reset_instance_features_response.py deleted file mode 100644 index b86296b5..00000000 --- a/test/test_v2_reset_instance_features_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_reset_instance_features_response import V2ResetInstanceFeaturesResponse - -class TestV2ResetInstanceFeaturesResponse(unittest.TestCase): - """V2ResetInstanceFeaturesResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2ResetInstanceFeaturesResponse: - """Test V2ResetInstanceFeaturesResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2ResetInstanceFeaturesResponse` - """ - model = V2ResetInstanceFeaturesResponse() - if include_optional: - return V2ResetInstanceFeaturesResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2ResetInstanceFeaturesResponse( - ) - """ - - def testV2ResetInstanceFeaturesResponse(self): - """Test V2ResetInstanceFeaturesResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_reset_organization_features_response.py b/test/test_v2_reset_organization_features_response.py deleted file mode 100644 index 32e6b22e..00000000 --- a/test/test_v2_reset_organization_features_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_reset_organization_features_response import V2ResetOrganizationFeaturesResponse - -class TestV2ResetOrganizationFeaturesResponse(unittest.TestCase): - """V2ResetOrganizationFeaturesResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2ResetOrganizationFeaturesResponse: - """Test V2ResetOrganizationFeaturesResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2ResetOrganizationFeaturesResponse` - """ - model = V2ResetOrganizationFeaturesResponse() - if include_optional: - return V2ResetOrganizationFeaturesResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2ResetOrganizationFeaturesResponse( - ) - """ - - def testV2ResetOrganizationFeaturesResponse(self): - """Test V2ResetOrganizationFeaturesResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_reset_system_features_response.py b/test/test_v2_reset_system_features_response.py deleted file mode 100644 index 8a4d656c..00000000 --- a/test/test_v2_reset_system_features_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_reset_system_features_response import V2ResetSystemFeaturesResponse - -class TestV2ResetSystemFeaturesResponse(unittest.TestCase): - """V2ResetSystemFeaturesResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2ResetSystemFeaturesResponse: - """Test V2ResetSystemFeaturesResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2ResetSystemFeaturesResponse` - """ - model = V2ResetSystemFeaturesResponse() - if include_optional: - return V2ResetSystemFeaturesResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2ResetSystemFeaturesResponse( - ) - """ - - def testV2ResetSystemFeaturesResponse(self): - """Test V2ResetSystemFeaturesResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_reset_user_features_response.py b/test/test_v2_reset_user_features_response.py deleted file mode 100644 index e79f101a..00000000 --- a/test/test_v2_reset_user_features_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_reset_user_features_response import V2ResetUserFeaturesResponse - -class TestV2ResetUserFeaturesResponse(unittest.TestCase): - """V2ResetUserFeaturesResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2ResetUserFeaturesResponse: - """Test V2ResetUserFeaturesResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2ResetUserFeaturesResponse` - """ - model = V2ResetUserFeaturesResponse() - if include_optional: - return V2ResetUserFeaturesResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2ResetUserFeaturesResponse( - ) - """ - - def testV2ResetUserFeaturesResponse(self): - """Test V2ResetUserFeaturesResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_resource_owner_type.py b/test/test_v2_resource_owner_type.py deleted file mode 100644 index 51a5a086..00000000 --- a/test/test_v2_resource_owner_type.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_resource_owner_type import V2ResourceOwnerType - -class TestV2ResourceOwnerType(unittest.TestCase): - """V2ResourceOwnerType unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2ResourceOwnerType(self): - """Test V2ResourceOwnerType""" - # inst = V2ResourceOwnerType() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_retrieve_identity_provider_intent_response.py b/test/test_v2_retrieve_identity_provider_intent_response.py deleted file mode 100644 index 183defa6..00000000 --- a/test/test_v2_retrieve_identity_provider_intent_response.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_retrieve_identity_provider_intent_response import V2RetrieveIdentityProviderIntentResponse - -class TestV2RetrieveIdentityProviderIntentResponse(unittest.TestCase): - """V2RetrieveIdentityProviderIntentResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2RetrieveIdentityProviderIntentResponse: - """Test V2RetrieveIdentityProviderIntentResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2RetrieveIdentityProviderIntentResponse` - """ - model = V2RetrieveIdentityProviderIntentResponse() - if include_optional: - return V2RetrieveIdentityProviderIntentResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - idp_information = zitadel_client.models.v2_idp_information.v2IDPInformation( - oauth = zitadel_client.models.v2_idpo_auth_access_information.v2IDPOAuthAccessInformation( - access_token = '', - id_token = '', ), - ldap = zitadel_client.models.v2_idpldap_access_information.v2IDPLDAPAccessInformation( - attributes = zitadel_client.models.attributes.attributes(), ), - saml = zitadel_client.models.v2_idpsaml_access_information.v2IDPSAMLAccessInformation( - assertion = 'YQ==', ), - idp_id = 'd654e6ba-70a3-48ef-a95d-37c8d8a7901a', - user_id = '6516849804890468048461403518', - user_name = 'user@external.com', - raw_information = zitadel_client.models.raw_information.rawInformation(), ), - user_id = '163840776835432345' - ) - else: - return V2RetrieveIdentityProviderIntentResponse( - ) - """ - - def testV2RetrieveIdentityProviderIntentResponse(self): - """Test V2RetrieveIdentityProviderIntentResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_saml_binding.py b/test/test_v2_saml_binding.py deleted file mode 100644 index 1a2b0e26..00000000 --- a/test/test_v2_saml_binding.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_saml_binding import V2SAMLBinding - -class TestV2SAMLBinding(unittest.TestCase): - """V2SAMLBinding unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2SAMLBinding(self): - """Test V2SAMLBinding""" - # inst = V2SAMLBinding() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_saml_config.py b/test/test_v2_saml_config.py deleted file mode 100644 index 82e7bb5e..00000000 --- a/test/test_v2_saml_config.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_saml_config import V2SAMLConfig - -class TestV2SAMLConfig(unittest.TestCase): - """V2SAMLConfig unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SAMLConfig: - """Test V2SAMLConfig - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SAMLConfig` - """ - model = V2SAMLConfig() - if include_optional: - return V2SAMLConfig( - metadata_xml = 'YQ==', - binding = 'SAML_BINDING_UNSPECIFIED', - with_signed_request = True, - name_id_format = 'SAML_NAME_ID_FORMAT_UNSPECIFIED', - transient_mapping_attribute_name = '' - ) - else: - return V2SAMLConfig( - ) - """ - - def testV2SAMLConfig(self): - """Test V2SAMLConfig""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_saml_name_id_format.py b/test/test_v2_saml_name_id_format.py deleted file mode 100644 index 1aef89b8..00000000 --- a/test/test_v2_saml_name_id_format.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_saml_name_id_format import V2SAMLNameIDFormat - -class TestV2SAMLNameIDFormat(unittest.TestCase): - """V2SAMLNameIDFormat unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2SAMLNameIDFormat(self): - """Test V2SAMLNameIDFormat""" - # inst = V2SAMLNameIDFormat() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_search_query.py b/test/test_v2_search_query.py deleted file mode 100644 index 370a591c..00000000 --- a/test/test_v2_search_query.py +++ /dev/null @@ -1,63 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_search_query import V2SearchQuery - -class TestV2SearchQuery(unittest.TestCase): - """V2SearchQuery unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SearchQuery: - """Test V2SearchQuery - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SearchQuery` - """ - model = V2SearchQuery() - if include_optional: - return V2SearchQuery( - ids_query = zitadel_client.models.v2_ids_query.v2IDsQuery( - ids = [ - '' - ], ), - user_id_query = zitadel_client.models.v2_user_id_query.v2UserIDQuery( - id = '', ), - creation_date_query = zitadel_client.models.v2_creation_date_query.v2CreationDateQuery( - creation_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - method = 'TIMESTAMP_QUERY_METHOD_EQUALS', ), - creator_query = zitadel_client.models.v2_creator_query.v2CreatorQuery( - id = '69629023906488334', ), - user_agent_query = zitadel_client.models.v2_user_agent_query.v2UserAgentQuery( - fingerprint_id = '69629023906488334', ) - ) - else: - return V2SearchQuery( - ) - """ - - def testV2SearchQuery(self): - """Test V2SearchQuery""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_search_query1.py b/test/test_v2_search_query1.py deleted file mode 100644 index 657c9394..00000000 --- a/test/test_v2_search_query1.py +++ /dev/null @@ -1,205 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_search_query1 import V2SearchQuery1 - -class TestV2SearchQuery1(unittest.TestCase): - """V2SearchQuery1 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SearchQuery1: - """Test V2SearchQuery1 - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SearchQuery1` - """ - model = V2SearchQuery1() - if include_optional: - return V2SearchQuery1( - user_name_query = zitadel_client.models.v2_user_name_query.v2UserNameQuery( - user_name = 'gigi-giraffe', - method = 'TEXT_QUERY_METHOD_EQUALS', ), - first_name_query = zitadel_client.models.v2_first_name_query.v2FirstNameQuery( - first_name = 'Gigi', - method = 'TEXT_QUERY_METHOD_EQUALS', ), - last_name_query = zitadel_client.models.v2_last_name_query.v2LastNameQuery( - last_name = 'Giraffe', - method = 'TEXT_QUERY_METHOD_EQUALS', ), - nick_name_query = zitadel_client.models.v2_nick_name_query.v2NickNameQuery( - nick_name = 'Gigi', - method = 'TEXT_QUERY_METHOD_EQUALS', ), - display_name_query = zitadel_client.models.v2_display_name_query.v2DisplayNameQuery( - display_name = 'Gigi Giraffe', - method = 'TEXT_QUERY_METHOD_EQUALS', ), - email_query = zitadel_client.models.v2_email_query.v2EmailQuery( - email_address = 'gigi@zitadel.com', - method = 'TEXT_QUERY_METHOD_EQUALS', ), - state_query = zitadel_client.models.v2_state_query.v2StateQuery( - state = 'USER_STATE_UNSPECIFIED', ), - type_query = zitadel_client.models.v2_type_query.v2TypeQuery( - type = 'TYPE_UNSPECIFIED', ), - login_name_query = zitadel_client.models.v2_login_name_query.v2LoginNameQuery( - login_name = 'gigi@zitadel.cloud', - method = 'TEXT_QUERY_METHOD_EQUALS', ), - in_user_ids_query = zitadel_client.models.v2_in_user_id_query.v2InUserIDQuery( - user_ids = ["69629023906488334","69622366012355662"], ), - or_query = zitadel_client.models.v2_or_query.v2OrQuery( - queries = [ - zitadel_client.models.v2_search_query_1.v2SearchQuery_1( - user_name_query = zitadel_client.models.v2_user_name_query.v2UserNameQuery( - user_name = 'gigi-giraffe', - method = 'TEXT_QUERY_METHOD_EQUALS', ), - first_name_query = zitadel_client.models.v2_first_name_query.v2FirstNameQuery( - first_name = 'Gigi', ), - last_name_query = zitadel_client.models.v2_last_name_query.v2LastNameQuery( - last_name = 'Giraffe', ), - nick_name_query = zitadel_client.models.v2_nick_name_query.v2NickNameQuery( - nick_name = 'Gigi', ), - display_name_query = zitadel_client.models.v2_display_name_query.v2DisplayNameQuery( - display_name = 'Gigi Giraffe', ), - email_query = zitadel_client.models.v2_email_query.v2EmailQuery( - email_address = 'gigi@zitadel.com', ), - state_query = zitadel_client.models.v2_state_query.v2StateQuery( - state = 'USER_STATE_UNSPECIFIED', ), - type_query = zitadel_client.models.v2_type_query.v2TypeQuery( - type = 'TYPE_UNSPECIFIED', ), - login_name_query = zitadel_client.models.v2_login_name_query.v2LoginNameQuery( - login_name = 'gigi@zitadel.cloud', ), - in_user_ids_query = zitadel_client.models.v2_in_user_id_query.v2InUserIDQuery( - user_ids = ["69629023906488334","69622366012355662"], ), - and_query = zitadel_client.models.v2_and_query.v2AndQuery(), - not_query = zitadel_client.models.v2_not_query.v2NotQuery( - query = zitadel_client.models.v2_search_query_1.v2SearchQuery_1( - in_user_emails_query = zitadel_client.models.v2_in_user_emails_query.v2InUserEmailsQuery( - user_emails = ["test@example.com","test@example.org"], ), - organization_id_query = zitadel_client.models.v2_organization_id_query.v2OrganizationIDQuery( - id = '69629023906488334', ), - phone_query = zitadel_client.models.v2_phone_query.v2PhoneQuery( - number = '+41791234567', ), ), ), - in_user_emails_query = zitadel_client.models.v2_in_user_emails_query.v2InUserEmailsQuery( - user_emails = ["test@example.com","test@example.org"], ), - organization_id_query = zitadel_client.models.v2_organization_id_query.v2OrganizationIDQuery( - id = '69629023906488334', ), - phone_query = zitadel_client.models.v2_phone_query.v2PhoneQuery( - number = '+41791234567', ), ) - ], ), - and_query = zitadel_client.models.v2_and_query.v2AndQuery( - queries = [ - zitadel_client.models.v2_search_query_1.v2SearchQuery_1( - user_name_query = zitadel_client.models.v2_user_name_query.v2UserNameQuery( - user_name = 'gigi-giraffe', - method = 'TEXT_QUERY_METHOD_EQUALS', ), - first_name_query = zitadel_client.models.v2_first_name_query.v2FirstNameQuery( - first_name = 'Gigi', ), - last_name_query = zitadel_client.models.v2_last_name_query.v2LastNameQuery( - last_name = 'Giraffe', ), - nick_name_query = zitadel_client.models.v2_nick_name_query.v2NickNameQuery( - nick_name = 'Gigi', ), - display_name_query = zitadel_client.models.v2_display_name_query.v2DisplayNameQuery( - display_name = 'Gigi Giraffe', ), - email_query = zitadel_client.models.v2_email_query.v2EmailQuery( - email_address = 'gigi@zitadel.com', ), - state_query = zitadel_client.models.v2_state_query.v2StateQuery( - state = 'USER_STATE_UNSPECIFIED', ), - type_query = zitadel_client.models.v2_type_query.v2TypeQuery( - type = 'TYPE_UNSPECIFIED', ), - login_name_query = zitadel_client.models.v2_login_name_query.v2LoginNameQuery( - login_name = 'gigi@zitadel.cloud', ), - in_user_ids_query = zitadel_client.models.v2_in_user_id_query.v2InUserIDQuery( - user_ids = ["69629023906488334","69622366012355662"], ), - or_query = zitadel_client.models.v2_or_query.v2OrQuery(), - not_query = zitadel_client.models.v2_not_query.v2NotQuery( - query = zitadel_client.models.v2_search_query_1.v2SearchQuery_1( - in_user_emails_query = zitadel_client.models.v2_in_user_emails_query.v2InUserEmailsQuery( - user_emails = ["test@example.com","test@example.org"], ), - organization_id_query = zitadel_client.models.v2_organization_id_query.v2OrganizationIDQuery( - id = '69629023906488334', ), - phone_query = zitadel_client.models.v2_phone_query.v2PhoneQuery( - number = '+41791234567', ), ), ), - in_user_emails_query = zitadel_client.models.v2_in_user_emails_query.v2InUserEmailsQuery( - user_emails = ["test@example.com","test@example.org"], ), - organization_id_query = zitadel_client.models.v2_organization_id_query.v2OrganizationIDQuery( - id = '69629023906488334', ), - phone_query = zitadel_client.models.v2_phone_query.v2PhoneQuery( - number = '+41791234567', ), ) - ], ), - not_query = zitadel_client.models.v2_not_query.v2NotQuery( - query = zitadel_client.models.v2_search_query_1.v2SearchQuery_1( - user_name_query = zitadel_client.models.v2_user_name_query.v2UserNameQuery( - user_name = 'gigi-giraffe', - method = 'TEXT_QUERY_METHOD_EQUALS', ), - first_name_query = zitadel_client.models.v2_first_name_query.v2FirstNameQuery( - first_name = 'Gigi', ), - last_name_query = zitadel_client.models.v2_last_name_query.v2LastNameQuery( - last_name = 'Giraffe', ), - nick_name_query = zitadel_client.models.v2_nick_name_query.v2NickNameQuery( - nick_name = 'Gigi', ), - display_name_query = zitadel_client.models.v2_display_name_query.v2DisplayNameQuery( - display_name = 'Gigi Giraffe', ), - email_query = zitadel_client.models.v2_email_query.v2EmailQuery( - email_address = 'gigi@zitadel.com', ), - state_query = zitadel_client.models.v2_state_query.v2StateQuery( - state = 'USER_STATE_UNSPECIFIED', ), - type_query = zitadel_client.models.v2_type_query.v2TypeQuery( - type = 'TYPE_UNSPECIFIED', ), - login_name_query = zitadel_client.models.v2_login_name_query.v2LoginNameQuery( - login_name = 'gigi@zitadel.cloud', ), - in_user_ids_query = zitadel_client.models.v2_in_user_id_query.v2InUserIDQuery( - user_ids = ["69629023906488334","69622366012355662"], ), - or_query = zitadel_client.models.v2_or_query.v2OrQuery( - queries = [ - zitadel_client.models.v2_search_query_1.v2SearchQuery_1( - and_query = zitadel_client.models.v2_and_query.v2AndQuery(), - in_user_emails_query = zitadel_client.models.v2_in_user_emails_query.v2InUserEmailsQuery( - user_emails = ["test@example.com","test@example.org"], ), - organization_id_query = zitadel_client.models.v2_organization_id_query.v2OrganizationIDQuery( - id = '69629023906488334', ), - phone_query = zitadel_client.models.v2_phone_query.v2PhoneQuery( - number = '+41791234567', ), ) - ], ), - and_query = zitadel_client.models.v2_and_query.v2AndQuery(), - in_user_emails_query = zitadel_client.models.v2_in_user_emails_query.v2InUserEmailsQuery( - user_emails = ["test@example.com","test@example.org"], ), - organization_id_query = zitadel_client.models.v2_organization_id_query.v2OrganizationIDQuery( - id = '69629023906488334', ), - phone_query = zitadel_client.models.v2_phone_query.v2PhoneQuery( - number = '+41791234567', ), ), ), - in_user_emails_query = zitadel_client.models.v2_in_user_emails_query.v2InUserEmailsQuery( - user_emails = ["test@example.com","test@example.org"], ), - organization_id_query = zitadel_client.models.v2_organization_id_query.v2OrganizationIDQuery( - id = '69629023906488334', ), - phone_query = zitadel_client.models.v2_phone_query.v2PhoneQuery( - number = '+41791234567', - method = 'TEXT_QUERY_METHOD_EQUALS', ) - ) - else: - return V2SearchQuery1( - ) - """ - - def testV2SearchQuery1(self): - """Test V2SearchQuery1""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_second_factor_type.py b/test/test_v2_second_factor_type.py deleted file mode 100644 index d9d04dbf..00000000 --- a/test/test_v2_second_factor_type.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_second_factor_type import V2SecondFactorType - -class TestV2SecondFactorType(unittest.TestCase): - """V2SecondFactorType unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2SecondFactorType(self): - """Test V2SecondFactorType""" - # inst = V2SecondFactorType() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_security_settings.py b/test/test_v2_security_settings.py deleted file mode 100644 index 0f7ad9e3..00000000 --- a/test/test_v2_security_settings.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_security_settings import V2SecuritySettings - -class TestV2SecuritySettings(unittest.TestCase): - """V2SecuritySettings unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SecuritySettings: - """Test V2SecuritySettings - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SecuritySettings` - """ - model = V2SecuritySettings() - if include_optional: - return V2SecuritySettings( - embedded_iframe = zitadel_client.models.v2_embedded_iframe_settings.v2EmbeddedIframeSettings( - enabled = True, - allowed_origins = ["foo.bar.com","localhost:8080"], ), - enable_impersonation = False - ) - else: - return V2SecuritySettings( - ) - """ - - def testV2SecuritySettings(self): - """Test V2SecuritySettings""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_send_email_code_response.py b/test/test_v2_send_email_code_response.py deleted file mode 100644 index e32c94ed..00000000 --- a/test/test_v2_send_email_code_response.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_send_email_code_response import V2SendEmailCodeResponse - -class TestV2SendEmailCodeResponse(unittest.TestCase): - """V2SendEmailCodeResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SendEmailCodeResponse: - """Test V2SendEmailCodeResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SendEmailCodeResponse` - """ - model = V2SendEmailCodeResponse() - if include_optional: - return V2SendEmailCodeResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - verification_code = '' - ) - else: - return V2SendEmailCodeResponse( - ) - """ - - def testV2SendEmailCodeResponse(self): - """Test V2SendEmailCodeResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_send_email_verification_code.py b/test/test_v2_send_email_verification_code.py deleted file mode 100644 index f374ee9f..00000000 --- a/test/test_v2_send_email_verification_code.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_send_email_verification_code import V2SendEmailVerificationCode - -class TestV2SendEmailVerificationCode(unittest.TestCase): - """V2SendEmailVerificationCode unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SendEmailVerificationCode: - """Test V2SendEmailVerificationCode - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SendEmailVerificationCode` - """ - model = V2SendEmailVerificationCode() - if include_optional: - return V2SendEmailVerificationCode( - url_template = 'https://example.com/email/verify?userID={{.UserID}}&code={{.Code}}&orgID={{.OrgID}}' - ) - else: - return V2SendEmailVerificationCode( - ) - """ - - def testV2SendEmailVerificationCode(self): - """Test V2SendEmailVerificationCode""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_send_invite_code.py b/test/test_v2_send_invite_code.py deleted file mode 100644 index bd49f1f4..00000000 --- a/test/test_v2_send_invite_code.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_send_invite_code import V2SendInviteCode - -class TestV2SendInviteCode(unittest.TestCase): - """V2SendInviteCode unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SendInviteCode: - """Test V2SendInviteCode - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SendInviteCode` - """ - model = V2SendInviteCode() - if include_optional: - return V2SendInviteCode( - url_template = 'https://example.com/user/invite?userID={{.UserID}}&code={{.Code}}&orgID={{.OrgID}}', - application_name = 'CustomerPortal' - ) - else: - return V2SendInviteCode( - ) - """ - - def testV2SendInviteCode(self): - """Test V2SendInviteCode""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_send_passkey_registration_link.py b/test/test_v2_send_passkey_registration_link.py deleted file mode 100644 index 3de0c7a7..00000000 --- a/test/test_v2_send_passkey_registration_link.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_send_passkey_registration_link import V2SendPasskeyRegistrationLink - -class TestV2SendPasskeyRegistrationLink(unittest.TestCase): - """V2SendPasskeyRegistrationLink unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SendPasskeyRegistrationLink: - """Test V2SendPasskeyRegistrationLink - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SendPasskeyRegistrationLink` - """ - model = V2SendPasskeyRegistrationLink() - if include_optional: - return V2SendPasskeyRegistrationLink( - url_template = 'https://example.com/passkey/register?userID={{.UserID}}&orgID={{.OrgID}}&codeID={{.CodeID}}&code={{.Code}}' - ) - else: - return V2SendPasskeyRegistrationLink( - ) - """ - - def testV2SendPasskeyRegistrationLink(self): - """Test V2SendPasskeyRegistrationLink""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_send_password_reset_link.py b/test/test_v2_send_password_reset_link.py deleted file mode 100644 index 05baab65..00000000 --- a/test/test_v2_send_password_reset_link.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_send_password_reset_link import V2SendPasswordResetLink - -class TestV2SendPasswordResetLink(unittest.TestCase): - """V2SendPasswordResetLink unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SendPasswordResetLink: - """Test V2SendPasswordResetLink - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SendPasswordResetLink` - """ - model = V2SendPasswordResetLink() - if include_optional: - return V2SendPasswordResetLink( - notification_type = 'NOTIFICATION_TYPE_Unspecified', - url_template = 'https://example.com/password/changey?userID={{.UserID}}&code={{.Code}}&orgID={{.OrgID}}' - ) - else: - return V2SendPasswordResetLink( - ) - """ - - def testV2SendPasswordResetLink(self): - """Test V2SendPasswordResetLink""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_session.py b/test/test_v2_session.py deleted file mode 100644 index 5390966f..00000000 --- a/test/test_v2_session.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_session import V2Session - -class TestV2Session(unittest.TestCase): - """V2Session unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2Session: - """Test V2Session - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2Session` - """ - model = V2Session() - if include_optional: - return V2Session( - session_id = '163840776835432705', - session_token = '0' - ) - else: - return V2Session( - ) - """ - - def testV2Session(self): - """Test V2Session""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_session1.py b/test/test_v2_session1.py deleted file mode 100644 index 0a90da96..00000000 --- a/test/test_v2_session1.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_session1 import V2Session1 - -class TestV2Session1(unittest.TestCase): - """V2Session1 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2Session1: - """Test V2Session1 - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2Session1` - """ - model = V2Session1() - if include_optional: - return V2Session1( - id = '', - creation_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - sequence = '', - factors = zitadel_client.models.v2_factors.v2Factors( - user = zitadel_client.models.v2_user_factor.v2UserFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - id = '', - login_name = '', - display_name = '', - organization_id = '', ), - password = zitadel_client.models.v2_password_factor.v2PasswordFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), - web_auth_n = zitadel_client.models.v2_web_auth_n_factor.v2WebAuthNFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - user_verified = True, ), - intent = zitadel_client.models.v2_intent_factor.v2IntentFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), - totp = zitadel_client.models.v2_totp_factor.v2TOTPFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), - otp_sms = zitadel_client.models.v2_otp_factor.v2OTPFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), - otp_email = zitadel_client.models.v2_otp_factor.v2OTPFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ), - metadata = { - 'key' : 'YQ==' - }, - user_agent = zitadel_client.models.v2_user_agent.v2UserAgent( - fingerprint_id = '', - ip = '', - description = '', - header = { - 'key' : zitadel_client.models.user_agent_header_values.UserAgentHeaderValues( - values = [ - '' - ], ) - }, ), - expiration_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') - ) - else: - return V2Session1( - ) - """ - - def testV2Session1(self): - """Test V2Session1""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_session_field_name.py b/test/test_v2_session_field_name.py deleted file mode 100644 index fe071240..00000000 --- a/test/test_v2_session_field_name.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_session_field_name import V2SessionFieldName - -class TestV2SessionFieldName(unittest.TestCase): - """V2SessionFieldName unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2SessionFieldName(self): - """Test V2SessionFieldName""" - # inst = V2SessionFieldName() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_set_email_response.py b/test/test_v2_set_email_response.py deleted file mode 100644 index ca7b5040..00000000 --- a/test/test_v2_set_email_response.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_set_email_response import V2SetEmailResponse - -class TestV2SetEmailResponse(unittest.TestCase): - """V2SetEmailResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SetEmailResponse: - """Test V2SetEmailResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SetEmailResponse` - """ - model = V2SetEmailResponse() - if include_optional: - return V2SetEmailResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - verification_code = '' - ) - else: - return V2SetEmailResponse( - ) - """ - - def testV2SetEmailResponse(self): - """Test V2SetEmailResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_set_human_email.py b/test/test_v2_set_human_email.py deleted file mode 100644 index 0bdbeb89..00000000 --- a/test/test_v2_set_human_email.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_set_human_email import V2SetHumanEmail - -class TestV2SetHumanEmail(unittest.TestCase): - """V2SetHumanEmail unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SetHumanEmail: - """Test V2SetHumanEmail - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SetHumanEmail` - """ - model = V2SetHumanEmail() - if include_optional: - return V2SetHumanEmail( - email = 'mini@mouse.com', - send_code = zitadel_client.models.v2_send_email_verification_code.v2SendEmailVerificationCode( - url_template = 'https://example.com/email/verify?userID={{.UserID}}&code={{.Code}}&orgID={{.OrgID}}', ), - return_code = zitadel_client.models.v2_return_email_verification_code.v2ReturnEmailVerificationCode(), - is_verified = True - ) - else: - return V2SetHumanEmail( - email = 'mini@mouse.com', - ) - """ - - def testV2SetHumanEmail(self): - """Test V2SetHumanEmail""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_set_human_email1.py b/test/test_v2_set_human_email1.py deleted file mode 100644 index 117cb129..00000000 --- a/test/test_v2_set_human_email1.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_set_human_email1 import V2SetHumanEmail1 - -class TestV2SetHumanEmail1(unittest.TestCase): - """V2SetHumanEmail1 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SetHumanEmail1: - """Test V2SetHumanEmail1 - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SetHumanEmail1` - """ - model = V2SetHumanEmail1() - if include_optional: - return V2SetHumanEmail1( - email = 'mini@mouse.com', - send_code = zitadel_client.models.v2_send_email_verification_code.v2SendEmailVerificationCode( - url_template = 'https://example.com/email/verify?userID={{.UserID}}&code={{.Code}}&orgID={{.OrgID}}', ), - return_code = zitadel_client.models.v2_return_email_verification_code.v2ReturnEmailVerificationCode(), - is_verified = True - ) - else: - return V2SetHumanEmail1( - email = 'mini@mouse.com', - ) - """ - - def testV2SetHumanEmail1(self): - """Test V2SetHumanEmail1""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_set_human_phone.py b/test/test_v2_set_human_phone.py deleted file mode 100644 index e2191452..00000000 --- a/test/test_v2_set_human_phone.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_set_human_phone import V2SetHumanPhone - -class TestV2SetHumanPhone(unittest.TestCase): - """V2SetHumanPhone unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SetHumanPhone: - """Test V2SetHumanPhone - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SetHumanPhone` - """ - model = V2SetHumanPhone() - if include_optional: - return V2SetHumanPhone( - phone = '+41791234567', - send_code = zitadel_client.models.v2_send_phone_verification_code.v2SendPhoneVerificationCode(), - return_code = zitadel_client.models.v2_return_phone_verification_code.v2ReturnPhoneVerificationCode(), - is_verified = True - ) - else: - return V2SetHumanPhone( - ) - """ - - def testV2SetHumanPhone(self): - """Test V2SetHumanPhone""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_set_human_phone1.py b/test/test_v2_set_human_phone1.py deleted file mode 100644 index 6568c297..00000000 --- a/test/test_v2_set_human_phone1.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_set_human_phone1 import V2SetHumanPhone1 - -class TestV2SetHumanPhone1(unittest.TestCase): - """V2SetHumanPhone1 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SetHumanPhone1: - """Test V2SetHumanPhone1 - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SetHumanPhone1` - """ - model = V2SetHumanPhone1() - if include_optional: - return V2SetHumanPhone1( - phone = '+41791234567', - send_code = zitadel_client.models.v2_send_phone_verification_code.v2SendPhoneVerificationCode(), - return_code = zitadel_client.models.v2_return_phone_verification_code.v2ReturnPhoneVerificationCode(), - is_verified = True - ) - else: - return V2SetHumanPhone1( - ) - """ - - def testV2SetHumanPhone1(self): - """Test V2SetHumanPhone1""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_set_human_profile.py b/test/test_v2_set_human_profile.py deleted file mode 100644 index 6378def9..00000000 --- a/test/test_v2_set_human_profile.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_set_human_profile import V2SetHumanProfile - -class TestV2SetHumanProfile(unittest.TestCase): - """V2SetHumanProfile unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SetHumanProfile: - """Test V2SetHumanProfile - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SetHumanProfile` - """ - model = V2SetHumanProfile() - if include_optional: - return V2SetHumanProfile( - given_name = 'Minnie', - family_name = 'Mouse', - nick_name = 'Mini', - display_name = 'Minnie Mouse', - preferred_language = 'en', - gender = 'GENDER_UNSPECIFIED' - ) - else: - return V2SetHumanProfile( - given_name = 'Minnie', - family_name = 'Mouse', - ) - """ - - def testV2SetHumanProfile(self): - """Test V2SetHumanProfile""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_set_human_profile1.py b/test/test_v2_set_human_profile1.py deleted file mode 100644 index e9d5b64d..00000000 --- a/test/test_v2_set_human_profile1.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_set_human_profile1 import V2SetHumanProfile1 - -class TestV2SetHumanProfile1(unittest.TestCase): - """V2SetHumanProfile1 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SetHumanProfile1: - """Test V2SetHumanProfile1 - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SetHumanProfile1` - """ - model = V2SetHumanProfile1() - if include_optional: - return V2SetHumanProfile1( - given_name = 'Minnie', - family_name = 'Mouse', - nick_name = 'Mini', - display_name = 'Minnie Mouse', - preferred_language = 'en', - gender = 'GENDER_UNSPECIFIED' - ) - else: - return V2SetHumanProfile1( - given_name = 'Minnie', - family_name = 'Mouse', - ) - """ - - def testV2SetHumanProfile1(self): - """Test V2SetHumanProfile1""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_set_instance_features_request.py b/test/test_v2_set_instance_features_request.py deleted file mode 100644 index 85e9874c..00000000 --- a/test/test_v2_set_instance_features_request.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_set_instance_features_request import V2SetInstanceFeaturesRequest - -class TestV2SetInstanceFeaturesRequest(unittest.TestCase): - """V2SetInstanceFeaturesRequest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SetInstanceFeaturesRequest: - """Test V2SetInstanceFeaturesRequest - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SetInstanceFeaturesRequest` - """ - model = V2SetInstanceFeaturesRequest() - if include_optional: - return V2SetInstanceFeaturesRequest( - login_default_org = True, - oidc_trigger_introspection_projections = True, - oidc_legacy_introspection = True, - user_schema = True, - oidc_token_exchange = True, - actions = True, - improved_performance = [1], - web_key = True, - debug_oidc_parent_error = True, - oidc_single_v1_session_termination = True, - disable_user_token_event = True, - enable_back_channel_logout = True, - login_v2 = zitadel_client.models.v2_login_v2.v2LoginV2( - required = True, - base_uri = '', ), - permission_check_v2 = True - ) - else: - return V2SetInstanceFeaturesRequest( - ) - """ - - def testV2SetInstanceFeaturesRequest(self): - """Test V2SetInstanceFeaturesRequest""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_set_instance_features_response.py b/test/test_v2_set_instance_features_response.py deleted file mode 100644 index 5bc9982b..00000000 --- a/test/test_v2_set_instance_features_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_set_instance_features_response import V2SetInstanceFeaturesResponse - -class TestV2SetInstanceFeaturesResponse(unittest.TestCase): - """V2SetInstanceFeaturesResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SetInstanceFeaturesResponse: - """Test V2SetInstanceFeaturesResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SetInstanceFeaturesResponse` - """ - model = V2SetInstanceFeaturesResponse() - if include_optional: - return V2SetInstanceFeaturesResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2SetInstanceFeaturesResponse( - ) - """ - - def testV2SetInstanceFeaturesResponse(self): - """Test V2SetInstanceFeaturesResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_set_metadata_entry.py b/test/test_v2_set_metadata_entry.py deleted file mode 100644 index 205ecc9a..00000000 --- a/test/test_v2_set_metadata_entry.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_set_metadata_entry import V2SetMetadataEntry - -class TestV2SetMetadataEntry(unittest.TestCase): - """V2SetMetadataEntry unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SetMetadataEntry: - """Test V2SetMetadataEntry - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SetMetadataEntry` - """ - model = V2SetMetadataEntry() - if include_optional: - return V2SetMetadataEntry( - key = 'my-key', - value = '[B@4a67318f' - ) - else: - return V2SetMetadataEntry( - key = 'my-key', - value = '[B@4a67318f', - ) - """ - - def testV2SetMetadataEntry(self): - """Test V2SetMetadataEntry""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_set_metadata_entry1.py b/test/test_v2_set_metadata_entry1.py deleted file mode 100644 index 37d6c9b8..00000000 --- a/test/test_v2_set_metadata_entry1.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_set_metadata_entry1 import V2SetMetadataEntry1 - -class TestV2SetMetadataEntry1(unittest.TestCase): - """V2SetMetadataEntry1 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SetMetadataEntry1: - """Test V2SetMetadataEntry1 - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SetMetadataEntry1` - """ - model = V2SetMetadataEntry1() - if include_optional: - return V2SetMetadataEntry1( - key = 'my-key', - value = '[B@34448e6c' - ) - else: - return V2SetMetadataEntry1( - key = 'my-key', - value = '[B@34448e6c', - ) - """ - - def testV2SetMetadataEntry1(self): - """Test V2SetMetadataEntry1""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_set_organization_features_response.py b/test/test_v2_set_organization_features_response.py deleted file mode 100644 index 4cd2761f..00000000 --- a/test/test_v2_set_organization_features_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_set_organization_features_response import V2SetOrganizationFeaturesResponse - -class TestV2SetOrganizationFeaturesResponse(unittest.TestCase): - """V2SetOrganizationFeaturesResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SetOrganizationFeaturesResponse: - """Test V2SetOrganizationFeaturesResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SetOrganizationFeaturesResponse` - """ - model = V2SetOrganizationFeaturesResponse() - if include_optional: - return V2SetOrganizationFeaturesResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2SetOrganizationFeaturesResponse( - ) - """ - - def testV2SetOrganizationFeaturesResponse(self): - """Test V2SetOrganizationFeaturesResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_set_password_response.py b/test/test_v2_set_password_response.py deleted file mode 100644 index f48b4d58..00000000 --- a/test/test_v2_set_password_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_set_password_response import V2SetPasswordResponse - -class TestV2SetPasswordResponse(unittest.TestCase): - """V2SetPasswordResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SetPasswordResponse: - """Test V2SetPasswordResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SetPasswordResponse` - """ - model = V2SetPasswordResponse() - if include_optional: - return V2SetPasswordResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2SetPasswordResponse( - ) - """ - - def testV2SetPasswordResponse(self): - """Test V2SetPasswordResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_set_phone_response.py b/test/test_v2_set_phone_response.py deleted file mode 100644 index d284a90b..00000000 --- a/test/test_v2_set_phone_response.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_set_phone_response import V2SetPhoneResponse - -class TestV2SetPhoneResponse(unittest.TestCase): - """V2SetPhoneResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SetPhoneResponse: - """Test V2SetPhoneResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SetPhoneResponse` - """ - model = V2SetPhoneResponse() - if include_optional: - return V2SetPhoneResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - verification_code = '' - ) - else: - return V2SetPhoneResponse( - ) - """ - - def testV2SetPhoneResponse(self): - """Test V2SetPhoneResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_set_security_settings_request.py b/test/test_v2_set_security_settings_request.py deleted file mode 100644 index 9a0474f1..00000000 --- a/test/test_v2_set_security_settings_request.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_set_security_settings_request import V2SetSecuritySettingsRequest - -class TestV2SetSecuritySettingsRequest(unittest.TestCase): - """V2SetSecuritySettingsRequest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SetSecuritySettingsRequest: - """Test V2SetSecuritySettingsRequest - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SetSecuritySettingsRequest` - """ - model = V2SetSecuritySettingsRequest() - if include_optional: - return V2SetSecuritySettingsRequest( - embedded_iframe = zitadel_client.models.v2_embedded_iframe_settings.v2EmbeddedIframeSettings( - enabled = True, - allowed_origins = ["foo.bar.com","localhost:8080"], ), - enable_impersonation = True - ) - else: - return V2SetSecuritySettingsRequest( - ) - """ - - def testV2SetSecuritySettingsRequest(self): - """Test V2SetSecuritySettingsRequest""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_set_security_settings_response.py b/test/test_v2_set_security_settings_response.py deleted file mode 100644 index 375db5f5..00000000 --- a/test/test_v2_set_security_settings_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_set_security_settings_response import V2SetSecuritySettingsResponse - -class TestV2SetSecuritySettingsResponse(unittest.TestCase): - """V2SetSecuritySettingsResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SetSecuritySettingsResponse: - """Test V2SetSecuritySettingsResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SetSecuritySettingsResponse` - """ - model = V2SetSecuritySettingsResponse() - if include_optional: - return V2SetSecuritySettingsResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2SetSecuritySettingsResponse( - ) - """ - - def testV2SetSecuritySettingsResponse(self): - """Test V2SetSecuritySettingsResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_set_session_response.py b/test/test_v2_set_session_response.py deleted file mode 100644 index e52cc2bd..00000000 --- a/test/test_v2_set_session_response.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_set_session_response import V2SetSessionResponse - -class TestV2SetSessionResponse(unittest.TestCase): - """V2SetSessionResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SetSessionResponse: - """Test V2SetSessionResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SetSessionResponse` - """ - model = V2SetSessionResponse() - if include_optional: - return V2SetSessionResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - session_token = '', - challenges = zitadel_client.models.v2_challenges.v2Challenges( - web_auth_n = zitadel_client.models.v2_challenges_web_auth_n.v2ChallengesWebAuthN( - public_key_credential_request_options = {"publicKey":{"allowCredentials":[{"id":"ATmqBg-99qyOZk2zloPdJQyS2R7IkFT7v9Hoos_B_nM","type":"public-key"}],"challenge":"GAOHYz2jE69kJMYo6Laij8yWw9-dKKgbViNhfuy0StA","rpId":"localhost","timeout":300000,"userVerification":"required"}}, ), - otp_sms = '', - otp_email = '', ) - ) - else: - return V2SetSessionResponse( - ) - """ - - def testV2SetSessionResponse(self): - """Test V2SetSessionResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_set_system_features_request.py b/test/test_v2_set_system_features_request.py deleted file mode 100644 index 41f130e5..00000000 --- a/test/test_v2_set_system_features_request.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_set_system_features_request import V2SetSystemFeaturesRequest - -class TestV2SetSystemFeaturesRequest(unittest.TestCase): - """V2SetSystemFeaturesRequest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SetSystemFeaturesRequest: - """Test V2SetSystemFeaturesRequest - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SetSystemFeaturesRequest` - """ - model = V2SetSystemFeaturesRequest() - if include_optional: - return V2SetSystemFeaturesRequest( - login_default_org = True, - oidc_trigger_introspection_projections = True, - oidc_legacy_introspection = True, - user_schema = True, - oidc_token_exchange = True, - actions = True, - improved_performance = [1], - oidc_single_v1_session_termination = True, - disable_user_token_event = True, - enable_back_channel_logout = True, - login_v2 = zitadel_client.models.v2_login_v2.v2LoginV2( - required = True, - base_uri = '', ), - permission_check_v2 = True - ) - else: - return V2SetSystemFeaturesRequest( - ) - """ - - def testV2SetSystemFeaturesRequest(self): - """Test V2SetSystemFeaturesRequest""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_set_system_features_response.py b/test/test_v2_set_system_features_response.py deleted file mode 100644 index 4ecaa346..00000000 --- a/test/test_v2_set_system_features_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_set_system_features_response import V2SetSystemFeaturesResponse - -class TestV2SetSystemFeaturesResponse(unittest.TestCase): - """V2SetSystemFeaturesResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SetSystemFeaturesResponse: - """Test V2SetSystemFeaturesResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SetSystemFeaturesResponse` - """ - model = V2SetSystemFeaturesResponse() - if include_optional: - return V2SetSystemFeaturesResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2SetSystemFeaturesResponse( - ) - """ - - def testV2SetSystemFeaturesResponse(self): - """Test V2SetSystemFeaturesResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_set_user_features_response.py b/test/test_v2_set_user_features_response.py deleted file mode 100644 index abe08290..00000000 --- a/test/test_v2_set_user_features_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_set_user_features_response import V2SetUserFeaturesResponse - -class TestV2SetUserFeaturesResponse(unittest.TestCase): - """V2SetUserFeaturesResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2SetUserFeaturesResponse: - """Test V2SetUserFeaturesResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2SetUserFeaturesResponse` - """ - model = V2SetUserFeaturesResponse() - if include_optional: - return V2SetUserFeaturesResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2SetUserFeaturesResponse( - ) - """ - - def testV2SetUserFeaturesResponse(self): - """Test V2SetUserFeaturesResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_source.py b/test/test_v2_source.py deleted file mode 100644 index cd2f5d67..00000000 --- a/test/test_v2_source.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_source import V2Source - -class TestV2Source(unittest.TestCase): - """V2Source unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2Source(self): - """Test V2Source""" - # inst = V2Source() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_start_identity_provider_intent_request.py b/test/test_v2_start_identity_provider_intent_request.py deleted file mode 100644 index e9b73272..00000000 --- a/test/test_v2_start_identity_provider_intent_request.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_start_identity_provider_intent_request import V2StartIdentityProviderIntentRequest - -class TestV2StartIdentityProviderIntentRequest(unittest.TestCase): - """V2StartIdentityProviderIntentRequest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2StartIdentityProviderIntentRequest: - """Test V2StartIdentityProviderIntentRequest - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2StartIdentityProviderIntentRequest` - """ - model = V2StartIdentityProviderIntentRequest() - if include_optional: - return V2StartIdentityProviderIntentRequest( - idp_id = '163840776835432705', - urls = zitadel_client.models.v2_redirect_urls.v2RedirectURLs( - success_url = 'https://custom.com/login/idp/success', - failure_url = 'https://custom.com/login/idp/fail', ), - ldap = zitadel_client.models.v2_ldap_credentials.v2LDAPCredentials( - username = 'username', - password = 'Password1!', ) - ) - else: - return V2StartIdentityProviderIntentRequest( - ) - """ - - def testV2StartIdentityProviderIntentRequest(self): - """Test V2StartIdentityProviderIntentRequest""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_start_identity_provider_intent_response.py b/test/test_v2_start_identity_provider_intent_response.py deleted file mode 100644 index 7db8e373..00000000 --- a/test/test_v2_start_identity_provider_intent_response.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_start_identity_provider_intent_response import V2StartIdentityProviderIntentResponse - -class TestV2StartIdentityProviderIntentResponse(unittest.TestCase): - """V2StartIdentityProviderIntentResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2StartIdentityProviderIntentResponse: - """Test V2StartIdentityProviderIntentResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2StartIdentityProviderIntentResponse` - """ - model = V2StartIdentityProviderIntentResponse() - if include_optional: - return V2StartIdentityProviderIntentResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - auth_url = 'https://accounts.google.com/o/oauth2/v2/auth?client_id=clientID&callback=https%3A%2F%2Fzitadel.cloud%2Fidps%2Fcallback', - idp_intent = zitadel_client.models.v2_idp_intent.v2IDPIntent( - idp_intent_id = '163840776835432705', - idp_intent_token = 'SJKL3ioIDpo342ioqw98fjp3sdf32wahb=', - user_id = '163840776835432345', ), - post_form = 'YQ==' - ) - else: - return V2StartIdentityProviderIntentResponse( - ) - """ - - def testV2StartIdentityProviderIntentResponse(self): - """Test V2StartIdentityProviderIntentResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_state_query.py b/test/test_v2_state_query.py deleted file mode 100644 index f6845ba9..00000000 --- a/test/test_v2_state_query.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_state_query import V2StateQuery - -class TestV2StateQuery(unittest.TestCase): - """V2StateQuery unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2StateQuery: - """Test V2StateQuery - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2StateQuery` - """ - model = V2StateQuery() - if include_optional: - return V2StateQuery( - state = 'USER_STATE_UNSPECIFIED' - ) - else: - return V2StateQuery( - state = 'USER_STATE_UNSPECIFIED', - ) - """ - - def testV2StateQuery(self): - """Test V2StateQuery""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_text_query_method.py b/test/test_v2_text_query_method.py deleted file mode 100644 index dec1da3c..00000000 --- a/test/test_v2_text_query_method.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_text_query_method import V2TextQueryMethod - -class TestV2TextQueryMethod(unittest.TestCase): - """V2TextQueryMethod unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2TextQueryMethod(self): - """Test V2TextQueryMethod""" - # inst = V2TextQueryMethod() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_theme.py b/test/test_v2_theme.py deleted file mode 100644 index b295acc8..00000000 --- a/test/test_v2_theme.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_theme import V2Theme - -class TestV2Theme(unittest.TestCase): - """V2Theme unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2Theme: - """Test V2Theme - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2Theme` - """ - model = V2Theme() - if include_optional: - return V2Theme( - primary_color = '#5469d4', - background_color = '#FAFAFA', - warn_color = '#CD3D56', - font_color = '#000000', - logo_url = 'https://acme.com/assets/v1/165617850692654601/policy/label/logo-180950416321494657', - icon_url = 'https://acme.com/assets/v1/165617850692654601/policy/label/icon-180950498874178817' - ) - else: - return V2Theme( - ) - """ - - def testV2Theme(self): - """Test V2Theme""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_theme_mode.py b/test/test_v2_theme_mode.py deleted file mode 100644 index 3dd33fc9..00000000 --- a/test/test_v2_theme_mode.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_theme_mode import V2ThemeMode - -class TestV2ThemeMode(unittest.TestCase): - """V2ThemeMode unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2ThemeMode(self): - """Test V2ThemeMode""" - # inst = V2ThemeMode() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_totp_factor.py b/test/test_v2_totp_factor.py deleted file mode 100644 index 937f3dd8..00000000 --- a/test/test_v2_totp_factor.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_totp_factor import V2TOTPFactor - -class TestV2TOTPFactor(unittest.TestCase): - """V2TOTPFactor unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2TOTPFactor: - """Test V2TOTPFactor - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2TOTPFactor` - """ - model = V2TOTPFactor() - if include_optional: - return V2TOTPFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') - ) - else: - return V2TOTPFactor( - ) - """ - - def testV2TOTPFactor(self): - """Test V2TOTPFactor""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_type_query.py b/test/test_v2_type_query.py deleted file mode 100644 index e4bc139b..00000000 --- a/test/test_v2_type_query.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_type_query import V2TypeQuery - -class TestV2TypeQuery(unittest.TestCase): - """V2TypeQuery unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2TypeQuery: - """Test V2TypeQuery - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2TypeQuery` - """ - model = V2TypeQuery() - if include_optional: - return V2TypeQuery( - type = 'TYPE_UNSPECIFIED' - ) - else: - return V2TypeQuery( - type = 'TYPE_UNSPECIFIED', - ) - """ - - def testV2TypeQuery(self): - """Test V2TypeQuery""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_unlock_user_response.py b/test/test_v2_unlock_user_response.py deleted file mode 100644 index aaa24ba2..00000000 --- a/test/test_v2_unlock_user_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_unlock_user_response import V2UnlockUserResponse - -class TestV2UnlockUserResponse(unittest.TestCase): - """V2UnlockUserResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2UnlockUserResponse: - """Test V2UnlockUserResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2UnlockUserResponse` - """ - model = V2UnlockUserResponse() - if include_optional: - return V2UnlockUserResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2UnlockUserResponse( - ) - """ - - def testV2UnlockUserResponse(self): - """Test V2UnlockUserResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_update_human_user_response.py b/test/test_v2_update_human_user_response.py deleted file mode 100644 index 7d6e954a..00000000 --- a/test/test_v2_update_human_user_response.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_update_human_user_response import V2UpdateHumanUserResponse - -class TestV2UpdateHumanUserResponse(unittest.TestCase): - """V2UpdateHumanUserResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2UpdateHumanUserResponse: - """Test V2UpdateHumanUserResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2UpdateHumanUserResponse` - """ - model = V2UpdateHumanUserResponse() - if include_optional: - return V2UpdateHumanUserResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - email_code = '', - phone_code = '' - ) - else: - return V2UpdateHumanUserResponse( - ) - """ - - def testV2UpdateHumanUserResponse(self): - """Test V2UpdateHumanUserResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_user.py b/test/test_v2_user.py deleted file mode 100644 index 6f0198df..00000000 --- a/test/test_v2_user.py +++ /dev/null @@ -1,85 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_user import V2User - -class TestV2User(unittest.TestCase): - """V2User unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2User: - """Test V2User - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2User` - """ - model = V2User() - if include_optional: - return V2User( - user_id = 'd654e6ba-70a3-48ef-a95d-37c8d8a7901a', - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - state = 'USER_STATE_UNSPECIFIED', - username = 'minnie-mouse', - login_names = ["gigi@zitadel.com","gigi@zitadel.zitadel.ch"], - preferred_login_name = 'gigi@zitadel.com', - human = zitadel_client.models.v2_human_user.v2HumanUser( - user_id = 'd654e6ba-70a3-48ef-a95d-37c8d8a7901a', - state = 'USER_STATE_UNSPECIFIED', - username = 'minnie-mouse', - login_names = ["gigi@zitadel.com","gigi@zitadel.zitadel.ch"], - preferred_login_name = 'gigi@zitadel.com', - profile = zitadel_client.models.v2_human_profile.v2HumanProfile( - given_name = 'Minnie', - family_name = 'Mouse', - nick_name = 'Mini', - display_name = 'Minnie Mouse', - preferred_language = 'en', - gender = 'GENDER_UNSPECIFIED', - avatar_url = 'https://api.zitadel.ch/assets/v1/avatar-32432jkh4kj32', ), - email = zitadel_client.models.v2_human_email.v2HumanEmail( - is_verified = True, ), - phone = zitadel_client.models.v2_human_phone.v2HumanPhone( - is_verified = True, ), - password_change_required = True, - password_changed = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - mfa_init_skipped = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), - machine = zitadel_client.models.v2_machine_user.v2MachineUser( - name = 'zitadel', - description = 'The one and only IAM', - has_secret = True, - access_token_type = 'ACCESS_TOKEN_TYPE_BEARER', ) - ) - else: - return V2User( - ) - """ - - def testV2User(self): - """Test V2User""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_user_agent.py b/test/test_v2_user_agent.py deleted file mode 100644 index b46ef6d7..00000000 --- a/test/test_v2_user_agent.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_user_agent import V2UserAgent - -class TestV2UserAgent(unittest.TestCase): - """V2UserAgent unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2UserAgent: - """Test V2UserAgent - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2UserAgent` - """ - model = V2UserAgent() - if include_optional: - return V2UserAgent( - fingerprint_id = '', - ip = '', - description = '', - header = { - 'key' : zitadel_client.models.user_agent_header_values.UserAgentHeaderValues( - values = [ - '' - ], ) - } - ) - else: - return V2UserAgent( - ) - """ - - def testV2UserAgent(self): - """Test V2UserAgent""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_user_agent_query.py b/test/test_v2_user_agent_query.py deleted file mode 100644 index 80d5ccf4..00000000 --- a/test/test_v2_user_agent_query.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_user_agent_query import V2UserAgentQuery - -class TestV2UserAgentQuery(unittest.TestCase): - """V2UserAgentQuery unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2UserAgentQuery: - """Test V2UserAgentQuery - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2UserAgentQuery` - """ - model = V2UserAgentQuery() - if include_optional: - return V2UserAgentQuery( - fingerprint_id = '69629023906488334' - ) - else: - return V2UserAgentQuery( - ) - """ - - def testV2UserAgentQuery(self): - """Test V2UserAgentQuery""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_user_factor.py b/test/test_v2_user_factor.py deleted file mode 100644 index f602ee53..00000000 --- a/test/test_v2_user_factor.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_user_factor import V2UserFactor - -class TestV2UserFactor(unittest.TestCase): - """V2UserFactor unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2UserFactor: - """Test V2UserFactor - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2UserFactor` - """ - model = V2UserFactor() - if include_optional: - return V2UserFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - id = '', - login_name = '', - display_name = '', - organization_id = '' - ) - else: - return V2UserFactor( - ) - """ - - def testV2UserFactor(self): - """Test V2UserFactor""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_user_field_name.py b/test/test_v2_user_field_name.py deleted file mode 100644 index 5381d72f..00000000 --- a/test/test_v2_user_field_name.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_user_field_name import V2UserFieldName - -class TestV2UserFieldName(unittest.TestCase): - """V2UserFieldName unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2UserFieldName(self): - """Test V2UserFieldName""" - # inst = V2UserFieldName() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_user_id_query.py b/test/test_v2_user_id_query.py deleted file mode 100644 index baea8a6e..00000000 --- a/test/test_v2_user_id_query.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_user_id_query import V2UserIDQuery - -class TestV2UserIDQuery(unittest.TestCase): - """V2UserIDQuery unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2UserIDQuery: - """Test V2UserIDQuery - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2UserIDQuery` - """ - model = V2UserIDQuery() - if include_optional: - return V2UserIDQuery( - id = '' - ) - else: - return V2UserIDQuery( - ) - """ - - def testV2UserIDQuery(self): - """Test V2UserIDQuery""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_user_name_query.py b/test/test_v2_user_name_query.py deleted file mode 100644 index e9392012..00000000 --- a/test/test_v2_user_name_query.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_user_name_query import V2UserNameQuery - -class TestV2UserNameQuery(unittest.TestCase): - """V2UserNameQuery unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2UserNameQuery: - """Test V2UserNameQuery - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2UserNameQuery` - """ - model = V2UserNameQuery() - if include_optional: - return V2UserNameQuery( - user_name = 'gigi-giraffe', - method = 'TEXT_QUERY_METHOD_EQUALS' - ) - else: - return V2UserNameQuery( - user_name = 'gigi-giraffe', - ) - """ - - def testV2UserNameQuery(self): - """Test V2UserNameQuery""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_user_service_set_password_body.py b/test/test_v2_user_service_set_password_body.py deleted file mode 100644 index 6dc043a2..00000000 --- a/test/test_v2_user_service_set_password_body.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_user_service_set_password_body import V2UserServiceSetPasswordBody - -class TestV2UserServiceSetPasswordBody(unittest.TestCase): - """V2UserServiceSetPasswordBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2UserServiceSetPasswordBody: - """Test V2UserServiceSetPasswordBody - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2UserServiceSetPasswordBody` - """ - model = V2UserServiceSetPasswordBody() - if include_optional: - return V2UserServiceSetPasswordBody( - new_password = zitadel_client.models.v2_password.v2Password( - password = 'Secr3tP4ssw0rd!', - change_required = True, ), - current_password = 'Secr3tP4ssw0rd!', - verification_code = 'SKJd342k' - ) - else: - return V2UserServiceSetPasswordBody( - current_password = 'Secr3tP4ssw0rd!', - verification_code = 'SKJd342k', - ) - """ - - def testV2UserServiceSetPasswordBody(self): - """Test V2UserServiceSetPasswordBody""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_user_state.py b/test/test_v2_user_state.py deleted file mode 100644 index 4b38cc14..00000000 --- a/test/test_v2_user_state.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_user_state import V2UserState - -class TestV2UserState(unittest.TestCase): - """V2UserState unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2UserState(self): - """Test V2UserState""" - # inst = V2UserState() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_user_verification_requirement.py b/test/test_v2_user_verification_requirement.py deleted file mode 100644 index b00b93cb..00000000 --- a/test/test_v2_user_verification_requirement.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_user_verification_requirement import V2UserVerificationRequirement - -class TestV2UserVerificationRequirement(unittest.TestCase): - """V2UserVerificationRequirement unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testV2UserVerificationRequirement(self): - """Test V2UserVerificationRequirement""" - # inst = V2UserVerificationRequirement() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_verify_email_response.py b/test/test_v2_verify_email_response.py deleted file mode 100644 index 59c28ee3..00000000 --- a/test/test_v2_verify_email_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_verify_email_response import V2VerifyEmailResponse - -class TestV2VerifyEmailResponse(unittest.TestCase): - """V2VerifyEmailResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2VerifyEmailResponse: - """Test V2VerifyEmailResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2VerifyEmailResponse` - """ - model = V2VerifyEmailResponse() - if include_optional: - return V2VerifyEmailResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2VerifyEmailResponse( - ) - """ - - def testV2VerifyEmailResponse(self): - """Test V2VerifyEmailResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_verify_invite_code_response.py b/test/test_v2_verify_invite_code_response.py deleted file mode 100644 index b80cc894..00000000 --- a/test/test_v2_verify_invite_code_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_verify_invite_code_response import V2VerifyInviteCodeResponse - -class TestV2VerifyInviteCodeResponse(unittest.TestCase): - """V2VerifyInviteCodeResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2VerifyInviteCodeResponse: - """Test V2VerifyInviteCodeResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2VerifyInviteCodeResponse` - """ - model = V2VerifyInviteCodeResponse() - if include_optional: - return V2VerifyInviteCodeResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2VerifyInviteCodeResponse( - ) - """ - - def testV2VerifyInviteCodeResponse(self): - """Test V2VerifyInviteCodeResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_verify_passkey_registration_response.py b/test/test_v2_verify_passkey_registration_response.py deleted file mode 100644 index 7cf513b1..00000000 --- a/test/test_v2_verify_passkey_registration_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_verify_passkey_registration_response import V2VerifyPasskeyRegistrationResponse - -class TestV2VerifyPasskeyRegistrationResponse(unittest.TestCase): - """V2VerifyPasskeyRegistrationResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2VerifyPasskeyRegistrationResponse: - """Test V2VerifyPasskeyRegistrationResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2VerifyPasskeyRegistrationResponse` - """ - model = V2VerifyPasskeyRegistrationResponse() - if include_optional: - return V2VerifyPasskeyRegistrationResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2VerifyPasskeyRegistrationResponse( - ) - """ - - def testV2VerifyPasskeyRegistrationResponse(self): - """Test V2VerifyPasskeyRegistrationResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_verify_phone_response.py b/test/test_v2_verify_phone_response.py deleted file mode 100644 index 03201553..00000000 --- a/test/test_v2_verify_phone_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_verify_phone_response import V2VerifyPhoneResponse - -class TestV2VerifyPhoneResponse(unittest.TestCase): - """V2VerifyPhoneResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2VerifyPhoneResponse: - """Test V2VerifyPhoneResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2VerifyPhoneResponse` - """ - model = V2VerifyPhoneResponse() - if include_optional: - return V2VerifyPhoneResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2VerifyPhoneResponse( - ) - """ - - def testV2VerifyPhoneResponse(self): - """Test V2VerifyPhoneResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_verify_totp_registration_response.py b/test/test_v2_verify_totp_registration_response.py deleted file mode 100644 index 3253f6e0..00000000 --- a/test/test_v2_verify_totp_registration_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_verify_totp_registration_response import V2VerifyTOTPRegistrationResponse - -class TestV2VerifyTOTPRegistrationResponse(unittest.TestCase): - """V2VerifyTOTPRegistrationResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2VerifyTOTPRegistrationResponse: - """Test V2VerifyTOTPRegistrationResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2VerifyTOTPRegistrationResponse` - """ - model = V2VerifyTOTPRegistrationResponse() - if include_optional: - return V2VerifyTOTPRegistrationResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2VerifyTOTPRegistrationResponse( - ) - """ - - def testV2VerifyTOTPRegistrationResponse(self): - """Test V2VerifyTOTPRegistrationResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_verify_u2_f_registration_response.py b/test/test_v2_verify_u2_f_registration_response.py deleted file mode 100644 index 38c766da..00000000 --- a/test/test_v2_verify_u2_f_registration_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_verify_u2_f_registration_response import V2VerifyU2FRegistrationResponse - -class TestV2VerifyU2FRegistrationResponse(unittest.TestCase): - """V2VerifyU2FRegistrationResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2VerifyU2FRegistrationResponse: - """Test V2VerifyU2FRegistrationResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2VerifyU2FRegistrationResponse` - """ - model = V2VerifyU2FRegistrationResponse() - if include_optional: - return V2VerifyU2FRegistrationResponse( - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ) - ) - else: - return V2VerifyU2FRegistrationResponse( - ) - """ - - def testV2VerifyU2FRegistrationResponse(self): - """Test V2VerifyU2FRegistrationResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_v2_web_auth_n_factor.py b/test/test_v2_web_auth_n_factor.py deleted file mode 100644 index abd1c3da..00000000 --- a/test/test_v2_web_auth_n_factor.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.v2_web_auth_n_factor import V2WebAuthNFactor - -class TestV2WebAuthNFactor(unittest.TestCase): - """V2WebAuthNFactor unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> V2WebAuthNFactor: - """Test V2WebAuthNFactor - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `V2WebAuthNFactor` - """ - model = V2WebAuthNFactor() - if include_optional: - return V2WebAuthNFactor( - verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - user_verified = True - ) - else: - return V2WebAuthNFactor( - ) - """ - - def testV2WebAuthNFactor(self): - """Test V2WebAuthNFactor""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_zitadelidpv2_options.py b/test/test_zitadelidpv2_options.py deleted file mode 100644 index d617e9fb..00000000 --- a/test/test_zitadelidpv2_options.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.zitadelidpv2_options import Zitadelidpv2Options - -class TestZitadelidpv2Options(unittest.TestCase): - """Zitadelidpv2Options unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Zitadelidpv2Options: - """Test Zitadelidpv2Options - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Zitadelidpv2Options` - """ - model = Zitadelidpv2Options() - if include_optional: - return Zitadelidpv2Options( - is_linking_allowed = True, - is_creation_allowed = True, - is_auto_creation = True, - is_auto_update = True, - auto_linking = 'AUTO_LINKING_OPTION_UNSPECIFIED' - ) - else: - return Zitadelidpv2Options( - ) - """ - - def testZitadelidpv2Options(self): - """Test Zitadelidpv2Options""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_zitadelidpv2_options1.py b/test/test_zitadelidpv2_options1.py deleted file mode 100644 index 7046f6d2..00000000 --- a/test/test_zitadelidpv2_options1.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.zitadelidpv2_options1 import Zitadelidpv2Options1 - -class TestZitadelidpv2Options1(unittest.TestCase): - """Zitadelidpv2Options1 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Zitadelidpv2Options1: - """Test Zitadelidpv2Options1 - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Zitadelidpv2Options1` - """ - model = Zitadelidpv2Options1() - if include_optional: - return Zitadelidpv2Options1( - is_linking_allowed = True, - is_creation_allowed = True, - is_auto_creation = True, - is_auto_update = True, - auto_linking = 'AUTO_LINKING_OPTION_UNSPECIFIED' - ) - else: - return Zitadelidpv2Options1( - ) - """ - - def testZitadelidpv2Options1(self): - """Test Zitadelidpv2Options1""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_zitadelobjectv2_organization.py b/test/test_zitadelobjectv2_organization.py deleted file mode 100644 index 2ba73b7f..00000000 --- a/test/test_zitadelobjectv2_organization.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.zitadelobjectv2_organization import Zitadelobjectv2Organization - -class TestZitadelobjectv2Organization(unittest.TestCase): - """Zitadelobjectv2Organization unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Zitadelobjectv2Organization: - """Test Zitadelobjectv2Organization - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Zitadelobjectv2Organization` - """ - model = Zitadelobjectv2Organization() - if include_optional: - return Zitadelobjectv2Organization( - org_id = '', - org_domain = '' - ) - else: - return Zitadelobjectv2Organization( - ) - """ - - def testZitadelobjectv2Organization(self): - """Test Zitadelobjectv2Organization""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_zitadelorgv2_organization.py b/test/test_zitadelorgv2_organization.py deleted file mode 100644 index 47177b2e..00000000 --- a/test/test_zitadelorgv2_organization.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.zitadelorgv2_organization import Zitadelorgv2Organization - -class TestZitadelorgv2Organization(unittest.TestCase): - """Zitadelorgv2Organization unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Zitadelorgv2Organization: - """Test Zitadelorgv2Organization - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Zitadelorgv2Organization` - """ - model = Zitadelorgv2Organization() - if include_optional: - return Zitadelorgv2Organization( - id = '69629023906488334', - details = zitadel_client.models.v2_details.v2Details( - sequence = '2', - change_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource_owner = '69629023906488334', ), - state = 'ORGANIZATION_STATE_UNSPECIFIED', - name = 'ZITADEL', - primary_domain = 'zitadel.cloud' - ) - else: - return Zitadelorgv2Organization( - ) - """ - - def testZitadelorgv2Organization(self): - """Test Zitadelorgv2Organization""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_zitadelorgv2_search_query.py b/test/test_zitadelorgv2_search_query.py deleted file mode 100644 index bb295f81..00000000 --- a/test/test_zitadelorgv2_search_query.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.zitadelorgv2_search_query import Zitadelorgv2SearchQuery - -class TestZitadelorgv2SearchQuery(unittest.TestCase): - """Zitadelorgv2SearchQuery unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Zitadelorgv2SearchQuery: - """Test Zitadelorgv2SearchQuery - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Zitadelorgv2SearchQuery` - """ - model = Zitadelorgv2SearchQuery() - if include_optional: - return Zitadelorgv2SearchQuery( - name_query = zitadel_client.models.v2_organization_name_query.v2OrganizationNameQuery( - name = 'gigi-giraffe', - method = 'TEXT_QUERY_METHOD_EQUALS', ), - domain_query = zitadel_client.models.v2_organization_domain_query.v2OrganizationDomainQuery( - domain = 'citadel.cloud', - method = 'TEXT_QUERY_METHOD_EQUALS', ), - state_query = zitadel_client.models.v2_organization_state_query.v2OrganizationStateQuery( - state = 'ORGANIZATION_STATE_UNSPECIFIED', ), - id_query = zitadel_client.models.v2_organization_id_query.v2OrganizationIDQuery( - id = '69629023906488334', ), - default_query = zitadel_client.models.v2_default_organization_query.v2DefaultOrganizationQuery() - ) - else: - return Zitadelorgv2SearchQuery( - ) - """ - - def testZitadelorgv2SearchQuery(self): - """Test Zitadelorgv2SearchQuery""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_zitadelv1_timestamp_query_method.py b/test/test_zitadelv1_timestamp_query_method.py deleted file mode 100644 index d05e7d6f..00000000 --- a/test/test_zitadelv1_timestamp_query_method.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -""" - merged spec - - merged spec - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from zitadel_client.models.zitadelv1_timestamp_query_method import Zitadelv1TimestampQueryMethod - -class TestZitadelv1TimestampQueryMethod(unittest.TestCase): - """Zitadelv1TimestampQueryMethod unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testZitadelv1TimestampQueryMethod(self): - """Test Zitadelv1TimestampQueryMethod""" - # inst = Zitadelv1TimestampQueryMethod() - -if __name__ == '__main__': - unittest.main() diff --git a/zitadel_client/api_client.py b/zitadel_client/api_client.py index d9cc3453..ca7c3082 100644 --- a/zitadel_client/api_client.py +++ b/zitadel_client/api_client.py @@ -13,14 +13,11 @@ from pydantic import SecretStr import zitadel_client.models -from zitadel_client import rest, configuration +from zitadel_client import rest from zitadel_client.api_response import ApiResponse, T as ApiResponseT -from zitadel_client.auth.authenticator import Authenticator -from zitadel_client.auth.no_auth import DummyAuthenticator -from zitadel_client.auth.personal_access import PersonalAccessAuthenticator from zitadel_client.configuration import Configuration from zitadel_client.exceptions import ( - ApiException + ApiException ) RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] diff --git a/zitadel_client/auth/oauth_authenticator.py b/zitadel_client/auth/oauth_authenticator.py index 29e9f48e..a81044df 100644 --- a/zitadel_client/auth/oauth_authenticator.py +++ b/zitadel_client/auth/oauth_authenticator.py @@ -1,10 +1,11 @@ from abc import ABC, abstractmethod -from datetime import datetime, timedelta +from datetime import datetime, timedelta, timezone from typing import Dict, Optional from authlib.integrations.requests_client import OAuth2Session from zitadel_client.auth.authenticator import Token, Authenticator +from zitadel_client.auth.open_id import OpenId class OAuthAuthenticator(Authenticator, ABC): @@ -16,12 +17,12 @@ class OAuthAuthenticator(Authenticator, ABC): oauth_session: An OAuth2Session instance used for fetching tokens. """ - def __init__(self, open_id, oauth_session: OAuth2Session): + def __init__(self, open_id: OpenId, oauth_session: OAuth2Session): """ Constructs an OAuthAuthenticator. :param open_id: An object that must implement get_host_endpoint() and get_token_endpoint(). - :param scope: The scope for the token request. + :param oauth_session: The scope for the token request. """ super().__init__(open_id.get_host_endpoint()) self.open_id = open_id @@ -60,14 +61,11 @@ def refresh_token(self) -> Token: :return: A new Token. """ - token_endpoint = self.open_id.get_token_endpoint() - grant_params = self.get_grant() try: - # fetch_token returns an OAuth2Token (usually a dict-like object) - token_response = self.session.fetch_token(url=token_endpoint, **grant_params) + token_response = self.oauth_session.fetch_token(url=(self.open_id.get_token_endpoint()), **(self.get_grant())) access_token = token_response["access_token"] expires_in = token_response.get("expires_in", 3600) - expires_at = datetime.utcnow() + timedelta(seconds=expires_in) + expires_at = datetime.now(timezone.utc) + timedelta(seconds=expires_in) self.token = Token(access_token, expires_at) return self.token except Exception as e: diff --git a/zitadel_client/auth/web_token_authenticator.py b/zitadel_client/auth/web_token_authenticator.py index d8ed5763..5544ae6c 100644 --- a/zitadel_client/auth/web_token_authenticator.py +++ b/zitadel_client/auth/web_token_authenticator.py @@ -8,7 +8,7 @@ from zitadel_client.auth.open_id import OpenId -class JWTAuthenticator(OAuthAuthenticator): +class WebTokenAuthenticator(OAuthAuthenticator): """ OAuth authenticator implementing the JWT bearer flow. @@ -57,7 +57,7 @@ def get_grant(self) -> dict: "aud": self.jwt_audience, "iat": int(now.timestamp()), "exp": int((now + self.jwt_lifetime).timestamp()) - }, self.private_key, algorithm=self.jwt_algorithm)) + }, self.private_key)) } except JoseError as e: raise Exception("Failed to generate JWT assertion: " + str(e)) from e @@ -119,7 +119,7 @@ def scopes(self, scopes: set) -> "JWTAuthenticatorBuilder": self.auth_scopes = " ".join(scopes) return self - def build(self) -> JWTAuthenticator: + def build(self) -> WebTokenAuthenticator: """ Builds and returns a new JWTAuthenticator instance using the configured parameters. @@ -128,7 +128,7 @@ def build(self) -> JWTAuthenticator: :return: A new JWTAuthenticator instance. """ - return JWTAuthenticator( + return WebTokenAuthenticator( open_id=self.open_id, auth_scopes=self.auth_scopes, jwt_issuer=self.jwt_issuer, From 316f0a828e58115a5a67e2db46f1351dbfd1ca0e Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Mon, 7 Apr 2025 21:28:41 +0300 Subject: [PATCH 04/21] Added some tests to ensure that the auth works --- test/test_zitadel.py | 28 ++++++++++++++++++++++++++++ zitadel_client/zitadel.py | 16 ++++++++-------- 2 files changed, 36 insertions(+), 8 deletions(-) create mode 100644 test/test_zitadel.py diff --git a/test/test_zitadel.py b/test/test_zitadel.py new file mode 100644 index 00000000..1b3c7119 --- /dev/null +++ b/test/test_zitadel.py @@ -0,0 +1,28 @@ +import importlib +import inspect +import pkgutil +import unittest + +from zitadel_client.auth.no_auth_authenticator import NoAuthAuthenticator +from zitadel_client.zitadel import Zitadel + + +class ZitadelServicesTest(unittest.TestCase): + """ + Test to verify that all API service classes defined in the "zitadel_client.api" namespace + are registered as attributes in the Zitadel class. + """ + def test_services_dynamic(self): + expected = set() + package = importlib.import_module("zitadel_client.api") + for _, modname, _ in pkgutil.walk_packages(package.__path__, package.__name__ + "."): + module = importlib.import_module(modname) + for name, obj in inspect.getmembers(module, inspect.isclass): + if obj.__module__ == modname and obj.__name__.endswith("ServiceApi"): + expected.add(obj) + zitadel = Zitadel(NoAuthAuthenticator("http://dummy")) + actual = {type(getattr(zitadel, attr)) + for attr in dir(zitadel) + if not attr.startswith("_") and hasattr(getattr(zitadel, attr), "__class__") + and getattr(zitadel, attr).__class__.__module__.startswith("zitadel_client.api")} + self.assertEqual(expected, actual) diff --git a/zitadel_client/zitadel.py b/zitadel_client/zitadel.py index a760fe11..1d11b055 100644 --- a/zitadel_client/zitadel.py +++ b/zitadel_client/zitadel.py @@ -49,14 +49,14 @@ def __init__(self, authenticator: Authenticator, mutate_config: callable = None) if mutate_config: mutate_config(self.configuration) - self.client = ApiClient(configuration=self.configuration) - self.features = FeatureServiceApi(self.client) - self.idps = IdentityProviderServiceApi(self.client) - self.oidc = OIDCServiceApi(self.client) - self.organizations = OrganizationServiceApi(self.client) - self.sessions = SessionServiceApi(self.client) - self.settings = SettingsServiceApi(self.client) - self.users = UserServiceApi(self.client) + client = ApiClient(configuration=self.configuration) + self.features = FeatureServiceApi(client) + self.idps = IdentityProviderServiceApi(client) + self.oidc = OIDCServiceApi(client) + self.organizations = OrganizationServiceApi(client) + self.sessions = SessionServiceApi(client) + self.settings = SettingsServiceApi(client) + self.users = UserServiceApi(client) def __enter__(self): """ From 7c020af7691af20ffae6ea2f48bb7ad5dd8533bc Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Mon, 7 Apr 2025 21:39:53 +0300 Subject: [PATCH 05/21] Hardened the test suite to ensure that all code paths are covered --- .../test_client_credentials_authenticator.py | 2 +- zitadel_client/auth/authenticator.py | 30 +++++++++++++++---- .../auth/client_credentials_authenticator.py | 13 +++----- .../auth/web_token_authenticator.py | 15 ++-------- 4 files changed, 33 insertions(+), 27 deletions(-) diff --git a/test/auth/test_client_credentials_authenticator.py b/test/auth/test_client_credentials_authenticator.py index 7b4ee934..affdd329 100644 --- a/test/auth/test_client_credentials_authenticator.py +++ b/test/auth/test_client_credentials_authenticator.py @@ -15,7 +15,7 @@ def test_refresh_token(self): time.sleep(20) authenticator = ClientCredentialsAuthenticator.builder(self.oauth_host, "dummy-client", "dummy-secret") \ - .scopes({"openid", "foo"}) \ + .scopes("openid", "foo") \ .build() self.assertTrue(authenticator.get_auth_token(), "Access token should not be empty") diff --git a/zitadel_client/auth/authenticator.py b/zitadel_client/auth/authenticator.py index 7a44973d..2af5a8db 100644 --- a/zitadel_client/auth/authenticator.py +++ b/zitadel_client/auth/authenticator.py @@ -43,10 +43,30 @@ def get_host(self) -> str: class Token: def __init__(self, access_token: str, expires_at: datetime): + """ + Initializes a new Token instance. + + Parameters: + - access_token (str): The JWT or OAuth token. + - expires_at (datetime): The expiration time of the token. It should be timezone-aware. + If a naive datetime is provided, it will be converted to an aware datetime in UTC. + """ self.access_token = access_token - self.expires_at = expires_at + + # Ensure expires_at is timezone-aware. If naive, assume UTC. + if expires_at.tzinfo is None: + self.expires_at = expires_at.replace(tzinfo=timezone.utc) + else: + self.expires_at = expires_at def is_expired(self) -> bool: + """ + Checks if the token is expired by comparing the current UTC time + with the token's expiration time. + + Returns: + - bool: True if expired, False otherwise. + """ return datetime.now(timezone.utc) >= self.expires_at @@ -64,14 +84,14 @@ def __init__(self, host: str): :param host: The base URL for the OAuth provider. """ self.open_id = OpenId(host) - self.auth_scopes = "openid urn:zitadel:iam:org:project:id:zitadel:aud" + self.auth_scopes = {"openid", "urn:zitadel:iam:org:project:id:zitadel:aud"} - def scopes(self, auth_scopes: set) -> "OAuthAuthenticatorBuilder": + def scopes(self, *auth_scopes: str) -> "OAuthAuthenticatorBuilder": """ Sets the authentication scopes for the OAuth authenticator. - :param auth_scopes: A set of scope strings. + :param auth_scopes: A variable number of scope strings. :return: The builder instance to allow for method chaining. """ - self.auth_scopes = " ".join(auth_scopes) + self.auth_scopes = set(auth_scopes) return self diff --git a/zitadel_client/auth/client_credentials_authenticator.py b/zitadel_client/auth/client_credentials_authenticator.py index 09efd3ab..dd2ed84c 100644 --- a/zitadel_client/auth/client_credentials_authenticator.py +++ b/zitadel_client/auth/client_credentials_authenticator.py @@ -1,4 +1,4 @@ -from typing import override +from typing import override, Set from authlib.integrations.requests_client import OAuth2Session @@ -14,7 +14,7 @@ class ClientCredentialsAuthenticator(OAuthAuthenticator): Uses client_id and client_secret to obtain an access token from the OAuth2 token endpoint. """ - def __init__(self, open_id: OpenId, client_id: str, client_secret: str, auth_scopes: str): + def __init__(self, open_id: OpenId, client_id: str, client_secret: str, auth_scopes: Set[str]): """ Constructs a ClientCredentialsAuthenticator. @@ -23,7 +23,7 @@ def __init__(self, open_id: OpenId, client_id: str, client_secret: str, auth_sco :param client_secret: The OAuth client secret. :param auth_scopes: The scope(s) for the token request. """ - super().__init__(open_id, OAuth2Session(client_id=client_id, client_secret=client_secret, scope=auth_scopes)) + super().__init__(open_id, OAuth2Session(client_id=client_id, client_secret=client_secret, scope=" ".join(auth_scopes))) @override def get_grant(self) -> dict: @@ -73,9 +73,4 @@ def build(self) -> ClientCredentialsAuthenticator: :return: A configured ClientCredentialsAuthenticator. """ - return ClientCredentialsAuthenticator( - self.open_id, # OpenId instance with endpoint info (constructed from host) - self.client_id, # OAuth client identifier - self.client_secret, # OAuth client secret - self.auth_scopes # Authentication scopes configured in the builder - ) + return ClientCredentialsAuthenticator(self.open_id, self.client_id, self.client_secret, self.auth_scopes) diff --git a/zitadel_client/auth/web_token_authenticator.py b/zitadel_client/auth/web_token_authenticator.py index 5544ae6c..8cec8c60 100644 --- a/zitadel_client/auth/web_token_authenticator.py +++ b/zitadel_client/auth/web_token_authenticator.py @@ -1,4 +1,5 @@ from datetime import datetime, timedelta, timezone +from typing import Set from authlib.integrations.requests_client import OAuth2Session from authlib.jose import jwt, JoseError @@ -15,7 +16,7 @@ class WebTokenAuthenticator(OAuthAuthenticator): This implementation builds a JWT assertion dynamically in get_grant(). """ - def __init__(self, open_id: OpenId, auth_scopes: str, + def __init__(self, open_id: OpenId, auth_scopes: Set[str], jwt_issuer: str, jwt_subject: str, jwt_audience: str, private_key: str, jwt_lifetime: timedelta = timedelta(hours=1), jwt_algorithm: str = "RS256"): """ @@ -30,7 +31,7 @@ def __init__(self, open_id: OpenId, auth_scopes: str, :param jwt_lifetime: Lifetime of the JWT in seconds. :param jwt_algorithm: The JWT signing algorithm (default "RS256"). """ - super().__init__(open_id, OAuth2Session(scope=auth_scopes)) + super().__init__(open_id, OAuth2Session(scope=" ".join(auth_scopes))) self.jwt_issuer = jwt_issuer self.jwt_subject = jwt_subject self.jwt_audience = jwt_audience @@ -109,16 +110,6 @@ def token_lifetime_seconds(self, seconds: int) -> "JWTAuthenticatorBuilder": self.jwt_lifetime = timedelta(seconds=seconds) return self - def scopes(self, scopes: set) -> "JWTAuthenticatorBuilder": - """ - Overrides the default scopes for the JWTAuthenticator. - - :param scopes: A set of scope strings. - :return: The builder instance. - """ - self.auth_scopes = " ".join(scopes) - return self - def build(self) -> WebTokenAuthenticator: """ Builds and returns a new JWTAuthenticator instance using the configured parameters. From e437123a91a6c8bfe10601608904b2e8fcc8d063 Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Mon, 7 Apr 2025 21:44:00 +0300 Subject: [PATCH 06/21] Fixed the builder method to ensure that the type erasure is not lost --- zitadel_client/auth/authenticator.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/zitadel_client/auth/authenticator.py b/zitadel_client/auth/authenticator.py index 2af5a8db..ec6e40d3 100644 --- a/zitadel_client/auth/authenticator.py +++ b/zitadel_client/auth/authenticator.py @@ -1,6 +1,6 @@ from abc import ABC, abstractmethod from datetime import datetime, timezone -from typing import Dict +from typing import Dict, Generic, TypeVar from zitadel_client.auth.open_id import OpenId @@ -69,8 +69,10 @@ def is_expired(self) -> bool: """ return datetime.now(timezone.utc) >= self.expires_at +T = TypeVar("T", bound="OAuthAuthenticatorBuilder") -class OAuthAuthenticatorBuilder(ABC): + +class OAuthAuthenticatorBuilder(ABC, Generic[T]): """ Abstract builder class for constructing OAuth authenticator instances. @@ -86,7 +88,7 @@ def __init__(self, host: str): self.open_id = OpenId(host) self.auth_scopes = {"openid", "urn:zitadel:iam:org:project:id:zitadel:aud"} - def scopes(self, *auth_scopes: str) -> "OAuthAuthenticatorBuilder": + def scopes(self: T, *auth_scopes: str) -> T: """ Sets the authentication scopes for the OAuth authenticator. From 6d842b9df07cbfea0b5c299e929bce10097ec8df Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Tue, 8 Apr 2025 10:49:42 +0300 Subject: [PATCH 07/21] Renamed the builder class --- test/test_zitadel.py | 37 ++++++++++--------- zitadel_client/auth/authenticator.py | 1 + .../auth/client_credentials_authenticator.py | 3 +- .../auth/web_token_authenticator.py | 8 ++-- 4 files changed, 26 insertions(+), 23 deletions(-) diff --git a/test/test_zitadel.py b/test/test_zitadel.py index 1b3c7119..065e6eef 100644 --- a/test/test_zitadel.py +++ b/test/test_zitadel.py @@ -8,21 +8,22 @@ class ZitadelServicesTest(unittest.TestCase): - """ - Test to verify that all API service classes defined in the "zitadel_client.api" namespace - are registered as attributes in the Zitadel class. - """ - def test_services_dynamic(self): - expected = set() - package = importlib.import_module("zitadel_client.api") - for _, modname, _ in pkgutil.walk_packages(package.__path__, package.__name__ + "."): - module = importlib.import_module(modname) - for name, obj in inspect.getmembers(module, inspect.isclass): - if obj.__module__ == modname and obj.__name__.endswith("ServiceApi"): - expected.add(obj) - zitadel = Zitadel(NoAuthAuthenticator("http://dummy")) - actual = {type(getattr(zitadel, attr)) - for attr in dir(zitadel) - if not attr.startswith("_") and hasattr(getattr(zitadel, attr), "__class__") - and getattr(zitadel, attr).__class__.__module__.startswith("zitadel_client.api")} - self.assertEqual(expected, actual) + """ + Test to verify that all API service classes defined in the "zitadel_client.api" namespace + are registered as attributes in the Zitadel class. + """ + + def test_services_dynamic(self): + expected = set() + package = importlib.import_module("zitadel_client.api") + for _, modname, _ in pkgutil.walk_packages(package.__path__, package.__name__ + "."): + module = importlib.import_module(modname) + for name, obj in inspect.getmembers(module, inspect.isclass): + if obj.__module__ == modname and obj.__name__.endswith("ServiceApi"): + expected.add(obj) + zitadel = Zitadel(NoAuthAuthenticator("http://dummy")) + actual = {type(getattr(zitadel, attr)) + for attr in dir(zitadel) + if not attr.startswith("_") and hasattr(getattr(zitadel, attr), "__class__") + and getattr(zitadel, attr).__class__.__module__.startswith("zitadel_client.api")} + self.assertEqual(expected, actual) diff --git a/zitadel_client/auth/authenticator.py b/zitadel_client/auth/authenticator.py index ec6e40d3..eed26844 100644 --- a/zitadel_client/auth/authenticator.py +++ b/zitadel_client/auth/authenticator.py @@ -69,6 +69,7 @@ def is_expired(self) -> bool: """ return datetime.now(timezone.utc) >= self.expires_at + T = TypeVar("T", bound="OAuthAuthenticatorBuilder") diff --git a/zitadel_client/auth/client_credentials_authenticator.py b/zitadel_client/auth/client_credentials_authenticator.py index dd2ed84c..03f150b7 100644 --- a/zitadel_client/auth/client_credentials_authenticator.py +++ b/zitadel_client/auth/client_credentials_authenticator.py @@ -23,7 +23,8 @@ def __init__(self, open_id: OpenId, client_id: str, client_secret: str, auth_sco :param client_secret: The OAuth client secret. :param auth_scopes: The scope(s) for the token request. """ - super().__init__(open_id, OAuth2Session(client_id=client_id, client_secret=client_secret, scope=" ".join(auth_scopes))) + super().__init__(open_id, + OAuth2Session(client_id=client_id, client_secret=client_secret, scope=" ".join(auth_scopes))) @override def get_grant(self) -> dict: diff --git a/zitadel_client/auth/web_token_authenticator.py b/zitadel_client/auth/web_token_authenticator.py index 8cec8c60..b07ef103 100644 --- a/zitadel_client/auth/web_token_authenticator.py +++ b/zitadel_client/auth/web_token_authenticator.py @@ -64,7 +64,7 @@ def get_grant(self) -> dict: raise Exception("Failed to generate JWT assertion: " + str(e)) from e @staticmethod - def builder(host: str, user_id: str, private_key: str) -> "JWTAuthenticatorBuilder": + def builder(host: str, user_id: str, private_key: str) -> "WebTokenAuthenticatorBuilder": """ Returns a builder for constructing a JWTAuthenticator. @@ -73,10 +73,10 @@ def builder(host: str, user_id: str, private_key: str) -> "JWTAuthenticatorBuild :param private_key: The private key used to sign the JWT. :return: A JWTAuthenticatorBuilder instance. """ - return JWTAuthenticatorBuilder(host, user_id, user_id, host, private_key) + return WebTokenAuthenticatorBuilder(host, user_id, user_id, host, private_key) -class JWTAuthenticatorBuilder(OAuthAuthenticatorBuilder): +class WebTokenAuthenticatorBuilder(OAuthAuthenticatorBuilder): """ Builder for JWTAuthenticator. @@ -100,7 +100,7 @@ def __init__(self, host: str, jwt_issuer: str, jwt_subject: str, jwt_audience: s self.private_key = private_key self.jwt_lifetime = timedelta(hours=1) - def token_lifetime_seconds(self, seconds: int) -> "JWTAuthenticatorBuilder": + def token_lifetime_seconds(self, seconds: int) -> "WebTokenAuthenticatorBuilder": """ Sets the JWT token lifetime in seconds. From 8edbd3a8138b0740895c3568830acc66d13ddb1c Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Wed, 9 Apr 2025 10:22:36 +0300 Subject: [PATCH 08/21] Fixed the Pytest configuration to generate the LCOV report too --- pyproject.toml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 60b101d9..54c7dadf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,13 +45,12 @@ build-backend = "poetry.core.masonry.api" [tool.tox] envlist = ["py3"] -[testenv] -deps = [ - "pytest", - "pytest-cov" -] -commands = [ - "pytest --cov=zitadel_client" +[tool.pytest.ini_options] +addopts = [ + "--cov=zitadel_client", + "--cov-report=html:build/coverage/html", + "--cov-report=lcov:build/coverage/lcov.info", + "--cov-report=term" ] [tool.pylint.'MESSAGES CONTROL'] From 7a46fac783736da46f627cd1ff779306f561b67f Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Wed, 9 Apr 2025 10:23:09 +0300 Subject: [PATCH 09/21] Fixed the import to point to the correct authenticator as the dummy one doesn't exist anymore --- zitadel_client/api_client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zitadel_client/api_client.py b/zitadel_client/api_client.py index ca7c3082..5f6e07d6 100644 --- a/zitadel_client/api_client.py +++ b/zitadel_client/api_client.py @@ -15,6 +15,7 @@ import zitadel_client.models from zitadel_client import rest from zitadel_client.api_response import ApiResponse, T as ApiResponseT +from zitadel_client.auth.no_auth_authenticator import NoAuthAuthenticator from zitadel_client.configuration import Configuration from zitadel_client.exceptions import ( ApiException @@ -663,4 +664,4 @@ def __deserialize_model(data, klass: Any): @classmethod def get_default(cls): - return ApiClient(configuration=Configuration(authenticator=DummyAuthenticator("localhost"))) + return ApiClient(configuration=Configuration(authenticator=NoAuthAuthenticator())) From 4b7d7693719338e290c3e30440276be2c6d3a695 Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Wed, 9 Apr 2025 10:38:13 +0300 Subject: [PATCH 10/21] Updated the coverage configuration to not pollute the project root --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 54c7dadf..bd774188 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,6 +53,9 @@ addopts = [ "--cov-report=term" ] +[tool.coverage.run] +data_file = "build/coverage/.coverage" + [tool.pylint.'MESSAGES CONTROL'] extension-pkg-whitelist = "pydantic" From 3587295828fb122927335cdef692e8e8e69d86c5 Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Wed, 9 Apr 2025 12:20:33 +0300 Subject: [PATCH 11/21] Updated the configuration to exlcuded auto-generated code from coverage --- pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index bd774188..d0f01b2e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,6 +55,10 @@ addopts = [ [tool.coverage.run] data_file = "build/coverage/.coverage" +omit = [ + "zitadel_client/api/*", + "zitadel_client/models/*" +] [tool.pylint.'MESSAGES CONTROL'] extension-pkg-whitelist = "pydantic" From 418c35b287a3aecf052cd08ea37fa7309383e939 Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Wed, 9 Apr 2025 14:36:16 +0300 Subject: [PATCH 12/21] Added a test to ensure that the hostname is correct and that the authentication token is sent. --- test/test_api_client.py | 87 ++++++++++++++++++++++++++++++++++++ zitadel_client/api_client.py | 5 ++- 2 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 test/test_api_client.py diff --git a/test/test_api_client.py b/test/test_api_client.py new file mode 100644 index 00000000..598bcf46 --- /dev/null +++ b/test/test_api_client.py @@ -0,0 +1,87 @@ +import json +import time +import unittest +import urllib + +from testcontainers.core.container import DockerContainer + +from zitadel_client import ApiClient, Configuration +from zitadel_client.auth.personal_access_token_authenticator import PersonalAccessTokenAuthenticator + + +class TestApiClient(unittest.TestCase): + """ + Test case for interacting with the WireMock mock OAuth2 server. + """ + + @classmethod + def setUpClass(cls): + """ + Starts the WireMock Docker container and exposes the required port. + Sets up the OAuth server URL. + """ + cls.mock_oauth2_server = DockerContainer("wiremock/wiremock") \ + .with_exposed_ports(8080) + cls.mock_oauth2_server.start() + + host = cls.mock_oauth2_server.get_container_host_ip() + port = cls.mock_oauth2_server.get_exposed_port(8080) + cls.oauth_host = f"http://{host}:{port}" + + @classmethod + def tearDownClass(cls): + """ + Stops the WireMock Docker container. + """ + if cls.mock_oauth2_server is not None: + cls.mock_oauth2_server.stop() + + def test_assert_headers_and_content_type(self): + """ + Test the behavior of API client when sending requests to the mock OAuth2 server, + asserting headers and content type. + """ + time.sleep(20) + + with urllib.request.urlopen( + urllib.request.Request( + self.oauth_host + "/__admin/mappings", + data=json.dumps({ + "request": { + "method": "GET", + "url": "/your/endpoint", + "headers": { + "Authorization": { + "equalTo": "Bearer mm" + } + } + }, + "response": { + "status": 200, + "body": "{\"key\": \"value\"}", + "headers": { + "Content-Type": "application/json" + } + } + }).encode('utf-8'), + headers={'Content-Type': 'application/json'}, + method='POST' + ) + ) as response: + response.read().decode() + + api_client = ApiClient( + Configuration(authenticator=PersonalAccessTokenAuthenticator(self.oauth_host, "mm")) + ) + + api_response = api_client.call_api(*(api_client.param_serialize( + method='GET', + resource_path='/your/endpoint', + ))) + + if api_response.status != 200: + self.fail(f"Expected status 200, but got {api_response.status}") + + +if __name__ == '__main__': + unittest.main() diff --git a/zitadel_client/api_client.py b/zitadel_client/api_client.py index 5f6e07d6..a93cdcfa 100644 --- a/zitadel_client/api_client.py +++ b/zitadel_client/api_client.py @@ -166,7 +166,10 @@ def param_serialize( if body: body = self.sanitize_for_serialization(body) - url = _host + resource_path + if _host is None: + url = self.configuration.host + resource_path + else: + url = _host + resource_path if query_params: query_params = self.sanitize_for_serialization(query_params) From 8c08944c5022cbb4edde0ccd58bcabec0112cc0d Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Wed, 9 Apr 2025 16:04:58 +0300 Subject: [PATCH 13/21] Minor code cleanup --- zitadel_client/auth/open_id.py | 23 +- zitadel_client/configuration.py | 385 +++++++++++++++----------------- 2 files changed, 191 insertions(+), 217 deletions(-) diff --git a/zitadel_client/auth/open_id.py b/zitadel_client/auth/open_id.py index ac4ee281..fea4df3c 100644 --- a/zitadel_client/auth/open_id.py +++ b/zitadel_client/auth/open_id.py @@ -1,8 +1,7 @@ import json +import urllib from urllib.parse import urljoin -import urllib3 - class OpenId: """ @@ -14,21 +13,25 @@ class OpenId: def __init__(self, hostname: str): if not (hostname.startswith("http://") or hostname.startswith("https://")): - hostname = "https://" + hostname # Default to HTTPS if no scheme is provided. + hostname = "https://" + hostname + self.host_endpoint = hostname well_known_url = self.build_well_known_url(hostname) - http = urllib3.PoolManager() - response = http.request("GET", well_known_url) + try: + with urllib.request.urlopen(well_known_url) as response: + if response.status != 200: + raise Exception(f"Failed to fetch OpenID configuration: HTTP {response.status}") + config = json.loads(response.read().decode('utf-8')) + except urllib.error.URLError as e: + raise Exception(f"URL error occurred: {e}") + except json.JSONDecodeError: + raise Exception("Failed to decode JSON response") - if response.status != 200: - raise Exception(f"Failed to fetch OpenID configuration: HTTP {response.status}") - - # Decode and load the JSON response - config = json.loads(response.data.decode('utf-8')) token_endpoint = config.get("token_endpoint") if not token_endpoint: raise Exception("token_endpoint not found in OpenID configuration") + self.token_endpoint = token_endpoint @staticmethod diff --git a/zitadel_client/configuration.py b/zitadel_client/configuration.py index b3ebd42a..ba532dd5 100644 --- a/zitadel_client/configuration.py +++ b/zitadel_client/configuration.py @@ -1,226 +1,197 @@ -# coding: utf-8 -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist - you in integrating with your Zitadel environment. This SDK enables you to - handle resources, settings, and configurations within the Zitadel platform. -""" - import copy import http.client as httplib import logging import multiprocessing import sys from logging import FileHandler -from typing import Any, Dict, List, Optional, TypedDict, Union +from typing import Any, Dict, Optional, Union -from typing_extensions import NotRequired, Self +from typing_extensions import Self from zitadel_client.auth.authenticator import Authenticator -JSON_SCHEMA_VALIDATION_KEYWORDS = { - 'multipleOf', 'maximum', 'exclusiveMaximum', - 'minimum', 'exclusiveMinimum', 'maxLength', - 'minLength', 'pattern', 'maxItems', 'minItems' -} -ServerVariablesT = Dict[str, str] +class Configuration: + """This class contains various settings of the API client. + """ + + def __init__( + self, + authenticator: Authenticator, + ssl_ca_cert: Optional[str] = None, + retries: Optional[int] = None, + ca_cert_data: Optional[Union[str, bytes]] = None, + *, + debug: Optional[bool] = None, + ) -> None: + """Constructor + """ + self.authenticator = authenticator + self.api_key_prefix = {} + self.refresh_api_key_hook = None + self.logger = {"package_logger": logging.getLogger("zitadel_client"), + "urllib3_logger": logging.getLogger("urllib3")} + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + self.logger_stream_handler = None + self.logger_file_handler: Optional[FileHandler] = None + self.logger_file = None + if debug is not None: + self.debug = debug + else: + self.__debug = False + self.verify_ssl = True + self.ssl_ca_cert = ssl_ca_cert + self.ca_cert_data = ca_cert_data + self.cert_file = None + self.key_file = None + self.assert_hostname = None + self.tls_server_name = None + + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + + self.proxy: Optional[str] = None + self.proxy_headers = None + self.safe_chars_for_path_param = '' + self.retries = retries + # Enable client side validation + self.client_side_validation = True + self.socket_options = None + self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + self.date_format = "%Y-%m-%d" + + def __deepcopy__(self, memo: Dict[int, Any]) -> Self: + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name: str, value: Any) -> None: + object.__setattr__(self, name, value) + + @classmethod + def set_default(cls, default: Optional[Self]) -> None: + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = default + @property + def logger_file(self) -> Optional[str]: + """The logger file. -class HostSettingVariable(TypedDict): - description: str - default_value: str - enum_values: List[str] + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + :param value: The logger_file path. + :type: str + """ + return self.__logger_file -class HostSetting(TypedDict): - url: str - description: str - variables: NotRequired[Dict[str, HostSettingVariable]] + @logger_file.setter + def logger_file(self, value: Optional[str]) -> None: + """The logger file. + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. -class Configuration: - """This class contains various settings of the API client. + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self) -> bool: + """Debug status + + :param value: The debug status, True or False. + :type: bool """ + return self.__debug - def __init__( - self, - authenticator: Authenticator, - ssl_ca_cert: Optional[str] = None, - retries: Optional[int] = None, - ca_cert_data: Optional[Union[str, bytes]] = None, - *, - debug: Optional[bool] = None, - ) -> None: - """Constructor - """ - self.authenticator = authenticator - self.api_key_prefix = {} - self.refresh_api_key_hook = None - self.logger = {"package_logger": logging.getLogger("zitadel_client"), - "urllib3_logger": logging.getLogger("urllib3")} - self.logger_format = '%(asctime)s %(levelname)s %(message)s' - self.logger_stream_handler = None - self.logger_file_handler: Optional[FileHandler] = None - self.logger_file = None - if debug is not None: - self.debug = debug - else: - self.__debug = False - self.verify_ssl = True - self.ssl_ca_cert = ssl_ca_cert - self.ca_cert_data = ca_cert_data - self.cert_file = None - self.key_file = None - self.assert_hostname = None - self.tls_server_name = None - - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 - """urllib3 connection pool's maximum number of connections saved - per pool. urllib3 uses 1 connection as default value, but this is - not the best value when you are making a lot of possibly parallel - requests to the same host, which is often the case here. - cpu_count * 5 is used as default value to increase performance. - """ - - self.proxy: Optional[str] = None - self.proxy_headers = None - self.safe_chars_for_path_param = '' - self.retries = retries - # Enable client side validation - self.client_side_validation = True - self.socket_options = None - self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" - self.date_format = "%Y-%m-%d" - - def __deepcopy__(self, memo: Dict[int, Any]) -> Self: - cls = self.__class__ - result = cls.__new__(cls) - memo[id(self)] = result - for k, v in self.__dict__.items(): - if k not in ('logger', 'logger_file_handler'): - setattr(result, k, copy.deepcopy(v, memo)) - # shallow copy of loggers - result.logger = copy.copy(self.logger) - # use setters to configure loggers - result.logger_file = self.logger_file - result.debug = self.debug - return result - - def __setattr__(self, name: str, value: Any) -> None: - object.__setattr__(self, name, value) - - @classmethod - def set_default(cls, default: Optional[Self]) -> None: - """Set default instance of configuration. - - It stores default configuration, which can be - returned by get_default_copy method. - - :param default: object of Configuration - """ - cls._default = default - - @property - def logger_file(self) -> Optional[str]: - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - return self.__logger_file - - @logger_file.setter - def logger_file(self, value: Optional[str]) -> None: - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - self.__logger_file = value - if self.__logger_file: - # If set logging file, - # then add file handler and remove stream handler. - self.logger_file_handler = logging.FileHandler(self.__logger_file) - self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in self.logger.items(): - logger.addHandler(self.logger_file_handler) - - @property - def debug(self) -> bool: - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - return self.__debug - - @debug.setter - def debug(self, value: bool) -> None: - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - self.__debug = value - if self.__debug: - # if debug status is True, turn on debug logging - for _, logger in self.logger.items(): - logger.setLevel(logging.DEBUG) - # turn on httplib debug - httplib.HTTPConnection.debuglevel = 1 - else: - # if debug status is False, turn off debug logging, - # setting log level to default `logging.WARNING` - for _, logger in self.logger.items(): - logger.setLevel(logging.WARNING) - # turn off httplib debug - httplib.HTTPConnection.debuglevel = 0 - - @property - def logger_format(self) -> str: - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - return self.__logger_format - - @logger_format.setter - def logger_format(self, value: str) -> None: - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - self.__logger_format = value - self.logger_formatter = logging.Formatter(self.__logger_format) - - @staticmethod - def to_debug_report() -> str: - """Gets the essential information for debugging. - - :return: The report for debugging. - """ - return "Python SDK Debug Report:\n" \ - "OS: {env}\n" \ - "Python Version: {pyversion}\n" \ - "Version of the API: 1.0.0\n" \ - "SDK Package Version: 0.0.1". \ - format(env=sys.platform, pyversion=sys.version) - - @property - def host(self) -> str: - """Return generated host.""" - return self.authenticator.get_host() + @debug.setter + def debug(self, value: bool) -> None: + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self) -> str: + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value: str) -> None: + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + @staticmethod + def to_debug_report() -> str: + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n" \ + "OS: {env}\n" \ + "Python Version: {pyversion}\n" \ + "Version of the API: 1.0.0\n" \ + "SDK Package Version: 0.0.1". \ + format(env=sys.platform, pyversion=sys.version) + + @property + def host(self) -> str: + """Return generated host.""" + return self.authenticator.get_host() From 25b1042cbce800be8ca4950a20ac8fcbf65d030f Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Wed, 9 Apr 2025 16:09:23 +0300 Subject: [PATCH 14/21] Updated the workflow to also run on pull-requests --- .github/workflows/integration.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 5324ef95..c36afd59 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -4,6 +4,9 @@ on: push: branches: - main + pull_request: + branches: + - main jobs: check-compatibility: From ae96bd941e8e2314460328a2d44922d4687f37ab Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Thu, 10 Apr 2025 09:34:37 +0300 Subject: [PATCH 15/21] Added more integration tests to ensure that this works as expected --- poetry.lock | 17 ++++- pyproject.toml | 5 +- spec/__init__.py | 0 spec/conftest.py | 7 ++ ...rsonal_access_token_authentication_spec.py | 71 +++++++++++++++++++ 5 files changed, 97 insertions(+), 3 deletions(-) create mode 100644 spec/__init__.py create mode 100644 spec/conftest.py create mode 100644 spec/sdk_test_using_personal_access_token_authentication_spec.py diff --git a/poetry.lock b/poetry.lock index 24e6367d..80a5812d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -903,6 +903,21 @@ files = [ [package.dependencies] six = ">=1.5" +[[package]] +name = "python-dotenv" +version = "1.0.1" +description = "Read key-value pairs from a .env file and set them as environment variables" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "python-dotenv-1.0.1.tar.gz", hash = "sha256:e324ee90a023d808f1959c46bcbc04446a10ced277783dc6ee09987c37ec10ca"}, + {file = "python_dotenv-1.0.1-py3-none-any.whl", hash = "sha256:f7b63ef50f1b690dddf550d03497b66d609393b40b564ed0d674909a68ebf16a"}, +] + +[package.extras] +cli = ["click (>=5.0)"] + [[package]] name = "pywin32" version = "310" @@ -1224,4 +1239,4 @@ files = [ [metadata] lock-version = "2.1" python-versions = ">=3.8" -content-hash = "f631f2a362d9484bf12172f6a7a8e6bd87332668cb8eee3c60818dfca349d89a" +content-hash = "d66d79be5c31db83ad345b5fe1bb384e9410902aaee7258f4719d69d7451d000" diff --git a/pyproject.toml b/pyproject.toml index d0f01b2e..5c5ea57e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,6 +37,7 @@ flake8 = ">= 4.0.0" types-python-dateutil = ">= 2.8.19.14" mypy = ">= 1.5" testcontainers = "3.7.1" +python-dotenv = "1.0.1" [build-system] requires = ["poetry-core>=1.0.0"] @@ -46,6 +47,8 @@ build-backend = "poetry.core.masonry.api" envlist = ["py3"] [tool.pytest.ini_options] +testpaths = ["test", "spec"] +python_files = "test_*.py *_spec.py" addopts = [ "--cov=zitadel_client", "--cov-report=html:build/coverage/html", @@ -68,8 +71,6 @@ files = [ "zitadel_client", "tests", ] -# TODO: enable "strict" once all these individual checks are passing -# strict = true # List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options warn_unused_configs = true diff --git a/spec/__init__.py b/spec/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/spec/conftest.py b/spec/conftest.py new file mode 100644 index 00000000..8cc93d52 --- /dev/null +++ b/spec/conftest.py @@ -0,0 +1,7 @@ +import pytest +from dotenv import load_dotenv + +@pytest.fixture(scope="session", autouse=True) +def load_env(): + """Load the .env file for the entire test session.""" + load_dotenv() diff --git a/spec/sdk_test_using_personal_access_token_authentication_spec.py b/spec/sdk_test_using_personal_access_token_authentication_spec.py new file mode 100644 index 00000000..07922b33 --- /dev/null +++ b/spec/sdk_test_using_personal_access_token_authentication_spec.py @@ -0,0 +1,71 @@ +import pytest +import uuid +import os +import zitadel_client as zitadel +from zitadel_client.auth.personal_access_token_authenticator import PersonalAccessTokenAuthenticator +from zitadel_client.exceptions import UnauthorizedException + +@pytest.fixture +def valid_token(): + """Fixture to return a valid personal access token.""" + return os.getenv("AUTH_TOKEN") + +@pytest.fixture +def invalid_token(): + """Fixture to return an invalid token.""" + return "whoops" + +@pytest.fixture +def base_url(): + """Fixture to return the base URL.""" + return os.getenv("BASE_URL") + +@pytest.fixture +def user_id(valid_token, base_url): + """Fixture to create a user and return their ID.""" + with zitadel.Zitadel(PersonalAccessTokenAuthenticator(base_url, valid_token)) as client: + try: + response = client.users.add_human_user( + body=zitadel.V2AddHumanUserRequest( + username=uuid.uuid4().hex, + profile=zitadel.V2SetHumanProfile(given_name="John", family_name="Doe"), + email=zitadel.V2SetHumanEmail(email=f"johndoe{uuid.uuid4().hex}@caos.ag") + ) + ) + print("User created:", response) + return response.user_id + except Exception as e: + pytest.fail(f"Exception while creating user: {e}") + +def test_should_deactivate_and_reactivate_user_with_valid_token(user_id, valid_token, base_url): + """Test to (de)activate the user with a valid token.""" + with zitadel.Zitadel(PersonalAccessTokenAuthenticator(base_url, valid_token)) as client: + try: + deactivate_response = client.users.deactivate_user(user_id=user_id) + print("User deactivated:", deactivate_response) + + reactivate_response = client.users.reactivate_user(user_id=user_id) + print("User reactivated:", reactivate_response) + # Adjust based on actual response format + # assert reactivate_response["status"] == "success" + except Exception as e: + pytest.fail(f"Exception when calling deactivate_user or reactivate_user with valid token: {e}") + +def test_should_not_deactivate_or_reactivate_user_with_invalid_token(user_id, invalid_token, base_url): + """Test to attempt (de)activating the user with an invalid token.""" + with zitadel.Zitadel(PersonalAccessTokenAuthenticator(base_url, invalid_token)) as client: + try: + client.users.deactivate_user(user_id=user_id) + pytest.fail("Expected exception when deactivating user with invalid token, but got response.") + except UnauthorizedException as e: + print("Caught expected UnauthorizedException:", e) + except Exception as e: + pytest.fail(f"Invalid exception when calling the function: {e}") + + try: + client.users.reactivate_user(user_id=user_id) + pytest.fail("Expected exception when reactivating user with invalid token, but got response.") + except UnauthorizedException as e: + print("Caught expected UnauthorizedException:", e) + except Exception as e: + pytest.fail(f"Invalid exception when calling the function: {e}") From 07616a43c7ff4516dab06ee1777c4f23d9c4dd4e Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Thu, 10 Apr 2025 10:01:44 +0300 Subject: [PATCH 16/21] Passed the token env vars to the test runner to that integration tests may run --- .github/workflows/test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 17b73c04..c6a9a8f2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,3 +32,6 @@ jobs: - name: Run Tests run: poetry run pytest + env: + BASE_URL: ${{ secrets.BASE_URL }} + AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }} From 41a15fee7de37c9d0ab228a3f0f3abbb0767a233 Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Fri, 11 Apr 2025 08:02:53 +0300 Subject: [PATCH 17/21] Added a method to build the webtoken authenticator from a key file --- .../auth/web_token_authenticator.py | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/zitadel_client/auth/web_token_authenticator.py b/zitadel_client/auth/web_token_authenticator.py index b07ef103..f21efb2a 100644 --- a/zitadel_client/auth/web_token_authenticator.py +++ b/zitadel_client/auth/web_token_authenticator.py @@ -1,3 +1,4 @@ +import json from datetime import datetime, timedelta, timezone from typing import Set @@ -63,6 +64,39 @@ def get_grant(self) -> dict: except JoseError as e: raise Exception("Failed to generate JWT assertion: " + str(e)) from e + @classmethod + def from_json(cls, host: str, json_path: str) -> "WebTokenAuthenticator": + """ + Create a WebTokenAuthenticatorBuilder instance from a JSON configuration file. + + Expected JSON format: + { + "type": "serviceaccount", + "keyId": "", + "key": "", + "userId": "" + } + + :param host: Base URL for the API endpoints. + :param json_path: File path to the JSON configuration file. + :return: A new instance of WebTokenAuthenticator. + :raises Exception: If the file cannot be read, the JSON is invalid, + or required keys are missing. + """ + try: + with open(json_path, "r") as file: + config = json.load(file) + except Exception as e: + raise Exception(f"Unable to read JSON file: {json_path}") from e + + user_id = config.get("userId") + private_key = config.get("key") + if not user_id or not private_key: + raise Exception("Missing required keys 'userId' or 'key' in JSON file.") + + return (WebTokenAuthenticator.builder(host, user_id, private_key) + .build()) + @staticmethod def builder(host: str, user_id: str, private_key: str) -> "WebTokenAuthenticatorBuilder": """ From 79ba19bf140366bbe3546f9cfbd5e90093e1e19e Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Sat, 12 Apr 2025 13:46:21 +0300 Subject: [PATCH 18/21] Removed the hardcoding of all the imports in the __init__.py as it is easier to just import the models where needed --- ...rsonal_access_token_authentication_spec.py | 6 +- zitadel_client/__init__.py | 305 ------------------ 2 files changed, 3 insertions(+), 308 deletions(-) diff --git a/spec/sdk_test_using_personal_access_token_authentication_spec.py b/spec/sdk_test_using_personal_access_token_authentication_spec.py index 07922b33..d52dce97 100644 --- a/spec/sdk_test_using_personal_access_token_authentication_spec.py +++ b/spec/sdk_test_using_personal_access_token_authentication_spec.py @@ -26,10 +26,10 @@ def user_id(valid_token, base_url): with zitadel.Zitadel(PersonalAccessTokenAuthenticator(base_url, valid_token)) as client: try: response = client.users.add_human_user( - body=zitadel.V2AddHumanUserRequest( + body=zitadel.models.V2AddHumanUserRequest( username=uuid.uuid4().hex, - profile=zitadel.V2SetHumanProfile(given_name="John", family_name="Doe"), - email=zitadel.V2SetHumanEmail(email=f"johndoe{uuid.uuid4().hex}@caos.ag") + profile=zitadel.models.V2SetHumanProfile(given_name="John", family_name="Doe"), + email=zitadel.models.V2SetHumanEmail(email=f"johndoe{uuid.uuid4().hex}@caos.ag") ) ) print("User created:", response) diff --git a/zitadel_client/__init__.py b/zitadel_client/__init__.py index 9de50ceb..642b1644 100644 --- a/zitadel_client/__init__.py +++ b/zitadel_client/__init__.py @@ -1,32 +1,5 @@ -# coding: utf-8 - -# flake8: noqa - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - __version__ = "0.0.1" -# import apis into sdk package -from zitadel_client.api.feature_service_api import FeatureServiceApi -from zitadel_client.api.identity_provider_service_api import IdentityProviderServiceApi -from zitadel_client.api.oidc_service_api import OIDCServiceApi -from zitadel_client.api.organization_service_api import OrganizationServiceApi -from zitadel_client.api.session_service_api import SessionServiceApi -from zitadel_client.api.settings_api import SettingsApi -from zitadel_client.api.settings_service_api import SettingsServiceApi -from zitadel_client.api.user_service_api import UserServiceApi - -# import ApiClient from zitadel_client.api_response import ApiResponse from zitadel_client.api_client import ApiClient from zitadel_client.configuration import Configuration @@ -37,282 +10,4 @@ from zitadel_client.exceptions import ApiAttributeError from zitadel_client.exceptions import ApiException -# import models into sdk package -from zitadel_client.models.add_organization_request_admin import AddOrganizationRequestAdmin -from zitadel_client.models.add_organization_response_created_admin import AddOrganizationResponseCreatedAdmin -from zitadel_client.models.oidc_service_create_callback_body import OIDCServiceCreateCallbackBody -from zitadel_client.models.otp_email_send_code import OTPEmailSendCode -from zitadel_client.models.objectv2_list_details import Objectv2ListDetails -from zitadel_client.models.objectv2_list_query import Objectv2ListQuery -from zitadel_client.models.protobuf_any import ProtobufAny -from zitadel_client.models.request_challenges_otp_email import RequestChallengesOTPEmail -from zitadel_client.models.request_challenges_otpsms import RequestChallengesOTPSMS -from zitadel_client.models.rpc_status import RpcStatus -from zitadel_client.models.session_service_delete_session_body import SessionServiceDeleteSessionBody -from zitadel_client.models.session_service_set_session_body import SessionServiceSetSessionBody -from zitadel_client.models.user_agent_header_values import UserAgentHeaderValues -from zitadel_client.models.user_service_add_idp_link_body import UserServiceAddIDPLinkBody -from zitadel_client.models.user_service_create_invite_code_body import UserServiceCreateInviteCodeBody -from zitadel_client.models.user_service_create_passkey_registration_link_body import UserServiceCreatePasskeyRegistrationLinkBody -from zitadel_client.models.user_service_list_idp_links_body import UserServiceListIDPLinksBody -from zitadel_client.models.user_service_password_reset_body import UserServicePasswordResetBody -from zitadel_client.models.user_service_register_passkey_body import UserServiceRegisterPasskeyBody -from zitadel_client.models.user_service_register_u2_f_body import UserServiceRegisterU2FBody -from zitadel_client.models.user_service_resend_email_code_body import UserServiceResendEmailCodeBody -from zitadel_client.models.user_service_resend_phone_code_body import UserServiceResendPhoneCodeBody -from zitadel_client.models.user_service_retrieve_identity_provider_intent_body import UserServiceRetrieveIdentityProviderIntentBody -from zitadel_client.models.user_service_send_email_code_body import UserServiceSendEmailCodeBody -from zitadel_client.models.user_service_set_email_body import UserServiceSetEmailBody -from zitadel_client.models.user_service_set_phone_body import UserServiceSetPhoneBody -from zitadel_client.models.user_service_update_human_user_body import UserServiceUpdateHumanUserBody -from zitadel_client.models.user_service_verify_email_body import UserServiceVerifyEmailBody -from zitadel_client.models.user_service_verify_invite_code_body import UserServiceVerifyInviteCodeBody -from zitadel_client.models.user_service_verify_passkey_registration_body import UserServiceVerifyPasskeyRegistrationBody -from zitadel_client.models.user_service_verify_phone_body import UserServiceVerifyPhoneBody -from zitadel_client.models.user_service_verify_totp_registration_body import UserServiceVerifyTOTPRegistrationBody -from zitadel_client.models.user_service_verify_u2_f_registration_body import UserServiceVerifyU2FRegistrationBody -from zitadel_client.models.userv2_set_password import Userv2SetPassword -from zitadel_client.models.userv2_type import Userv2Type -from zitadel_client.models.v2_access_token_type import V2AccessTokenType -from zitadel_client.models.v2_add_human_user_request import V2AddHumanUserRequest -from zitadel_client.models.v2_add_human_user_request1 import V2AddHumanUserRequest1 -from zitadel_client.models.v2_add_human_user_response import V2AddHumanUserResponse -from zitadel_client.models.v2_add_idp_link_response import V2AddIDPLinkResponse -from zitadel_client.models.v2_add_otp_email_response import V2AddOTPEmailResponse -from zitadel_client.models.v2_add_otpsms_response import V2AddOTPSMSResponse -from zitadel_client.models.v2_add_organization_request import V2AddOrganizationRequest -from zitadel_client.models.v2_add_organization_response import V2AddOrganizationResponse -from zitadel_client.models.v2_and_query import V2AndQuery -from zitadel_client.models.v2_apple_config import V2AppleConfig -from zitadel_client.models.v2_auth_factor import V2AuthFactor -from zitadel_client.models.v2_auth_factor_state import V2AuthFactorState -from zitadel_client.models.v2_auth_factor_u2_f import V2AuthFactorU2F -from zitadel_client.models.v2_auth_request import V2AuthRequest -from zitadel_client.models.v2_authentication_method_type import V2AuthenticationMethodType -from zitadel_client.models.v2_authorization_error import V2AuthorizationError -from zitadel_client.models.v2_auto_linking_option import V2AutoLinkingOption -from zitadel_client.models.v2_azure_ad_config import V2AzureADConfig -from zitadel_client.models.v2_azure_ad_tenant import V2AzureADTenant -from zitadel_client.models.v2_azure_ad_tenant_type import V2AzureADTenantType -from zitadel_client.models.v2_branding_settings import V2BrandingSettings -from zitadel_client.models.v2_challenges import V2Challenges -from zitadel_client.models.v2_challenges_web_auth_n import V2ChallengesWebAuthN -from zitadel_client.models.v2_check_idp_intent import V2CheckIDPIntent -from zitadel_client.models.v2_check_otp import V2CheckOTP -from zitadel_client.models.v2_check_password import V2CheckPassword -from zitadel_client.models.v2_check_totp import V2CheckTOTP -from zitadel_client.models.v2_check_user import V2CheckUser -from zitadel_client.models.v2_check_web_auth_n import V2CheckWebAuthN -from zitadel_client.models.v2_checks import V2Checks -from zitadel_client.models.v2_create_callback_response import V2CreateCallbackResponse -from zitadel_client.models.v2_create_invite_code_response import V2CreateInviteCodeResponse -from zitadel_client.models.v2_create_passkey_registration_link_response import V2CreatePasskeyRegistrationLinkResponse -from zitadel_client.models.v2_create_session_request import V2CreateSessionRequest -from zitadel_client.models.v2_create_session_response import V2CreateSessionResponse -from zitadel_client.models.v2_creation_date_query import V2CreationDateQuery -from zitadel_client.models.v2_creator_query import V2CreatorQuery -from zitadel_client.models.v2_deactivate_user_response import V2DeactivateUserResponse -from zitadel_client.models.v2_delete_session_response import V2DeleteSessionResponse -from zitadel_client.models.v2_delete_user_response import V2DeleteUserResponse -from zitadel_client.models.v2_details import V2Details -from zitadel_client.models.v2_display_name_query import V2DisplayNameQuery -from zitadel_client.models.v2_domain_settings import V2DomainSettings -from zitadel_client.models.v2_email_query import V2EmailQuery -from zitadel_client.models.v2_embedded_iframe_settings import V2EmbeddedIframeSettings -from zitadel_client.models.v2_error_reason import V2ErrorReason -from zitadel_client.models.v2_factors import V2Factors -from zitadel_client.models.v2_feature_flag import V2FeatureFlag -from zitadel_client.models.v2_first_name_query import V2FirstNameQuery -from zitadel_client.models.v2_gender import V2Gender -from zitadel_client.models.v2_generic_oidc_config import V2GenericOIDCConfig -from zitadel_client.models.v2_get_active_identity_providers_response import V2GetActiveIdentityProvidersResponse -from zitadel_client.models.v2_get_auth_request_response import V2GetAuthRequestResponse -from zitadel_client.models.v2_get_branding_settings_response import V2GetBrandingSettingsResponse -from zitadel_client.models.v2_get_domain_settings_response import V2GetDomainSettingsResponse -from zitadel_client.models.v2_get_general_settings_response import V2GetGeneralSettingsResponse -from zitadel_client.models.v2_get_idpby_id_response import V2GetIDPByIDResponse -from zitadel_client.models.v2_get_instance_features_response import V2GetInstanceFeaturesResponse -from zitadel_client.models.v2_get_legal_and_support_settings_response import V2GetLegalAndSupportSettingsResponse -from zitadel_client.models.v2_get_lockout_settings_response import V2GetLockoutSettingsResponse -from zitadel_client.models.v2_get_login_settings_response import V2GetLoginSettingsResponse -from zitadel_client.models.v2_get_organization_features_response import V2GetOrganizationFeaturesResponse -from zitadel_client.models.v2_get_password_complexity_settings_response import V2GetPasswordComplexitySettingsResponse -from zitadel_client.models.v2_get_password_expiry_settings_response import V2GetPasswordExpirySettingsResponse -from zitadel_client.models.v2_get_security_settings_response import V2GetSecuritySettingsResponse -from zitadel_client.models.v2_get_session_response import V2GetSessionResponse -from zitadel_client.models.v2_get_system_features_response import V2GetSystemFeaturesResponse -from zitadel_client.models.v2_get_user_by_id_response import V2GetUserByIDResponse -from zitadel_client.models.v2_get_user_features_response import V2GetUserFeaturesResponse -from zitadel_client.models.v2_git_hub_config import V2GitHubConfig -from zitadel_client.models.v2_git_hub_enterprise_server_config import V2GitHubEnterpriseServerConfig -from zitadel_client.models.v2_git_lab_config import V2GitLabConfig -from zitadel_client.models.v2_git_lab_self_hosted_config import V2GitLabSelfHostedConfig -from zitadel_client.models.v2_google_config import V2GoogleConfig -from zitadel_client.models.v2_hashed_password import V2HashedPassword -from zitadel_client.models.v2_human_email import V2HumanEmail -from zitadel_client.models.v2_human_mfa_init_skipped_response import V2HumanMFAInitSkippedResponse -from zitadel_client.models.v2_human_phone import V2HumanPhone -from zitadel_client.models.v2_human_profile import V2HumanProfile -from zitadel_client.models.v2_human_user import V2HumanUser -from zitadel_client.models.v2_idp import V2IDP -from zitadel_client.models.v2_idp_config import V2IDPConfig -from zitadel_client.models.v2_idp_information import V2IDPInformation -from zitadel_client.models.v2_idp_intent import V2IDPIntent -from zitadel_client.models.v2_idpldap_access_information import V2IDPLDAPAccessInformation -from zitadel_client.models.v2_idp_link import V2IDPLink -from zitadel_client.models.v2_idpo_auth_access_information import V2IDPOAuthAccessInformation -from zitadel_client.models.v2_idpsaml_access_information import V2IDPSAMLAccessInformation -from zitadel_client.models.v2_idp_state import V2IDPState -from zitadel_client.models.v2_idp_type import V2IDPType -from zitadel_client.models.v2_ids_query import V2IDsQuery -from zitadel_client.models.v2_identity_provider import V2IdentityProvider -from zitadel_client.models.v2_identity_provider_type import V2IdentityProviderType -from zitadel_client.models.v2_improved_performance import V2ImprovedPerformance -from zitadel_client.models.v2_improved_performance_feature_flag import V2ImprovedPerformanceFeatureFlag -from zitadel_client.models.v2_in_user_emails_query import V2InUserEmailsQuery -from zitadel_client.models.v2_in_user_id_query import V2InUserIDQuery -from zitadel_client.models.v2_intent_factor import V2IntentFactor -from zitadel_client.models.v2_jwt_config import V2JWTConfig -from zitadel_client.models.v2_ldap_attributes import V2LDAPAttributes -from zitadel_client.models.v2_ldap_config import V2LDAPConfig -from zitadel_client.models.v2_ldap_credentials import V2LDAPCredentials -from zitadel_client.models.v2_last_name_query import V2LastNameQuery -from zitadel_client.models.v2_legal_and_support_settings import V2LegalAndSupportSettings -from zitadel_client.models.v2_list_authentication_factors_response import V2ListAuthenticationFactorsResponse -from zitadel_client.models.v2_list_authentication_method_types_response import V2ListAuthenticationMethodTypesResponse -from zitadel_client.models.v2_list_details import V2ListDetails -from zitadel_client.models.v2_list_idp_links_response import V2ListIDPLinksResponse -from zitadel_client.models.v2_list_organizations_request import V2ListOrganizationsRequest -from zitadel_client.models.v2_list_organizations_response import V2ListOrganizationsResponse -from zitadel_client.models.v2_list_passkeys_response import V2ListPasskeysResponse -from zitadel_client.models.v2_list_query import V2ListQuery -from zitadel_client.models.v2_list_sessions_request import V2ListSessionsRequest -from zitadel_client.models.v2_list_sessions_response import V2ListSessionsResponse -from zitadel_client.models.v2_list_users_request import V2ListUsersRequest -from zitadel_client.models.v2_list_users_response import V2ListUsersResponse -from zitadel_client.models.v2_lock_user_response import V2LockUserResponse -from zitadel_client.models.v2_lockout_settings import V2LockoutSettings -from zitadel_client.models.v2_login_name_query import V2LoginNameQuery -from zitadel_client.models.v2_login_settings import V2LoginSettings -from zitadel_client.models.v2_login_v2 import V2LoginV2 -from zitadel_client.models.v2_login_v2_feature_flag import V2LoginV2FeatureFlag -from zitadel_client.models.v2_machine_user import V2MachineUser -from zitadel_client.models.v2_multi_factor_type import V2MultiFactorType -from zitadel_client.models.v2_nick_name_query import V2NickNameQuery -from zitadel_client.models.v2_not_query import V2NotQuery -from zitadel_client.models.v2_notification_type import V2NotificationType -from zitadel_client.models.v2_o_auth_config import V2OAuthConfig -from zitadel_client.models.v2_otp_factor import V2OTPFactor -from zitadel_client.models.v2_or_query import V2OrQuery -from zitadel_client.models.v2_organization import V2Organization -from zitadel_client.models.v2_organization_domain_query import V2OrganizationDomainQuery -from zitadel_client.models.v2_organization_field_name import V2OrganizationFieldName -from zitadel_client.models.v2_organization_id_query import V2OrganizationIDQuery -from zitadel_client.models.v2_organization_name_query import V2OrganizationNameQuery -from zitadel_client.models.v2_organization_state import V2OrganizationState -from zitadel_client.models.v2_organization_state_query import V2OrganizationStateQuery -from zitadel_client.models.v2_passkey import V2Passkey -from zitadel_client.models.v2_passkey_authenticator import V2PasskeyAuthenticator -from zitadel_client.models.v2_passkey_registration_code import V2PasskeyRegistrationCode -from zitadel_client.models.v2_passkeys_type import V2PasskeysType -from zitadel_client.models.v2_password import V2Password -from zitadel_client.models.v2_password_complexity_settings import V2PasswordComplexitySettings -from zitadel_client.models.v2_password_expiry_settings import V2PasswordExpirySettings -from zitadel_client.models.v2_password_factor import V2PasswordFactor -from zitadel_client.models.v2_password_reset_response import V2PasswordResetResponse -from zitadel_client.models.v2_phone_query import V2PhoneQuery -from zitadel_client.models.v2_prompt import V2Prompt -from zitadel_client.models.v2_reactivate_user_response import V2ReactivateUserResponse -from zitadel_client.models.v2_redirect_urls import V2RedirectURLs -from zitadel_client.models.v2_register_passkey_response import V2RegisterPasskeyResponse -from zitadel_client.models.v2_register_totp_response import V2RegisterTOTPResponse -from zitadel_client.models.v2_register_u2_f_response import V2RegisterU2FResponse -from zitadel_client.models.v2_remove_idp_link_response import V2RemoveIDPLinkResponse -from zitadel_client.models.v2_remove_otp_email_response import V2RemoveOTPEmailResponse -from zitadel_client.models.v2_remove_otpsms_response import V2RemoveOTPSMSResponse -from zitadel_client.models.v2_remove_passkey_response import V2RemovePasskeyResponse -from zitadel_client.models.v2_remove_phone_response import V2RemovePhoneResponse -from zitadel_client.models.v2_remove_totp_response import V2RemoveTOTPResponse -from zitadel_client.models.v2_remove_u2_f_response import V2RemoveU2FResponse -from zitadel_client.models.v2_request_challenges import V2RequestChallenges -from zitadel_client.models.v2_request_challenges_web_auth_n import V2RequestChallengesWebAuthN -from zitadel_client.models.v2_resend_email_code_response import V2ResendEmailCodeResponse -from zitadel_client.models.v2_resend_invite_code_response import V2ResendInviteCodeResponse -from zitadel_client.models.v2_resend_phone_code_response import V2ResendPhoneCodeResponse -from zitadel_client.models.v2_reset_instance_features_response import V2ResetInstanceFeaturesResponse -from zitadel_client.models.v2_reset_organization_features_response import V2ResetOrganizationFeaturesResponse -from zitadel_client.models.v2_reset_system_features_response import V2ResetSystemFeaturesResponse -from zitadel_client.models.v2_reset_user_features_response import V2ResetUserFeaturesResponse -from zitadel_client.models.v2_resource_owner_type import V2ResourceOwnerType -from zitadel_client.models.v2_retrieve_identity_provider_intent_response import V2RetrieveIdentityProviderIntentResponse -from zitadel_client.models.v2_saml_binding import V2SAMLBinding -from zitadel_client.models.v2_saml_config import V2SAMLConfig -from zitadel_client.models.v2_saml_name_id_format import V2SAMLNameIDFormat -from zitadel_client.models.v2_search_query import V2SearchQuery -from zitadel_client.models.v2_search_query1 import V2SearchQuery1 -from zitadel_client.models.v2_second_factor_type import V2SecondFactorType -from zitadel_client.models.v2_security_settings import V2SecuritySettings -from zitadel_client.models.v2_send_email_code_response import V2SendEmailCodeResponse -from zitadel_client.models.v2_send_email_verification_code import V2SendEmailVerificationCode -from zitadel_client.models.v2_send_invite_code import V2SendInviteCode -from zitadel_client.models.v2_send_passkey_registration_link import V2SendPasskeyRegistrationLink -from zitadel_client.models.v2_send_password_reset_link import V2SendPasswordResetLink -from zitadel_client.models.v2_session import V2Session -from zitadel_client.models.v2_session1 import V2Session1 -from zitadel_client.models.v2_session_field_name import V2SessionFieldName -from zitadel_client.models.v2_set_email_response import V2SetEmailResponse -from zitadel_client.models.v2_set_human_email import V2SetHumanEmail -from zitadel_client.models.v2_set_human_email1 import V2SetHumanEmail1 -from zitadel_client.models.v2_set_human_phone import V2SetHumanPhone -from zitadel_client.models.v2_set_human_phone1 import V2SetHumanPhone1 -from zitadel_client.models.v2_set_human_profile import V2SetHumanProfile -from zitadel_client.models.v2_set_human_profile1 import V2SetHumanProfile1 -from zitadel_client.models.v2_set_instance_features_request import V2SetInstanceFeaturesRequest -from zitadel_client.models.v2_set_instance_features_response import V2SetInstanceFeaturesResponse -from zitadel_client.models.v2_set_metadata_entry import V2SetMetadataEntry -from zitadel_client.models.v2_set_metadata_entry1 import V2SetMetadataEntry1 -from zitadel_client.models.v2_set_organization_features_response import V2SetOrganizationFeaturesResponse -from zitadel_client.models.v2_set_password_response import V2SetPasswordResponse -from zitadel_client.models.v2_set_phone_response import V2SetPhoneResponse -from zitadel_client.models.v2_set_security_settings_request import V2SetSecuritySettingsRequest -from zitadel_client.models.v2_set_security_settings_response import V2SetSecuritySettingsResponse -from zitadel_client.models.v2_set_session_response import V2SetSessionResponse -from zitadel_client.models.v2_set_system_features_request import V2SetSystemFeaturesRequest -from zitadel_client.models.v2_set_system_features_response import V2SetSystemFeaturesResponse -from zitadel_client.models.v2_set_user_features_response import V2SetUserFeaturesResponse -from zitadel_client.models.v2_source import V2Source -from zitadel_client.models.v2_start_identity_provider_intent_request import V2StartIdentityProviderIntentRequest -from zitadel_client.models.v2_start_identity_provider_intent_response import V2StartIdentityProviderIntentResponse -from zitadel_client.models.v2_state_query import V2StateQuery -from zitadel_client.models.v2_totp_factor import V2TOTPFactor -from zitadel_client.models.v2_text_query_method import V2TextQueryMethod -from zitadel_client.models.v2_theme import V2Theme -from zitadel_client.models.v2_theme_mode import V2ThemeMode -from zitadel_client.models.v2_type_query import V2TypeQuery -from zitadel_client.models.v2_unlock_user_response import V2UnlockUserResponse -from zitadel_client.models.v2_update_human_user_response import V2UpdateHumanUserResponse -from zitadel_client.models.v2_user import V2User -from zitadel_client.models.v2_user_agent import V2UserAgent -from zitadel_client.models.v2_user_agent_query import V2UserAgentQuery -from zitadel_client.models.v2_user_factor import V2UserFactor -from zitadel_client.models.v2_user_field_name import V2UserFieldName -from zitadel_client.models.v2_user_id_query import V2UserIDQuery -from zitadel_client.models.v2_user_name_query import V2UserNameQuery -from zitadel_client.models.v2_user_service_set_password_body import V2UserServiceSetPasswordBody -from zitadel_client.models.v2_user_state import V2UserState -from zitadel_client.models.v2_user_verification_requirement import V2UserVerificationRequirement -from zitadel_client.models.v2_verify_email_response import V2VerifyEmailResponse -from zitadel_client.models.v2_verify_invite_code_response import V2VerifyInviteCodeResponse -from zitadel_client.models.v2_verify_passkey_registration_response import V2VerifyPasskeyRegistrationResponse -from zitadel_client.models.v2_verify_phone_response import V2VerifyPhoneResponse -from zitadel_client.models.v2_verify_totp_registration_response import V2VerifyTOTPRegistrationResponse -from zitadel_client.models.v2_verify_u2_f_registration_response import V2VerifyU2FRegistrationResponse -from zitadel_client.models.v2_web_auth_n_factor import V2WebAuthNFactor -from zitadel_client.models.zitadelidpv2_options import Zitadelidpv2Options -from zitadel_client.models.zitadelidpv2_options1 import Zitadelidpv2Options1 -from zitadel_client.models.zitadelobjectv2_organization import Zitadelobjectv2Organization -from zitadel_client.models.zitadelorgv2_organization import Zitadelorgv2Organization -from zitadel_client.models.zitadelorgv2_search_query import Zitadelorgv2SearchQuery -from zitadel_client.models.zitadelv1_timestamp_query_method import Zitadelv1TimestampQueryMethod - from zitadel_client.zitadel import Zitadel From 99e9e096a80ab5d85b188fdedd8ce87144d6e57d Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Mon, 14 Apr 2025 11:45:06 +0300 Subject: [PATCH 19/21] Added tests to ensure that the JWT token based authentication is working as expected --- .github/workflows/test.yml | 1 + spec/conftest.py | 1 + ...rsonal_access_token_authentication_spec.py | 12 +- ...est_using_web_token_authentication_spec.py | 57 ++++ zitadel_client/auth/authenticator.py | 138 ++++----- .../auth/client_credentials_authenticator.py | 104 +++---- zitadel_client/auth/no_auth_authenticator.py | 34 +-- zitadel_client/auth/oauth_authenticator.py | 103 +++---- zitadel_client/auth/open_id.py | 88 +++--- .../personal_access_token_authenticator.py | 26 +- .../auth/web_token_authenticator.py | 288 +++++++++--------- 11 files changed, 464 insertions(+), 388 deletions(-) create mode 100644 spec/sdk_test_using_web_token_authentication_spec.py diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c6a9a8f2..57b22a68 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,3 +35,4 @@ jobs: env: BASE_URL: ${{ secrets.BASE_URL }} AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }} + JWT_KEY: ${{ secrets.JWT_KEY }} diff --git a/spec/conftest.py b/spec/conftest.py index 8cc93d52..ac145e8d 100644 --- a/spec/conftest.py +++ b/spec/conftest.py @@ -1,6 +1,7 @@ import pytest from dotenv import load_dotenv + @pytest.fixture(scope="session", autouse=True) def load_env(): """Load the .env file for the entire test session.""" diff --git a/spec/sdk_test_using_personal_access_token_authentication_spec.py b/spec/sdk_test_using_personal_access_token_authentication_spec.py index d52dce97..177d3b71 100644 --- a/spec/sdk_test_using_personal_access_token_authentication_spec.py +++ b/spec/sdk_test_using_personal_access_token_authentication_spec.py @@ -1,25 +1,31 @@ -import pytest -import uuid import os +import uuid + +import pytest + import zitadel_client as zitadel from zitadel_client.auth.personal_access_token_authenticator import PersonalAccessTokenAuthenticator from zitadel_client.exceptions import UnauthorizedException + @pytest.fixture def valid_token(): """Fixture to return a valid personal access token.""" return os.getenv("AUTH_TOKEN") + @pytest.fixture def invalid_token(): """Fixture to return an invalid token.""" return "whoops" + @pytest.fixture def base_url(): """Fixture to return the base URL.""" return os.getenv("BASE_URL") + @pytest.fixture def user_id(valid_token, base_url): """Fixture to create a user and return their ID.""" @@ -37,6 +43,7 @@ def user_id(valid_token, base_url): except Exception as e: pytest.fail(f"Exception while creating user: {e}") + def test_should_deactivate_and_reactivate_user_with_valid_token(user_id, valid_token, base_url): """Test to (de)activate the user with a valid token.""" with zitadel.Zitadel(PersonalAccessTokenAuthenticator(base_url, valid_token)) as client: @@ -51,6 +58,7 @@ def test_should_deactivate_and_reactivate_user_with_valid_token(user_id, valid_t except Exception as e: pytest.fail(f"Exception when calling deactivate_user or reactivate_user with valid token: {e}") + def test_should_not_deactivate_or_reactivate_user_with_invalid_token(user_id, invalid_token, base_url): """Test to attempt (de)activating the user with an invalid token.""" with zitadel.Zitadel(PersonalAccessTokenAuthenticator(base_url, invalid_token)) as client: diff --git a/spec/sdk_test_using_web_token_authentication_spec.py b/spec/sdk_test_using_web_token_authentication_spec.py new file mode 100644 index 00000000..3a5e3eec --- /dev/null +++ b/spec/sdk_test_using_web_token_authentication_spec.py @@ -0,0 +1,57 @@ +import os +import tempfile +import uuid + +import pytest + +import zitadel_client as zitadel +from zitadel_client.auth.web_token_authenticator import WebTokenAuthenticator + + +@pytest.fixture +def key_file(): + jwt_key = os.getenv("JWT_KEY") + if jwt_key is None: + pytest.fail("JWT_KEY is not set in the environment") + with tempfile.NamedTemporaryFile(delete=False, mode="w") as tf: + tf.write(jwt_key) + return tf.name + + +@pytest.fixture +def base_url(): + """Fixture to return the base URL.""" + return os.getenv("BASE_URL") + + +@pytest.fixture +def user_id(key_file, base_url): + """Fixture to create a user and return their ID.""" + with zitadel.Zitadel(WebTokenAuthenticator.from_json(base_url, key_file)) as client: + try: + response = client.users.add_human_user( + body=zitadel.models.V2AddHumanUserRequest( + username=uuid.uuid4().hex, + profile=zitadel.models.V2SetHumanProfile(given_name="John", family_name="Doe"), + email=zitadel.models.V2SetHumanEmail(email=f"johndoe{uuid.uuid4().hex}@caos.ag") + ) + ) + print("User created:", response) + return response.user_id + except Exception as e: + pytest.fail(f"Exception while creating user: {e}") + + +def test_should_deactivate_and_reactivate_user_with_valid_token(user_id, key_file, base_url): + """Test to (de)activate the user with a valid token.""" + with zitadel.Zitadel(WebTokenAuthenticator.from_json(base_url, key_file)) as client: + try: + deactivate_response = client.users.deactivate_user(user_id=user_id) + print("User deactivated:", deactivate_response) + + reactivate_response = client.users.reactivate_user(user_id=user_id) + print("User reactivated:", reactivate_response) + # Adjust based on actual response format + # assert reactivate_response["status"] == "success" + except Exception as e: + pytest.fail(f"Exception when calling deactivate_user or reactivate_user with valid token: {e}") diff --git a/zitadel_client/auth/authenticator.py b/zitadel_client/auth/authenticator.py index eed26844..ea0a37bc 100644 --- a/zitadel_client/auth/authenticator.py +++ b/zitadel_client/auth/authenticator.py @@ -6,95 +6,95 @@ class Authenticator(ABC): - """ - Abstract base class for authenticators. - - This class defines the basic structure for any authenticator by requiring the implementation - of a method to retrieve authentication headers, and provides a way to store and retrieve the host. - """ - - def __init__(self, host: str): """ - Initializes the Authenticator with the specified host. + Abstract base class for authenticators. - :param host: The base URL or endpoint for the service. + This class defines the basic structure for any authenticator by requiring the implementation + of a method to retrieve authentication headers, and provides a way to store and retrieve the host. """ - self.host = host - - @abstractmethod - def get_auth_headers(self) -> Dict[str, str]: - """ - Retrieves the authentication headers to be sent with requests. - - Subclasses must override this method to return the appropriate headers. - :return: A dictionary mapping header names to their values. - """ - pass + def __init__(self, host: str): + """ + Initializes the Authenticator with the specified host. - def get_host(self) -> str: - """ - Returns the stored host. + :param host: The base URL or endpoint for the service. + """ + self.host = host - :return: The host as a string. - """ - return self.host + @abstractmethod + def get_auth_headers(self) -> Dict[str, str]: + """ + Retrieves the authentication headers to be sent with requests. + Subclasses must override this method to return the appropriate headers. -class Token: - def __init__(self, access_token: str, expires_at: datetime): - """ - Initializes a new Token instance. + :return: A dictionary mapping header names to their values. + """ + pass - Parameters: - - access_token (str): The JWT or OAuth token. - - expires_at (datetime): The expiration time of the token. It should be timezone-aware. - If a naive datetime is provided, it will be converted to an aware datetime in UTC. - """ - self.access_token = access_token + def get_host(self) -> str: + """ + Returns the stored host. - # Ensure expires_at is timezone-aware. If naive, assume UTC. - if expires_at.tzinfo is None: - self.expires_at = expires_at.replace(tzinfo=timezone.utc) - else: - self.expires_at = expires_at + :return: The host as a string. + """ + return self.host - def is_expired(self) -> bool: - """ - Checks if the token is expired by comparing the current UTC time - with the token's expiration time. - Returns: - - bool: True if expired, False otherwise. - """ - return datetime.now(timezone.utc) >= self.expires_at +class Token: + def __init__(self, access_token: str, expires_at: datetime): + """ + Initializes a new Token instance. + + Parameters: + - access_token (str): The JWT or OAuth token. + - expires_at (datetime): The expiration time of the token. It should be timezone-aware. + If a naive datetime is provided, it will be converted to an aware datetime in UTC. + """ + self.access_token = access_token + + # Ensure expires_at is timezone-aware. If naive, assume UTC. + if expires_at.tzinfo is None: + self.expires_at = expires_at.replace(tzinfo=timezone.utc) + else: + self.expires_at = expires_at + + def is_expired(self) -> bool: + """ + Checks if the token is expired by comparing the current UTC time + with the token's expiration time. + + Returns: + - bool: True if expired, False otherwise. + """ + return datetime.now(timezone.utc) >= self.expires_at T = TypeVar("T", bound="OAuthAuthenticatorBuilder") class OAuthAuthenticatorBuilder(ABC, Generic[T]): - """ - Abstract builder class for constructing OAuth authenticator instances. - - This builder provides common configuration options such as the OpenId instance and authentication scopes. - """ - - def __init__(self, host: str): """ - Initializes the OAuthAuthenticatorBuilder with a given host. + Abstract builder class for constructing OAuth authenticator instances. - :param host: The base URL for the OAuth provider. + This builder provides common configuration options such as the OpenId instance and authentication scopes. """ - self.open_id = OpenId(host) - self.auth_scopes = {"openid", "urn:zitadel:iam:org:project:id:zitadel:aud"} - def scopes(self: T, *auth_scopes: str) -> T: - """ - Sets the authentication scopes for the OAuth authenticator. + def __init__(self, host: str): + """ + Initializes the OAuthAuthenticatorBuilder with a given host. - :param auth_scopes: A variable number of scope strings. - :return: The builder instance to allow for method chaining. - """ - self.auth_scopes = set(auth_scopes) - return self + :param host: The base URL for the OAuth provider. + """ + self.open_id = OpenId(host) + self.auth_scopes = {"openid", "urn:zitadel:iam:org:project:id:zitadel:aud"} + + def scopes(self: T, *auth_scopes: str) -> T: + """ + Sets the authentication scopes for the OAuth authenticator. + + :param auth_scopes: A variable number of scope strings. + :return: The builder instance to allow for method chaining. + """ + self.auth_scopes = set(auth_scopes) + return self diff --git a/zitadel_client/auth/client_credentials_authenticator.py b/zitadel_client/auth/client_credentials_authenticator.py index 03f150b7..2e54209e 100644 --- a/zitadel_client/auth/client_credentials_authenticator.py +++ b/zitadel_client/auth/client_credentials_authenticator.py @@ -8,70 +8,70 @@ class ClientCredentialsAuthenticator(OAuthAuthenticator): - """ - OAuth authenticator implementing the client credentials flow. - - Uses client_id and client_secret to obtain an access token from the OAuth2 token endpoint. - """ - - def __init__(self, open_id: OpenId, client_id: str, client_secret: str, auth_scopes: Set[str]): """ - Constructs a ClientCredentialsAuthenticator. + OAuth authenticator implementing the client credentials flow. - :param open_id: The base URL for the OAuth provider. - :param client_id: The OAuth client identifier. - :param client_secret: The OAuth client secret. - :param auth_scopes: The scope(s) for the token request. + Uses client_id and client_secret to obtain an access token from the OAuth2 token endpoint. """ - super().__init__(open_id, - OAuth2Session(client_id=client_id, client_secret=client_secret, scope=" ".join(auth_scopes))) - @override - def get_grant(self) -> dict: - """ - Returns the grant parameters for the client credentials flow. + def __init__(self, open_id: OpenId, client_id: str, client_secret: str, auth_scopes: Set[str]): + """ + Constructs a ClientCredentialsAuthenticator. - :return: A dictionary with the grant type for client credentials. - """ - return {"grant_type": "client_credentials"} + :param open_id: The base URL for the OAuth provider. + :param client_id: The OAuth client identifier. + :param client_secret: The OAuth client secret. + :param auth_scopes: The scope(s) for the token request. + """ + super().__init__(open_id, + OAuth2Session(client_id=client_id, client_secret=client_secret, scope=" ".join(auth_scopes))) - @staticmethod - def builder(host: str, client_id: str, client_secret: str) -> "ClientCredentialsAuthenticatorBuilder": - """ - Returns a builder for constructing a ClientCredentialsAuthenticator. + @override + def get_grant(self) -> dict: + """ + Returns the grant parameters for the client credentials flow. - :param host: The base URL for the OAuth provider. - :param client_id: The OAuth client identifier. - :param client_secret: The OAuth client secret. - :return: A ClientCredentialsAuthenticatorBuilder instance. - """ - return ClientCredentialsAuthenticatorBuilder(host, client_id, client_secret) + :return: A dictionary with the grant type for client credentials. + """ + return {"grant_type": "client_credentials"} + @staticmethod + def builder(host: str, client_id: str, client_secret: str) -> "ClientCredentialsAuthenticatorBuilder": + """ + Returns a builder for constructing a ClientCredentialsAuthenticator. -class ClientCredentialsAuthenticatorBuilder(OAuthAuthenticatorBuilder): - """ - Builder class for constructing ClientCredentialsAuthenticator instances. - - This builder extends the OAuthAuthenticatorBuilder with client credentials (client_id and client_secret) - required for the client credentials flow. - """ + :param host: The base URL for the OAuth provider. + :param client_id: The OAuth client identifier. + :param client_secret: The OAuth client secret. + :return: A ClientCredentialsAuthenticatorBuilder instance. + """ + return ClientCredentialsAuthenticatorBuilder(host, client_id, client_secret) - def __init__(self, host: str, client_id: str, client_secret: str): - """ - Initializes the ClientCredentialsAuthenticatorBuilder with host, client ID, and client secret. - :param host: The base URL for the OAuth provider. - :param client_id: The OAuth client identifier. - :param client_secret: The OAuth client secret. +class ClientCredentialsAuthenticatorBuilder(OAuthAuthenticatorBuilder): """ - super().__init__(host) - self.client_id = client_id - self.client_secret = client_secret + Builder class for constructing ClientCredentialsAuthenticator instances. - def build(self) -> ClientCredentialsAuthenticator: + This builder extends the OAuthAuthenticatorBuilder with client credentials (client_id and client_secret) + required for the client credentials flow. """ - Constructs and returns a ClientCredentialsAuthenticator instance using the configured parameters. - :return: A configured ClientCredentialsAuthenticator. - """ - return ClientCredentialsAuthenticator(self.open_id, self.client_id, self.client_secret, self.auth_scopes) + def __init__(self, host: str, client_id: str, client_secret: str): + """ + Initializes the ClientCredentialsAuthenticatorBuilder with host, client ID, and client secret. + + :param host: The base URL for the OAuth provider. + :param client_id: The OAuth client identifier. + :param client_secret: The OAuth client secret. + """ + super().__init__(host) + self.client_id = client_id + self.client_secret = client_secret + + def build(self) -> ClientCredentialsAuthenticator: + """ + Constructs and returns a ClientCredentialsAuthenticator instance using the configured parameters. + + :return: A configured ClientCredentialsAuthenticator. + """ + return ClientCredentialsAuthenticator(self.open_id, self.client_id, self.client_secret, self.auth_scopes) diff --git a/zitadel_client/auth/no_auth_authenticator.py b/zitadel_client/auth/no_auth_authenticator.py index f76eee9f..c6df71f3 100644 --- a/zitadel_client/auth/no_auth_authenticator.py +++ b/zitadel_client/auth/no_auth_authenticator.py @@ -4,25 +4,25 @@ class NoAuthAuthenticator(Authenticator): - """ - A simple authenticator that performs no authentication. - - This authenticator is useful for cases where no token or credentials are required. - It simply returns an empty dictionary for authentication headers. - """ - - def __init__(self, host: str = "http://localhost"): """ - Initializes the NoAuthAuthenticator with a default host. + A simple authenticator that performs no authentication. - :param host: The base URL for the service. Defaults to "http://localhost". + This authenticator is useful for cases where no token or credentials are required. + It simply returns an empty dictionary for authentication headers. """ - super().__init__(host) - def get_auth_headers(self) -> Dict[str, str]: - """ - Returns an empty dictionary since no authentication is performed. + def __init__(self, host: str = "http://localhost"): + """ + Initializes the NoAuthAuthenticator with a default host. - :return: An empty dictionary. - """ - return {} + :param host: The base URL for the service. Defaults to "http://localhost". + """ + super().__init__(host) + + def get_auth_headers(self) -> Dict[str, str]: + """ + Returns an empty dictionary since no authentication is performed. + + :return: An empty dictionary. + """ + return {} diff --git a/zitadel_client/auth/oauth_authenticator.py b/zitadel_client/auth/oauth_authenticator.py index a81044df..eb595c1a 100644 --- a/zitadel_client/auth/oauth_authenticator.py +++ b/zitadel_client/auth/oauth_authenticator.py @@ -9,64 +9,65 @@ class OAuthAuthenticator(Authenticator, ABC): - """ - Base class for OAuth-based authentication using Authlib. - - Attributes: - open_id: An object providing OAuth endpoint information. - oauth_session: An OAuth2Session instance used for fetching tokens. - """ - - def __init__(self, open_id: OpenId, oauth_session: OAuth2Session): """ - Constructs an OAuthAuthenticator. + Base class for OAuth-based authentication using Authlib. - :param open_id: An object that must implement get_host_endpoint() and get_token_endpoint(). - :param oauth_session: The scope for the token request. + Attributes: + open_id: An object providing OAuth endpoint information. + oauth_session: An OAuth2Session instance used for fetching tokens. """ - super().__init__(open_id.get_host_endpoint()) - self.open_id = open_id - self.token: Optional[Token] = None - self.oauth_session = oauth_session - def get_auth_token(self) -> str: - """ - Returns the current access token, refreshing it if necessary. - """ - if self.token is None or self.token.is_expired(): - self.refresh_token() - return self.token.access_token + def __init__(self, open_id: OpenId, oauth_session: OAuth2Session): + """ + Constructs an OAuthAuthenticator. - def get_auth_headers(self) -> Dict[str, str]: - """ - Retrieves authentication headers. + :param open_id: An object that must implement get_host_endpoint() and get_token_endpoint(). + :param oauth_session: The scope for the token request. + """ + super().__init__(open_id.get_host_endpoint()) + self.open_id = open_id + self.token: Optional[Token] = None + self.oauth_session = oauth_session - :return: A dictionary containing the 'Authorization' header. - """ - return {"Authorization": "Bearer " + self.get_auth_token()} + def get_auth_token(self) -> str: + """ + Returns the current access token, refreshing it if necessary. + """ + if self.token is None or self.token.is_expired(): + self.refresh_token() + return self.token.access_token - @abstractmethod - def get_grant(self) -> dict: - """ - Builds and returns a dictionary of grant parameters required for the token request. + def get_auth_headers(self) -> Dict[str, str]: + """ + Retrieves authentication headers. - For example, this might include parameters like grant_type, client_assertion, etc. - """ - pass + :return: A dictionary containing the 'Authorization' header. + """ + return {"Authorization": "Bearer " + self.get_auth_token()} - def refresh_token(self) -> Token: - """ - Refreshes the access token using the OAuth flow. - It uses get_grant() to obtain all necessary parameters, such as the grant type and any assertions. + @abstractmethod + def get_grant(self) -> dict: + """ + Builds and returns a dictionary of grant parameters required for the token request. - :return: A new Token. - """ - try: - token_response = self.oauth_session.fetch_token(url=(self.open_id.get_token_endpoint()), **(self.get_grant())) - access_token = token_response["access_token"] - expires_in = token_response.get("expires_in", 3600) - expires_at = datetime.now(timezone.utc) + timedelta(seconds=expires_in) - self.token = Token(access_token, expires_at) - return self.token - except Exception as e: - raise Exception("Failed to refresh token: " + str(e)) from e + For example, this might include parameters like grant_type, client_assertion, etc. + """ + pass + + def refresh_token(self) -> Token: + """ + Refreshes the access token using the OAuth flow. + It uses get_grant() to obtain all necessary parameters, such as the grant type and any assertions. + + :return: A new Token. + """ + try: + token_response = self.oauth_session.fetch_token(url=(self.open_id.get_token_endpoint()), + **(self.get_grant())) + access_token = token_response["access_token"] + expires_in = token_response.get("expires_in", 3600) + expires_at = datetime.now(timezone.utc) + timedelta(seconds=expires_in) + self.token = Token(access_token, expires_at) + return self.token + except Exception as e: + raise Exception("Failed to refresh token: " + str(e)) from e diff --git a/zitadel_client/auth/open_id.py b/zitadel_client/auth/open_id.py index fea4df3c..e036abf1 100644 --- a/zitadel_client/auth/open_id.py +++ b/zitadel_client/auth/open_id.py @@ -4,51 +4,51 @@ class OpenId: - """ - OpenId retrieves OpenID Connect configuration from a given host. - - It builds the well-known configuration URL from the provided hostname, - fetches the configuration, and extracts the token endpoint. - """ - - def __init__(self, hostname: str): - if not (hostname.startswith("http://") or hostname.startswith("https://")): - hostname = "https://" + hostname - - self.host_endpoint = hostname - well_known_url = self.build_well_known_url(hostname) - - try: - with urllib.request.urlopen(well_known_url) as response: - if response.status != 200: - raise Exception(f"Failed to fetch OpenID configuration: HTTP {response.status}") - config = json.loads(response.read().decode('utf-8')) - except urllib.error.URLError as e: - raise Exception(f"URL error occurred: {e}") - except json.JSONDecodeError: - raise Exception("Failed to decode JSON response") - - token_endpoint = config.get("token_endpoint") - if not token_endpoint: - raise Exception("token_endpoint not found in OpenID configuration") - - self.token_endpoint = token_endpoint - - @staticmethod - def build_well_known_url(hostname: str) -> str: """ - Builds the well-known OpenID configuration URL for the given hostname. - """ - return urljoin(hostname, "/.well-known/openid-configuration") + OpenId retrieves OpenID Connect configuration from a given host. - def get_host_endpoint(self) -> str: - """ - Returns the host endpoint URL. + It builds the well-known configuration URL from the provided hostname, + fetches the configuration, and extracts the token endpoint. """ - return self.host_endpoint - def get_token_endpoint(self) -> str: - """ - Returns the token endpoint URL extracted from the OpenID configuration. - """ - return self.token_endpoint + def __init__(self, hostname: str): + if not (hostname.startswith("http://") or hostname.startswith("https://")): + hostname = "https://" + hostname + + self.host_endpoint = hostname + well_known_url = self.build_well_known_url(hostname) + + try: + with urllib.request.urlopen(well_known_url) as response: + if response.status != 200: + raise Exception(f"Failed to fetch OpenID configuration: HTTP {response.status}") + config = json.loads(response.read().decode('utf-8')) + except urllib.error.URLError as e: + raise Exception(f"URL error occurred: {e}") + except json.JSONDecodeError: + raise Exception("Failed to decode JSON response") + + token_endpoint = config.get("token_endpoint") + if not token_endpoint: + raise Exception("token_endpoint not found in OpenID configuration") + + self.token_endpoint = token_endpoint + + @staticmethod + def build_well_known_url(hostname: str) -> str: + """ + Builds the well-known OpenID configuration URL for the given hostname. + """ + return urljoin(hostname, "/.well-known/openid-configuration") + + def get_host_endpoint(self) -> str: + """ + Returns the host endpoint URL. + """ + return self.host_endpoint + + def get_token_endpoint(self) -> str: + """ + Returns the token endpoint URL extracted from the OpenID configuration. + """ + return self.token_endpoint diff --git a/zitadel_client/auth/personal_access_token_authenticator.py b/zitadel_client/auth/personal_access_token_authenticator.py index 75b7be96..000c06d6 100644 --- a/zitadel_client/auth/personal_access_token_authenticator.py +++ b/zitadel_client/auth/personal_access_token_authenticator.py @@ -5,20 +5,20 @@ class PersonalAccessTokenAuthenticator(Authenticator): - """ - Personal Access Token Authenticator. + """ + Personal Access Token Authenticator. - Uses a static personal access token for API authentication. - """ + Uses a static personal access token for API authentication. + """ - def __init__(self, host: str, token: str): - super().__init__(URLUtil.build_hostname(host)) - self.token = token + def __init__(self, host: str, token: str): + super().__init__(URLUtil.build_hostname(host)) + self.token = token - def get_auth_headers(self) -> Dict[str, str]: - """ - Returns the authentication headers using the personal access token. + def get_auth_headers(self) -> Dict[str, str]: + """ + Returns the authentication headers using the personal access token. - :return: A dictionary containing the 'Authorization' header. - """ - return {"Authorization": "Bearer " + self.token} + :return: A dictionary containing the 'Authorization' header. + """ + return {"Authorization": "Bearer " + self.token} diff --git a/zitadel_client/auth/web_token_authenticator.py b/zitadel_client/auth/web_token_authenticator.py index f21efb2a..2d53dc54 100644 --- a/zitadel_client/auth/web_token_authenticator.py +++ b/zitadel_client/auth/web_token_authenticator.py @@ -11,154 +11,162 @@ class WebTokenAuthenticator(OAuthAuthenticator): - """ - OAuth authenticator implementing the JWT bearer flow. - - This implementation builds a JWT assertion dynamically in get_grant(). - """ - - def __init__(self, open_id: OpenId, auth_scopes: Set[str], - jwt_issuer: str, jwt_subject: str, jwt_audience: str, - private_key: str, jwt_lifetime: timedelta = timedelta(hours=1), jwt_algorithm: str = "RS256"): - """ - Constructs a JWTAuthenticator. - - :param open_id: The base URL for the OAuth provider. - :param auth_scopes: The scope(s) for the token request. - :param jwt_issuer: The JWT issuer. - :param jwt_subject: The JWT subject. - :param jwt_audience: The JWT audience. - :param private_key: The private key used to sign the JWT. - :param jwt_lifetime: Lifetime of the JWT in seconds. - :param jwt_algorithm: The JWT signing algorithm (default "RS256"). """ - super().__init__(open_id, OAuth2Session(scope=" ".join(auth_scopes))) - self.jwt_issuer = jwt_issuer - self.jwt_subject = jwt_subject - self.jwt_audience = jwt_audience - self.private_key = private_key - self.jwt_lifetime = jwt_lifetime - self.jwt_algorithm = jwt_algorithm - - def get_grant(self) -> dict: - """ - Builds and returns the grant parameters for the JWT bearer flow. - - Dynamically generates a JWT assertion that includes time-sensitive claims. + OAuth authenticator implementing the JWT bearer flow. - :return: A dictionary with the JWT bearer grant parameters. - :raises Exception: If JWT generation fails. + This implementation builds a JWT assertion dynamically in get_grant(). """ - now = datetime.now(timezone.utc) - try: - return { - "grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer", - "assertion": (jwt.encode({"alg": self.jwt_algorithm, "typ": "JWT"}, { - "iss": self.jwt_issuer, - "sub": self.jwt_subject, - "aud": self.jwt_audience, - "iat": int(now.timestamp()), - "exp": int((now + self.jwt_lifetime).timestamp()) - }, self.private_key)) - } - except JoseError as e: - raise Exception("Failed to generate JWT assertion: " + str(e)) from e - - @classmethod - def from_json(cls, host: str, json_path: str) -> "WebTokenAuthenticator": - """ - Create a WebTokenAuthenticatorBuilder instance from a JSON configuration file. - - Expected JSON format: - { - "type": "serviceaccount", - "keyId": "", - "key": "", - "userId": "" - } - - :param host: Base URL for the API endpoints. - :param json_path: File path to the JSON configuration file. - :return: A new instance of WebTokenAuthenticator. - :raises Exception: If the file cannot be read, the JSON is invalid, - or required keys are missing. - """ - try: - with open(json_path, "r") as file: - config = json.load(file) - except Exception as e: - raise Exception(f"Unable to read JSON file: {json_path}") from e - - user_id = config.get("userId") - private_key = config.get("key") - if not user_id or not private_key: - raise Exception("Missing required keys 'userId' or 'key' in JSON file.") - - return (WebTokenAuthenticator.builder(host, user_id, private_key) - .build()) - - @staticmethod - def builder(host: str, user_id: str, private_key: str) -> "WebTokenAuthenticatorBuilder": - """ - Returns a builder for constructing a JWTAuthenticator. - :param host: The base URL for the OAuth provider. - :param user_id: The user identifier, used as both the issuer and subject. - :param private_key: The private key used to sign the JWT. - :return: A JWTAuthenticatorBuilder instance. - """ - return WebTokenAuthenticatorBuilder(host, user_id, user_id, host, private_key) + def __init__(self, open_id: OpenId, auth_scopes: Set[str], + jwt_issuer: str, jwt_subject: str, jwt_audience: str, + private_key: str, jwt_lifetime: timedelta = timedelta(hours=1), jwt_algorithm: str = "RS256", + key_id: str = None): + """ + Constructs a JWTAuthenticator. + + :param open_id: The base URL for the OAuth provider. + :param auth_scopes: The scope(s) for the token request. + :param jwt_issuer: The JWT issuer. + :param jwt_subject: The JWT subject. + :param jwt_audience: The JWT audience. + :param private_key: The private key used to sign the JWT. + :param jwt_lifetime: Lifetime of the JWT in seconds. + :param jwt_algorithm: The JWT signing algorithm (default "RS256"). + """ + super().__init__(open_id, OAuth2Session(scope=" ".join(auth_scopes))) + self.jwt_issuer = jwt_issuer + self.jwt_subject = jwt_subject + self.jwt_audience = jwt_audience + self.private_key = private_key + self.jwt_lifetime = jwt_lifetime + self.jwt_algorithm = jwt_algorithm + self.key_id = key_id + + def get_grant(self) -> dict: + """ + Builds and returns the grant parameters for the JWT bearer flow. + + Dynamically generates a JWT assertion that includes time-sensitive claims. + + :return: A dictionary with the JWT bearer grant parameters. + :raises Exception: If JWT generation fails. + """ + now = datetime.now(timezone.utc) + try: + return { + "grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer", + "assertion": (jwt.encode({"alg": self.jwt_algorithm, "typ": "JWT", "kid": self.key_id, }, { + "iss": self.jwt_issuer, + "sub": self.jwt_subject, + "aud": self.jwt_audience, + "iat": int(now.timestamp()), + "exp": int((now + self.jwt_lifetime).timestamp()) + }, self.private_key)) + } + except JoseError as e: + raise Exception("Failed to generate JWT assertion: " + str(e)) from e + + @classmethod + def from_json(cls, host: str, json_path: str) -> "WebTokenAuthenticator": + """ + Create a WebTokenAuthenticatorBuilder instance from a JSON configuration file. + + Expected JSON format: + { + "type": "serviceaccount", + "keyId": "", + "key": "", + "userId": "" + } + + :param host: Base URL for the API endpoints. + :param json_path: File path to the JSON configuration file. + :return: A new instance of WebTokenAuthenticator. + :raises Exception: If the file cannot be read, the JSON is invalid, + or required keys are missing. + """ + try: + with open(json_path, "r") as file: + config = json.load(file) + except Exception as e: + raise Exception(f"Unable to read JSON file: {json_path}") from e + + user_id = config.get("userId") + private_key = config.get("key") + key_id = config.get("keyId") + if not user_id or not key_id or not private_key: + raise Exception("Missing required keys 'userId', 'key_id' or 'key' in JSON file.") + + return (WebTokenAuthenticator.builder(host, user_id, private_key)).key_identifier(key_id).build() + + @staticmethod + def builder(host: str, user_id: str, private_key: str) -> "WebTokenAuthenticatorBuilder": + """ + Returns a builder for constructing a JWTAuthenticator. + + :param host: The base URL for the OAuth provider. + :param user_id: The user identifier, used as both the issuer and subject. + :param private_key: The private key used to sign the JWT. + :return: A JWTAuthenticatorBuilder instance. + """ + return WebTokenAuthenticatorBuilder(host, user_id, user_id, host, private_key) class WebTokenAuthenticatorBuilder(OAuthAuthenticatorBuilder): - """ - Builder for JWTAuthenticator. - - Provides a fluent API for configuring and constructing a JWTAuthenticator instance. - """ - - def __init__(self, host: str, jwt_issuer: str, jwt_subject: str, jwt_audience: str, private_key: str): - """ - Initializes the JWTAuthenticatorBuilder with required parameters. - - :param host: The base URL for API endpoints. - :param jwt_issuer: The issuer claim for the JWT. - :param jwt_subject: The subject claim for the JWT. - :param jwt_audience: The audience claim for the JWT. - :param private_key: The PEM-formatted private key used for signing the JWT. - """ - super().__init__(host) - self.jwt_issuer = jwt_issuer - self.jwt_subject = jwt_subject - self.jwt_audience = jwt_audience - self.private_key = private_key - self.jwt_lifetime = timedelta(hours=1) - - def token_lifetime_seconds(self, seconds: int) -> "WebTokenAuthenticatorBuilder": """ - Sets the JWT token lifetime in seconds. + Builder for JWTAuthenticator. - :param seconds: Lifetime of the JWT in seconds. - :return: The builder instance. + Provides a fluent API for configuring and constructing a JWTAuthenticator instance. """ - self.jwt_lifetime = timedelta(seconds=seconds) - return self - def build(self) -> WebTokenAuthenticator: - """ - Builds and returns a new JWTAuthenticator instance using the configured parameters. - - This method inlines the JWT assertion generation logic and passes all required - configuration to the JWTAuthenticator constructor. - - :return: A new JWTAuthenticator instance. - """ - return WebTokenAuthenticator( - open_id=self.open_id, - auth_scopes=self.auth_scopes, - jwt_issuer=self.jwt_issuer, - jwt_subject=self.jwt_subject, - jwt_audience=self.jwt_audience, - private_key=self.private_key, - jwt_lifetime=self.jwt_lifetime - ) + def __init__(self, host: str, jwt_issuer: str, jwt_subject: str, jwt_audience: str, private_key: str): + """ + Initializes the JWTAuthenticatorBuilder with required parameters. + + :param host: The base URL for API endpoints. + :param jwt_issuer: The issuer claim for the JWT. + :param jwt_subject: The subject claim for the JWT. + :param jwt_audience: The audience claim for the JWT. + :param private_key: The PEM-formatted private key used for signing the JWT. + """ + super().__init__(host) + self.jwt_issuer = jwt_issuer + self.jwt_subject = jwt_subject + self.jwt_audience = jwt_audience + self.private_key = private_key + self.jwt_lifetime = timedelta(hours=1) + self.key_id = None + + def token_lifetime_seconds(self, seconds: int) -> "WebTokenAuthenticatorBuilder": + """ + Sets the JWT token lifetime in seconds. + + :param seconds: Lifetime of the JWT in seconds. + :return: The builder instance. + """ + self.jwt_lifetime = timedelta(seconds=seconds) + return self + + def build(self) -> WebTokenAuthenticator: + """ + Builds and returns a new JWTAuthenticator instance using the configured parameters. + + This method inlines the JWT assertion generation logic and passes all required + configuration to the JWTAuthenticator constructor. + + :return: A new JWTAuthenticator instance. + """ + return WebTokenAuthenticator( + open_id=self.open_id, + auth_scopes=self.auth_scopes, + jwt_issuer=self.jwt_issuer, + jwt_subject=self.jwt_subject, + jwt_audience=self.jwt_audience, + private_key=self.private_key, + jwt_lifetime=self.jwt_lifetime, + key_id=self.key_id + ) + + def key_identifier(self, key_id): + self.key_id = key_id + return self From b0db23799680c33ccfb28ff6e260fd8d16160452 Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Mon, 14 Apr 2025 15:00:36 +0300 Subject: [PATCH 20/21] Added tests to ensure that the client-credentials authentication is working as expected --- .github/workflows/test.yml | 2 + ..._client_credentials_authentication_spec.py | 74 +++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 spec/sdk_test_using_client_credentials_authentication_spec.py diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 57b22a68..7b0f5b8c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,3 +36,5 @@ jobs: BASE_URL: ${{ secrets.BASE_URL }} AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }} JWT_KEY: ${{ secrets.JWT_KEY }} + CLIENT_ID: ${{ secrets.CLIENT_ID }} + CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} diff --git a/spec/sdk_test_using_client_credentials_authentication_spec.py b/spec/sdk_test_using_client_credentials_authentication_spec.py new file mode 100644 index 00000000..8982234e --- /dev/null +++ b/spec/sdk_test_using_client_credentials_authentication_spec.py @@ -0,0 +1,74 @@ +import os +import uuid + +import pytest + +import zitadel_client as zitadel +from zitadel_client.auth.client_credentials_authenticator import ClientCredentialsAuthenticator + + +@pytest.fixture +def client_id(): + """Fixture to return a valid personal access token.""" + return os.getenv("CLIENT_ID") + + +@pytest.fixture +def client_secret(): + """Fixture to return a valid personal access token.""" + return os.getenv("CLIENT_SECRET") + + +@pytest.fixture +def base_url(): + """Fixture to return the base URL.""" + return os.getenv("BASE_URL") + + +@pytest.fixture +def user_id(client_id, client_secret, base_url): + """Fixture to create a user and return their ID.""" + with zitadel.Zitadel(ClientCredentialsAuthenticator.builder(base_url, client_id, client_secret).build()) as client: + try: + response = client.users.add_human_user( + body=zitadel.models.V2AddHumanUserRequest( + username=uuid.uuid4().hex, + profile=zitadel.models.V2SetHumanProfile(given_name="John", family_name="Doe"), + email=zitadel.models.V2SetHumanEmail(email=f"johndoe{uuid.uuid4().hex}@caos.ag") + ) + ) + print("User created:", response) + return response.user_id + except Exception as e: + pytest.fail(f"Exception while creating user: {e}") + + +def test_should_deactivate_and_reactivate_user_with_valid_token(user_id, client_id, client_secret, base_url): + """Test to (de)activate the user with a valid token.""" + with zitadel.Zitadel(ClientCredentialsAuthenticator.builder(base_url, client_id, client_secret).build()) as client: + try: + deactivate_response = client.users.deactivate_user(user_id=user_id) + print("User deactivated:", deactivate_response) + + reactivate_response = client.users.reactivate_user(user_id=user_id) + print("User reactivated:", reactivate_response) + # Adjust based on actual response format + # assert reactivate_response["status"] == "success" + except Exception as e: + pytest.fail(f"Exception when calling deactivate_user or reactivate_user with valid token: {e}") + + +def test_should_not_deactivate_or_reactivate_user_with_invalid_token(user_id, base_url): + """Test to attempt (de)activating the user with an invalid token.""" + with zitadel.Zitadel(ClientCredentialsAuthenticator.builder(base_url, "id", "secret").build()) as client: + try: + client.users.deactivate_user(user_id=user_id) + pytest.fail("Expected exception when deactivating user with invalid token, but got response.") + except Exception as e: + print("Caught expected UnauthorizedException:", e) + + try: + client.users.reactivate_user(user_id=user_id) + pytest.fail("Expected exception when reactivating user with invalid token, but got response.") + except Exception as e: + print("Caught expected UnauthorizedException:", e) From 87c09e3bbf7478c7ffce5271e44655e7590b98da Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Mon, 14 Apr 2025 22:19:30 +0300 Subject: [PATCH 21/21] Updated the Readme to include examples of the different auth methods. --- README.md | 138 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 113 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index a036487f..dee20c92 100644 --- a/README.md +++ b/README.md @@ -37,45 +37,133 @@ install dependencies. Install the SDK by running one of the following commands: ```bash -composer require zitadel/client +pip install zitadel_client ``` -### Authentication +## Authentication Methods -The SDK supports three authentication methods: +Your SDK offers three ways to authenticate with Zitadel. Each method has its +own benefits—choose the one that fits your situation best. -1. Private Key JWT Authentication -2. Client Credentials Grant -3. Personal Access Tokens (PATs) +#### 1. Private Key JWT Authentication -For most service user scenarios in Zitadel, private key JWT authentication -is the recommended choice due to its benefits in security, performance, and control. -However, client credentials authentication might be considered in specific -situations where simplicity and trust between servers are priorities. +**What is it?** +You use a JSON Web Token (JWT) that you sign with a private key stored in a +JSON file. This process creates a secure token. -For more details on these authentication methods, please refer -to the [Zitadel documentation on authenticating service users](https://zitadel.com/docs/guides/integrate/service-users/authenticate-service-users). +**When should you use it?** +- **Best for production:** It offers strong security. +- **Advanced control:** You can adjust token settings like expiration. +**How do you use it?** +1. Save your private key in a JSON file. +2. Use the provided method to load this key and create a JWT-based + authenticator. -### Example +**Example:** ```python import zitadel_client as zitadel +from zitadel_client.auth.web_token_authenticator import WebTokenAuthenticator + +base_url = "https://example.zitadel.com" +key_file = "/path/to/jwt-key.json" + +authenticator = WebTokenAuthenticator.from_json(base_url, key_file) +zitadel = zitadel.Zitadel(authenticator) + +try: + response = zitadel.users.add_human_user({ + "username": "john.doe", + "profile": {"givenName": "John", "familyName": "Doe"}, + "email": {"email": "john@doe.com"} + }) + print("User created:", response) +except Exception as e: + print("Error:", e) +``` + +#### 2. Client Credentials Grant + +**What is it?** +This method uses a client ID and client secret to get a secure access token, +which is then used to authenticate. + +**When should you use it?** +- **Simple and straightforward:** Good for server-to-server communication. +- **Trusted environments:** Use it when both servers are owned or trusted. + +**How do you use it?** +1. Provide your client ID and client secret. +2. Build the authenticator -with zitadel.Zitadel("your-zitadel-base-url", 'your-valid-token') as client: - try: - response = client.users.add_human_user( - body=zitadel.V2AddHumanUserRequest( - username="john.doe", - profile=zitadel.V2SetHumanProfile(given_name="John", family_name="Doe"), - email=zitadel.V2SetHumanEmail(email="johndoe@doe.com") - ) - ) - print("User created:", response) - except Exception as e: - raise e +**Example:** + +```python +import zitadel_client as zitadel +from zitadel_client.auth.client_credentials_authenticator import ClientCredentialsAuthenticator + +base_url = "https://example.zitadel.com" +client_id = "your-client-id" +client_secret = "your-client-secret" + +authenticator = ClientCredentialsAuthenticator.builder(base_url, client_id, client_secret).build() +zitadel = zitadel.Zitadel(authenticator) + +try: + response = zitadel.users.add_human_user({ + "username": "john.doe", + "profile": {"givenName": "John", "familyName": "Doe"}, + "email": {"email": "john@doe.com"} + }) + print("User created:", response) +except Exception as e: + print("Error:", e) ``` +#### 3. Personal Access Tokens (PATs) + +**What is it?** +A Personal Access Token (PAT) is a pre-generated token that you can use to +authenticate without exchanging credentials every time. + +**When should you use it?** +- **Easy to use:** Great for development or testing scenarios. +- **Quick setup:** No need for dynamic token generation. + +**How do you use it?** +1. Obtain a valid personal access token from your account. +2. Create the authenticator with: `PersonalAccessTokenAuthenticator` + +**Example:** + +```python +import zitadel_client as zitadel +from zitadel_client.auth.personal_access_token_authenticator import PersonalAccessTokenAuthenticator + +base_url = "https://example.zitadel.com" +valid_token = "your-valid-token" + +authenticator = PersonalAccessTokenAuthenticator(base_url, valid_token) +zitadel = zitadel.Zitadel(authenticator) + +try: + response = zitadel.users.add_human_user({ + "username": "john.doe", + "profile": {"givenName": "John", "familyName": "Doe"}, + "email": {"email": "john@doe.com"} + }) + print("User created:", response) +except Exception as e: + print("Error:", e) +``` + +--- + +Choose the authentication method that best suits your needs based on your +environment and security requirements. For more details, please refer to the +[Zitadel documentation on authenticating service users](https://zitadel.com/docs/guides/integrate/service-users/authenticate-service-users). + ### Debugging The SDK supports debug logging, which can be enabled for troubleshooting and debugging purposes. You can enable debug logging by setting the `debug`