diff --git a/README.md b/README.md index 1a154f3..a4cbc28 100644 --- a/README.md +++ b/README.md @@ -32,10 +32,24 @@ This collection contains modules and plugins to assist in automating the configu This collection is tested with the most current Ansible releases. Ansible versions before 2.15 are **not supported**. -## Python Version +## Python dependencies The minimum python version for this collection is python `3.9`. +The Python module dependencies are not automatically handled by `ansible-galaxy`. To manually install these dependencies, you have the following options: + +1. Utilize the `requirements.txt` file located [here](https://github.com/zscaler/ziacloud-ansible/blob/master/requirements.txt) to install all required packages: + + ```bash + pip install -r requirements.txt + ``` + +2. Alternatively, install the [Zscaler SDK Python](https://pypi.org/project/zscaler-sdk-python/) package directly: + + ```bash + pip install zscaler-sdk-python + ``` + ## Installation Install this collection using the Ansible Galaxy CLI: diff --git a/docs/source/requirements.rst b/docs/source/requirements.rst index d51d631..95e604a 100644 --- a/docs/source/requirements.rst +++ b/docs/source/requirements.rst @@ -6,9 +6,26 @@ Requirements ========================== -The **Zscaler Internet Access Collection** has the following requirements in order to be successfully used: +The **Zscaler Internet Access Collection** has the following requirements in order to be successfully used. -* **zscaler-sdk-python** +Python dependencies +---------------------- + +The minimum python version for this collection is python `3.9`. + +The Python module dependencies are not automatically handled by `ansible-galaxy`. To manually install these dependencies, you have the following options: + +1. Utilize the `requirements.txt` file located `here `_ to install all required packages: + + ```bash + pip install -r requirements.txt + ``` + +2. Alternatively, install the `Zscaler SDK Python `_ package directly: + + ```bash + pip install zscaler-sdk-python + ``` If you believe you have installed these dependencies but Ansible is not finding them, it is likely a problem with where your local shell is searching for installed dependencies and where Ansible is diff --git a/plugins/modules/zia_cloud_firewall_filtering_rule.py b/plugins/modules/zia_cloud_firewall_filtering_rule.py index bee43a1..93e969f 100644 --- a/plugins/modules/zia_cloud_firewall_filtering_rule.py +++ b/plugins/modules/zia_cloud_firewall_filtering_rule.py @@ -322,7 +322,7 @@ def normalize_rule(rule): normalized = rule.copy() computed_values = [ - "exclude_src_countries", + # "exclude_src_countries", ] for attr in computed_values: normalized.pop(attr, None) @@ -430,6 +430,17 @@ def core(module): if rule_.get("name") == rule_name: existing_rule = rule_ + # Check for predefined or default rules before deletion + if state == "absent" and existing_rule is not None: + if existing_rule.get("default_rule", False) or existing_rule.get( + "predefined", False + ): + module.warn("Default and predefined rules cannot be deleted.") + module.exit_json( + changed=False, + msg="Deletion of default or predefined rule is not allowed.", + ) + # Normalize and compare existing and desired data desired_rule = normalize_rule(rule) current_rule = normalize_rule(existing_rule) if existing_rule else {} @@ -477,6 +488,12 @@ def preprocess_rules(rule, params): if key == "enabled" and "state" in current_rule: current_value = current_rule["state"] == "ENABLED" + # Special handling for exclude_src_countries + if key == "exclude_src_countries": + # Ignore comparison if exclude_src_countries is not specified in the playbook + if module.params.get("exclude_src_countries") is None: + continue + # Handling None values for all attributes if desired_value is None and key != "enabled": # Explicitly setting to empty list or empty value based on type @@ -599,6 +616,15 @@ def preprocess_rules(rule, params): and existing_rule is not None and existing_rule.get("id") is not None ): + # Check for predefined or default rules before deletion + if existing_rule.get("default_rule", False) or existing_rule.get( + "predefined", False + ): + module.warn("Default and predefined rules cannot be deleted.") + module.exit_json( + changed=False, + msg="Deletion of default or predefined rule is not allowed.", + ) code = client.firewall.delete_rule(rule_id=existing_rule.get("id")) if code > 299: module.exit_json(changed=False, data=None) diff --git a/plugins/modules/zia_url_filtering_rules.py b/plugins/modules/zia_url_filtering_rules.py index fc316e5..8d972b9 100644 --- a/plugins/modules/zia_url_filtering_rules.py +++ b/plugins/modules/zia_url_filtering_rules.py @@ -62,7 +62,7 @@ type: bool order: description: "Rule order number of the URL Filtering policy rule" - required: true + required: false type: int action: description: @@ -168,7 +168,7 @@ - If not set, rule will be applied to all methods" type: list elements: str - required: true + required: false choices: - OPTIONS - GET @@ -439,12 +439,15 @@ def normalize_rule(rule): """ Normalize rule data by setting computed values. """ + if not rule: + return {} + normalized = rule.copy() # Add 'profile_seq' to the list of computed values to be removed computed_values = ["profile_seq"] for attr in computed_values: - if "cbi_profile" in normalized and attr in normalized["cbi_profile"]: + if "cbi_profile" in normalized and isinstance(normalized["cbi_profile"], dict) and attr in normalized["cbi_profile"]: normalized["cbi_profile"].pop(attr, None) return normalized @@ -718,7 +721,7 @@ def main(): name=dict(type="str", required=True), description=dict(type="str", required=False), enabled=dict(type="bool", required=False), - order=dict(type="int", required=True), + order=dict(type="int", required=False), rank=dict(type="int", required=False, default=7), locations=id_spec, groups=id_spec, @@ -777,7 +780,7 @@ def main(): request_methods=dict( type="list", elements="str", - required=True, + required=False, choices=[ "OPTIONS", "GET", diff --git a/poetry.lock b/poetry.lock index b3b8b26..470f2ad 100644 --- a/poetry.lock +++ b/poetry.lock @@ -514,13 +514,13 @@ virtualenv = ["virtualenv (>=20.0.35)"] [[package]] name = "certifi" -version = "2023.11.17" +version = "2024.2.2" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2023.11.17-py3-none-any.whl", hash = "sha256:e036ab49d5b79556f99cfc2d9320b34cfbe5be05c5871b51de9329f0603b0474"}, - {file = "certifi-2023.11.17.tar.gz", hash = "sha256:9b469f3a900bf28dc19b8cfbf8019bf47f7fdd1a65a1d4ffb98fc14166beb4d1"}, + {file = "certifi-2024.2.2-py3-none-any.whl", hash = "sha256:dc383c07b76109f368f6106eee2b593b04a011ea4d55f652c6ca24a754d1cdd1"}, + {file = "certifi-2024.2.2.tar.gz", hash = "sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f"}, ] [[package]] @@ -589,13 +589,13 @@ pycparser = "*" [[package]] name = "chardet" -version = "3.0.4" -description = "Universal encoding detector for Python 2 and 3" +version = "5.2.0" +description = "Universal encoding detector for Python 3" optional = false -python-versions = "*" +python-versions = ">=3.7" files = [ - {file = "chardet-3.0.4-py2.py3-none-any.whl", hash = "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"}, - {file = "chardet-3.0.4.tar.gz", hash = "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae"}, + {file = "chardet-5.2.0-py3-none-any.whl", hash = "sha256:e1cf59446890a00105fe7b7912492ea04b6e6f06d4b742b2c788469e34c82970"}, + {file = "chardet-5.2.0.tar.gz", hash = "sha256:1b3b6ff479a8c414bc3fa2c0852995695c4a026dcd6d0633b2dd092ca39c1cf7"}, ] [[package]] @@ -724,45 +724,68 @@ files = [ [[package]] name = "coverage" -version = "4.5.4" +version = "7.5.1" description = "Code coverage measurement for Python" optional = false -python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, <4" -files = [ - {file = "coverage-4.5.4-cp26-cp26m-macosx_10_12_x86_64.whl", hash = "sha256:eee64c616adeff7db37cc37da4180a3a5b6177f5c46b187894e633f088fb5b28"}, - {file = "coverage-4.5.4-cp27-cp27m-macosx_10_12_x86_64.whl", hash = "sha256:ef824cad1f980d27f26166f86856efe11eff9912c4fed97d3804820d43fa550c"}, - {file = "coverage-4.5.4-cp27-cp27m-macosx_10_13_intel.whl", hash = "sha256:9a334d6c83dfeadae576b4d633a71620d40d1c379129d587faa42ee3e2a85cce"}, - {file = "coverage-4.5.4-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:7494b0b0274c5072bddbfd5b4a6c6f18fbbe1ab1d22a41e99cd2d00c8f96ecfe"}, - {file = "coverage-4.5.4-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:826f32b9547c8091679ff292a82aca9c7b9650f9fda3e2ca6bf2ac905b7ce888"}, - {file = "coverage-4.5.4-cp27-cp27m-win32.whl", hash = "sha256:63a9a5fc43b58735f65ed63d2cf43508f462dc49857da70b8980ad78d41d52fc"}, - {file = "coverage-4.5.4-cp27-cp27m-win_amd64.whl", hash = "sha256:e2ede7c1d45e65e209d6093b762e98e8318ddeff95317d07a27a2140b80cfd24"}, - {file = "coverage-4.5.4-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:dd579709a87092c6dbee09d1b7cfa81831040705ffa12a1b248935274aee0437"}, - {file = "coverage-4.5.4-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:08907593569fe59baca0bf152c43f3863201efb6113ecb38ce7e97ce339805a6"}, - {file = "coverage-4.5.4-cp33-cp33m-macosx_10_10_x86_64.whl", hash = "sha256:6b62544bb68106e3f00b21c8930e83e584fdca005d4fffd29bb39fb3ffa03cb5"}, - {file = "coverage-4.5.4-cp34-cp34m-macosx_10_12_x86_64.whl", hash = "sha256:331cb5115673a20fb131dadd22f5bcaf7677ef758741312bee4937d71a14b2ef"}, - {file = "coverage-4.5.4-cp34-cp34m-manylinux1_i686.whl", hash = "sha256:bf1ef9eb901113a9805287e090452c05547578eaab1b62e4ad456fcc049a9b7e"}, - {file = "coverage-4.5.4-cp34-cp34m-manylinux1_x86_64.whl", hash = "sha256:386e2e4090f0bc5df274e720105c342263423e77ee8826002dcffe0c9533dbca"}, - {file = "coverage-4.5.4-cp34-cp34m-win32.whl", hash = "sha256:fa964bae817babece5aa2e8c1af841bebb6d0b9add8e637548809d040443fee0"}, - {file = "coverage-4.5.4-cp34-cp34m-win_amd64.whl", hash = "sha256:df6712284b2e44a065097846488f66840445eb987eb81b3cc6e4149e7b6982e1"}, - {file = "coverage-4.5.4-cp35-cp35m-macosx_10_12_x86_64.whl", hash = "sha256:efc89291bd5a08855829a3c522df16d856455297cf35ae827a37edac45f466a7"}, - {file = "coverage-4.5.4-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:e4ef9c164eb55123c62411f5936b5c2e521b12356037b6e1c2617cef45523d47"}, - {file = "coverage-4.5.4-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:ff37757e068ae606659c28c3bd0d923f9d29a85de79bf25b2b34b148473b5025"}, - {file = "coverage-4.5.4-cp35-cp35m-win32.whl", hash = "sha256:bf0a7aed7f5521c7ca67febd57db473af4762b9622254291fbcbb8cd0ba5e33e"}, - {file = "coverage-4.5.4-cp35-cp35m-win_amd64.whl", hash = "sha256:19e4df788a0581238e9390c85a7a09af39c7b539b29f25c89209e6c3e371270d"}, - {file = "coverage-4.5.4-cp36-cp36m-macosx_10_13_x86_64.whl", hash = "sha256:60851187677b24c6085248f0a0b9b98d49cba7ecc7ec60ba6b9d2e5574ac1ee9"}, - {file = "coverage-4.5.4-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:245388cda02af78276b479f299bbf3783ef0a6a6273037d7c60dc73b8d8d7755"}, - {file = "coverage-4.5.4-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:c0afd27bc0e307a1ffc04ca5ec010a290e49e3afbe841c5cafc5c5a80ecd81c9"}, - {file = "coverage-4.5.4-cp36-cp36m-win32.whl", hash = "sha256:6ba744056423ef8d450cf627289166da65903885272055fb4b5e113137cfa14f"}, - {file = "coverage-4.5.4-cp36-cp36m-win_amd64.whl", hash = "sha256:af7ed8a8aa6957aac47b4268631fa1df984643f07ef00acd374e456364b373f5"}, - {file = "coverage-4.5.4-cp37-cp37m-macosx_10_13_x86_64.whl", hash = "sha256:3a794ce50daee01c74a494919d5ebdc23d58873747fa0e288318728533a3e1ca"}, - {file = "coverage-4.5.4-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:0be0f1ed45fc0c185cfd4ecc19a1d6532d72f86a2bac9de7e24541febad72650"}, - {file = "coverage-4.5.4-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:eca2b7343524e7ba246cab8ff00cab47a2d6d54ada3b02772e908a45675722e2"}, - {file = "coverage-4.5.4-cp37-cp37m-win32.whl", hash = "sha256:93715dffbcd0678057f947f496484e906bf9509f5c1c38fc9ba3922893cda5f5"}, - {file = "coverage-4.5.4-cp37-cp37m-win_amd64.whl", hash = "sha256:23cc09ed395b03424d1ae30dcc292615c1372bfba7141eb85e11e50efaa6b351"}, - {file = "coverage-4.5.4-cp38-cp38-macosx_10_13_x86_64.whl", hash = "sha256:141f08ed3c4b1847015e2cd62ec06d35e67a3ac185c26f7635f4406b90afa9c5"}, - {file = "coverage-4.5.4.tar.gz", hash = "sha256:e07d9f1a23e9e93ab5c62902833bf3e4b1f65502927379148b6622686223125c"}, +python-versions = ">=3.8" +files = [ + {file = "coverage-7.5.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c0884920835a033b78d1c73b6d3bbcda8161a900f38a488829a83982925f6c2e"}, + {file = "coverage-7.5.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:39afcd3d4339329c5f58de48a52f6e4e50f6578dd6099961cf22228feb25f38f"}, + {file = "coverage-7.5.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4a7b0ceee8147444347da6a66be737c9d78f3353b0681715b668b72e79203e4a"}, + {file = "coverage-7.5.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4a9ca3f2fae0088c3c71d743d85404cec8df9be818a005ea065495bedc33da35"}, + {file = "coverage-7.5.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5fd215c0c7d7aab005221608a3c2b46f58c0285a819565887ee0b718c052aa4e"}, + {file = "coverage-7.5.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:4bf0655ab60d754491004a5efd7f9cccefcc1081a74c9ef2da4735d6ee4a6223"}, + {file = "coverage-7.5.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:61c4bf1ba021817de12b813338c9be9f0ad5b1e781b9b340a6d29fc13e7c1b5e"}, + {file = "coverage-7.5.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:db66fc317a046556a96b453a58eced5024af4582a8dbdc0c23ca4dbc0d5b3146"}, + {file = "coverage-7.5.1-cp310-cp310-win32.whl", hash = "sha256:b016ea6b959d3b9556cb401c55a37547135a587db0115635a443b2ce8f1c7228"}, + {file = "coverage-7.5.1-cp310-cp310-win_amd64.whl", hash = "sha256:df4e745a81c110e7446b1cc8131bf986157770fa405fe90e15e850aaf7619bc8"}, + {file = "coverage-7.5.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:796a79f63eca8814ca3317a1ea443645c9ff0d18b188de470ed7ccd45ae79428"}, + {file = "coverage-7.5.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4fc84a37bfd98db31beae3c2748811a3fa72bf2007ff7902f68746d9757f3746"}, + {file = "coverage-7.5.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6175d1a0559986c6ee3f7fccfc4a90ecd12ba0a383dcc2da30c2b9918d67d8a3"}, + {file = "coverage-7.5.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1fc81d5878cd6274ce971e0a3a18a8803c3fe25457165314271cf78e3aae3aa2"}, + {file = "coverage-7.5.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:556cf1a7cbc8028cb60e1ff0be806be2eded2daf8129b8811c63e2b9a6c43bca"}, + {file = "coverage-7.5.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:9981706d300c18d8b220995ad22627647be11a4276721c10911e0e9fa44c83e8"}, + {file = "coverage-7.5.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:d7fed867ee50edf1a0b4a11e8e5d0895150e572af1cd6d315d557758bfa9c057"}, + {file = "coverage-7.5.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:ef48e2707fb320c8f139424a596f5b69955a85b178f15af261bab871873bb987"}, + {file = "coverage-7.5.1-cp311-cp311-win32.whl", hash = "sha256:9314d5678dcc665330df5b69c1e726a0e49b27df0461c08ca12674bcc19ef136"}, + {file = "coverage-7.5.1-cp311-cp311-win_amd64.whl", hash = "sha256:5fa567e99765fe98f4e7d7394ce623e794d7cabb170f2ca2ac5a4174437e90dd"}, + {file = "coverage-7.5.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:b6cf3764c030e5338e7f61f95bd21147963cf6aa16e09d2f74f1fa52013c1206"}, + {file = "coverage-7.5.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2ec92012fefebee89a6b9c79bc39051a6cb3891d562b9270ab10ecfdadbc0c34"}, + {file = "coverage-7.5.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:16db7f26000a07efcf6aea00316f6ac57e7d9a96501e990a36f40c965ec7a95d"}, + {file = "coverage-7.5.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:beccf7b8a10b09c4ae543582c1319c6df47d78fd732f854ac68d518ee1fb97fa"}, + {file = "coverage-7.5.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8748731ad392d736cc9ccac03c9845b13bb07d020a33423fa5b3a36521ac6e4e"}, + {file = "coverage-7.5.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:7352b9161b33fd0b643ccd1f21f3a3908daaddf414f1c6cb9d3a2fd618bf2572"}, + {file = "coverage-7.5.1-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:7a588d39e0925f6a2bff87154752481273cdb1736270642aeb3635cb9b4cad07"}, + {file = "coverage-7.5.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:68f962d9b72ce69ea8621f57551b2fa9c70509af757ee3b8105d4f51b92b41a7"}, + {file = "coverage-7.5.1-cp312-cp312-win32.whl", hash = "sha256:f152cbf5b88aaeb836127d920dd0f5e7edff5a66f10c079157306c4343d86c19"}, + {file = "coverage-7.5.1-cp312-cp312-win_amd64.whl", hash = "sha256:5a5740d1fb60ddf268a3811bcd353de34eb56dc24e8f52a7f05ee513b2d4f596"}, + {file = "coverage-7.5.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:e2213def81a50519d7cc56ed643c9e93e0247f5bbe0d1247d15fa520814a7cd7"}, + {file = "coverage-7.5.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:5037f8fcc2a95b1f0e80585bd9d1ec31068a9bcb157d9750a172836e98bc7a90"}, + {file = "coverage-7.5.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5c3721c2c9e4c4953a41a26c14f4cef64330392a6d2d675c8b1db3b645e31f0e"}, + {file = "coverage-7.5.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ca498687ca46a62ae590253fba634a1fe9836bc56f626852fb2720f334c9e4e5"}, + {file = "coverage-7.5.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0cdcbc320b14c3e5877ee79e649677cb7d89ef588852e9583e6b24c2e5072661"}, + {file = "coverage-7.5.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:57e0204b5b745594e5bc14b9b50006da722827f0b8c776949f1135677e88d0b8"}, + {file = "coverage-7.5.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:8fe7502616b67b234482c3ce276ff26f39ffe88adca2acf0261df4b8454668b4"}, + {file = "coverage-7.5.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:9e78295f4144f9dacfed4f92935fbe1780021247c2fabf73a819b17f0ccfff8d"}, + {file = "coverage-7.5.1-cp38-cp38-win32.whl", hash = "sha256:1434e088b41594baa71188a17533083eabf5609e8e72f16ce8c186001e6b8c41"}, + {file = "coverage-7.5.1-cp38-cp38-win_amd64.whl", hash = "sha256:0646599e9b139988b63704d704af8e8df7fa4cbc4a1f33df69d97f36cb0a38de"}, + {file = "coverage-7.5.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:4cc37def103a2725bc672f84bd939a6fe4522310503207aae4d56351644682f1"}, + {file = "coverage-7.5.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:fc0b4d8bfeabd25ea75e94632f5b6e047eef8adaed0c2161ada1e922e7f7cece"}, + {file = "coverage-7.5.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0d0a0f5e06881ecedfe6f3dd2f56dcb057b6dbeb3327fd32d4b12854df36bf26"}, + {file = "coverage-7.5.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9735317685ba6ec7e3754798c8871c2f49aa5e687cc794a0b1d284b2389d1bd5"}, + {file = "coverage-7.5.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d21918e9ef11edf36764b93101e2ae8cc82aa5efdc7c5a4e9c6c35a48496d601"}, + {file = "coverage-7.5.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:c3e757949f268364b96ca894b4c342b41dc6f8f8b66c37878aacef5930db61be"}, + {file = "coverage-7.5.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:79afb6197e2f7f60c4824dd4b2d4c2ec5801ceb6ba9ce5d2c3080e5660d51a4f"}, + {file = "coverage-7.5.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:d1d0d98d95dd18fe29dc66808e1accf59f037d5716f86a501fc0256455219668"}, + {file = "coverage-7.5.1-cp39-cp39-win32.whl", hash = "sha256:1cc0fe9b0b3a8364093c53b0b4c0c2dd4bb23acbec4c9240b5f284095ccf7981"}, + {file = "coverage-7.5.1-cp39-cp39-win_amd64.whl", hash = "sha256:dde0070c40ea8bb3641e811c1cfbf18e265d024deff6de52c5950677a8fb1e0f"}, + {file = "coverage-7.5.1-pp38.pp39.pp310-none-any.whl", hash = "sha256:6537e7c10cc47c595828b8a8be04c72144725c383c4702703ff4e42e44577312"}, + {file = "coverage-7.5.1.tar.gz", hash = "sha256:54de9ef3a9da981f7af93eafde4ede199e0846cd819eb27c88e2b712aae9708c"}, ] +[package.extras] +toml = ["tomli"] + [[package]] name = "cryptography" version = "42.0.7" @@ -2564,13 +2587,13 @@ files = [ [[package]] name = "typing-extensions" -version = "4.11.0" +version = "4.12.0" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" files = [ - {file = "typing_extensions-4.11.0-py3-none-any.whl", hash = "sha256:c1f94d72897edaf4ce775bb7558d5b79d8126906a14ea5ed1635921406c0387a"}, - {file = "typing_extensions-4.11.0.tar.gz", hash = "sha256:83f085bd5ca59c80295fc2a82ab5dac679cbe02b9f33f7d83af68e241bea51b0"}, + {file = "typing_extensions-4.12.0-py3-none-any.whl", hash = "sha256:b349c66bea9016ac22978d800cfff206d5f9816951f12a7d0ec5578b0a819594"}, + {file = "typing_extensions-4.12.0.tar.gz", hash = "sha256:8cbcdc8606ebcb0d95453ad7dc5065e6237b6aa230a31e81d0f440c30fed5fd8"}, ] [[package]] @@ -2878,4 +2901,4 @@ dev = ["aenum", "black (>=24.4.1,<25.0.0)", "pydash"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "e3e8b511e45b3a9d0d33eed3c10cc18d761a3506685dafe47f09271acc1d5880" +content-hash = "aa86c1afd28b0b226caed05a6073cb306eadb8464246408aea647104239a7755" diff --git a/pyproject.toml b/pyproject.toml index 2383b59..fd157ec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,16 +15,16 @@ zscaler-sdk-python = ">=0.1.7" xmltodict = "^0.12.0" aiohttp = ">=3.9.0" dpath = "^2.1.5" -pytz = "*" -netaddr = "*" -pycountry = "*" +pytz = ">=2024.1" +netaddr = ">=1.2.1" +pycountry = ">=23.12.11" sphinx-ansible-theme = "^0.10.3" python-box = "^7.1.1" [tool.poetry.dev-dependencies] black = "24.3.0" -pytest = "*" -coverage = "4.5.4" +pytest = "^8.2.1" +coverage = ">=4.5.4" pylint = "2.13.*" pytest-xdist = "*" pytest-mock = "*" @@ -43,10 +43,11 @@ six = "*" pycodestyle = "*" # from requirements.txt -certifi = "^2023.11.17" -chardet = "3.0.4" +certifi = ">=2023.11.17" +chardet = ">=5.2.0" idna = "3.7" -requests = "^2.22.0" +requests = ">=2.22.0" +urllib3 = ">=2.0" [build-system] requires = ["poetry>=0.12"] diff --git a/requirements.txt b/requirements.txt index f14744a..7237720 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,3 @@ -aenum==3.1.15 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:27b1710b9d084de6e2e695dab78fe9f269de924b51ae2850170ee7e1ca6288a5 \ - --hash=sha256:8cbd76cd18c4f870ff39b24284d3ea028fbe8731a58df3aa581e434c575b9559 \ - --hash=sha256:e0dfaeea4c2bd362144b87377e2c61d91958c5ed0b4daf89cb6f45ae23af6288 aiohttp==3.9.5 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:0605cc2c0088fcaae79f01c913a38611ad09ba68ff482402d3410bf59039bfb8 \ --hash=sha256:0a158704edf0abcac8ac371fbb54044f3270bdbc93e254a82b6c82be1ef08f3c \ @@ -82,6 +78,12 @@ aiohttp==3.9.5 ; python_version >= "3.9" and python_version < "4.0" \ aiosignal==1.3.1 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:54cd96e15e1649b75d6c87526a6ff0b6c1b0dd3459f43d9ca11d48c339b68cfc \ --hash=sha256:f8376fb07dd1e86a584e4fcdec80b36b7f81aac666ebc724e2c090300dd83b17 +alabaster==0.7.16 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:75a8b99c28a5dad50dd7f8ccdd447a121ddb3892da9e53d1ca5cca3106d58d65 \ + --hash=sha256:b46733c07dce03ae4e150330b975c75737fa60f0a7c591b6c8bf4928a28e2c92 +ansible-pygments==0.1.1 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:0d0a23cc562f94f4b464f931059ad1688635aac9642962bc68ae3acdb6efbcd0 \ + --hash=sha256:85aa7412a46c83efcfe460c8016da289600c171d2edfa0f474e0dc30a398b002 arrow==1.3.0 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:c728b120ebc00eb84e01882a6f5e7927a53960aa990ce7dd2b10f39005a67f80 \ --hash=sha256:d4540617648cb5f895730f1ad8c82a65f2dad0166f57b75f3ca54759c4d67a85 @@ -91,9 +93,12 @@ async-timeout==4.0.3 ; python_version >= "3.9" and python_version < "3.11" \ attrs==23.2.0 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:935dc3b529c262f6cf76e50877d35a4bd3c1de194fd41f47a2b7ae8f19971f30 \ --hash=sha256:99b87a485a5820b23b879f04c2305b44b951b502fd64be915879d77a7e8fc6f1 -certifi==2023.11.17 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:9b469f3a900bf28dc19b8cfbf8019bf47f7fdd1a65a1d4ffb98fc14166beb4d1 \ - --hash=sha256:e036ab49d5b79556f99cfc2d9320b34cfbe5be05c5871b51de9329f0603b0474 +babel==2.15.0 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:08706bdad8d0a3413266ab61bd6c34d0c28d6e1e7badf40a2cebe67644e2e1fb \ + --hash=sha256:8daf0e265d05768bc6c7a314cf1321e9a123afc328cc635c18622a2f30a04413 +certifi==2024.2.2 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f \ + --hash=sha256:dc383c07b76109f368f6106eee2b593b04a011ea4d55f652c6ca24a754d1cdd1 charset-normalizer==3.3.2 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:06435b539f889b1f6f4ac1758871aae42dc3a8c0e24ac9e60c2384973ad73027 \ --hash=sha256:06a81e93cd441c56a9b65d8e1d043daeb97a3d0856d177d5c90ba85acb3db087 \ @@ -185,6 +190,12 @@ charset-normalizer==3.3.2 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:fb69256e180cb6c8a894fee62b3afebae785babc1ee98b81cdf68bbca1987f33 \ --hash=sha256:fd1abc0d89e30cc4e02e4064dc67fcc51bd941eb395c502aac3ec19fab46b519 \ --hash=sha256:ff8fa367d09b717b2a17a052544193ad76cd49979c805768879cb63d9ca50561 +colorama==0.4.6 ; python_version >= "3.9" and python_version < "4.0" and sys_platform == "win32" \ + --hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \ + --hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6 +docutils==0.20.1 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:96f387a2c5562db4476f09f13bbab2192e764cac08ebbf3a34a95d9b1e4a59d6 \ + --hash=sha256:f08a4e276c3a1583a86dce3e34aba3fe04d02bba2dd51ed16106244e8a923e3b dpath==2.1.6 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:31407395b177ab63ef72e2f6ae268c15e938f2990a8ecf6510f5686c02b6db73 \ --hash=sha256:f1e07c72e8605c6a9e80b64bc8f42714de08a789c7de417e49c3f87a19692e47 @@ -274,6 +285,76 @@ frozenlist==1.4.1 ; python_version >= "3.9" and python_version < "4.0" \ idna==3.7 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc \ --hash=sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0 +imagesize==1.4.1 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b \ + --hash=sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a +importlib-metadata==7.1.0 ; python_version >= "3.9" and python_version < "3.10" \ + --hash=sha256:30962b96c0c223483ed6cc7280e7f0199feb01a0e40cfae4d4450fc6fab1f570 \ + --hash=sha256:b78938b926ee8d5f020fc4772d487045805a55ddbad2ecf21c6d60938dc7fcd2 +jinja2==3.1.4 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369 \ + --hash=sha256:bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d +markupsafe==2.1.5 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:00e046b6dd71aa03a41079792f8473dc494d564611a8f89bbbd7cb93295ebdcf \ + --hash=sha256:075202fa5b72c86ad32dc7d0b56024ebdbcf2048c0ba09f1cde31bfdd57bcfff \ + --hash=sha256:0e397ac966fdf721b2c528cf028494e86172b4feba51d65f81ffd65c63798f3f \ + --hash=sha256:17b950fccb810b3293638215058e432159d2b71005c74371d784862b7e4683f3 \ + --hash=sha256:1f3fbcb7ef1f16e48246f704ab79d79da8a46891e2da03f8783a5b6fa41a9532 \ + --hash=sha256:2174c595a0d73a3080ca3257b40096db99799265e1c27cc5a610743acd86d62f \ + --hash=sha256:2b7c57a4dfc4f16f7142221afe5ba4e093e09e728ca65c51f5620c9aaeb9a617 \ + --hash=sha256:2d2d793e36e230fd32babe143b04cec8a8b3eb8a3122d2aceb4a371e6b09b8df \ + --hash=sha256:30b600cf0a7ac9234b2638fbc0fb6158ba5bdcdf46aeb631ead21248b9affbc4 \ + --hash=sha256:397081c1a0bfb5124355710fe79478cdbeb39626492b15d399526ae53422b906 \ + --hash=sha256:3a57fdd7ce31c7ff06cdfbf31dafa96cc533c21e443d57f5b1ecc6cdc668ec7f \ + --hash=sha256:3c6b973f22eb18a789b1460b4b91bf04ae3f0c4234a0a6aa6b0a92f6f7b951d4 \ + --hash=sha256:3e53af139f8579a6d5f7b76549125f0d94d7e630761a2111bc431fd820e163b8 \ + --hash=sha256:4096e9de5c6fdf43fb4f04c26fb114f61ef0bf2e5604b6ee3019d51b69e8c371 \ + --hash=sha256:4275d846e41ecefa46e2015117a9f491e57a71ddd59bbead77e904dc02b1bed2 \ + --hash=sha256:4c31f53cdae6ecfa91a77820e8b151dba54ab528ba65dfd235c80b086d68a465 \ + --hash=sha256:4f11aa001c540f62c6166c7726f71f7573b52c68c31f014c25cc7901deea0b52 \ + --hash=sha256:5049256f536511ee3f7e1b3f87d1d1209d327e818e6ae1365e8653d7e3abb6a6 \ + --hash=sha256:58c98fee265677f63a4385256a6d7683ab1832f3ddd1e66fe948d5880c21a169 \ + --hash=sha256:598e3276b64aff0e7b3451b72e94fa3c238d452e7ddcd893c3ab324717456bad \ + --hash=sha256:5b7b716f97b52c5a14bffdf688f971b2d5ef4029127f1ad7a513973cfd818df2 \ + --hash=sha256:5dedb4db619ba5a2787a94d877bc8ffc0566f92a01c0ef214865e54ecc9ee5e0 \ + --hash=sha256:619bc166c4f2de5caa5a633b8b7326fbe98e0ccbfacabd87268a2b15ff73a029 \ + --hash=sha256:629ddd2ca402ae6dbedfceeba9c46d5f7b2a61d9749597d4307f943ef198fc1f \ + --hash=sha256:656f7526c69fac7f600bd1f400991cc282b417d17539a1b228617081106feb4a \ + --hash=sha256:6ec585f69cec0aa07d945b20805be741395e28ac1627333b1c5b0105962ffced \ + --hash=sha256:72b6be590cc35924b02c78ef34b467da4ba07e4e0f0454a2c5907f473fc50ce5 \ + --hash=sha256:7502934a33b54030eaf1194c21c692a534196063db72176b0c4028e140f8f32c \ + --hash=sha256:7a68b554d356a91cce1236aa7682dc01df0edba8d043fd1ce607c49dd3c1edcf \ + --hash=sha256:7b2e5a267c855eea6b4283940daa6e88a285f5f2a67f2220203786dfa59b37e9 \ + --hash=sha256:823b65d8706e32ad2df51ed89496147a42a2a6e01c13cfb6ffb8b1e92bc910bb \ + --hash=sha256:8590b4ae07a35970728874632fed7bd57b26b0102df2d2b233b6d9d82f6c62ad \ + --hash=sha256:8dd717634f5a044f860435c1d8c16a270ddf0ef8588d4887037c5028b859b0c3 \ + --hash=sha256:8dec4936e9c3100156f8a2dc89c4b88d5c435175ff03413b443469c7c8c5f4d1 \ + --hash=sha256:97cafb1f3cbcd3fd2b6fbfb99ae11cdb14deea0736fc2b0952ee177f2b813a46 \ + --hash=sha256:a17a92de5231666cfbe003f0e4b9b3a7ae3afb1ec2845aadc2bacc93ff85febc \ + --hash=sha256:a549b9c31bec33820e885335b451286e2969a2d9e24879f83fe904a5ce59d70a \ + --hash=sha256:ac07bad82163452a6884fe8fa0963fb98c2346ba78d779ec06bd7a6262132aee \ + --hash=sha256:ae2ad8ae6ebee9d2d94b17fb62763125f3f374c25618198f40cbb8b525411900 \ + --hash=sha256:b91c037585eba9095565a3556f611e3cbfaa42ca1e865f7b8015fe5c7336d5a5 \ + --hash=sha256:bc1667f8b83f48511b94671e0e441401371dfd0f0a795c7daa4a3cd1dde55bea \ + --hash=sha256:bec0a414d016ac1a18862a519e54b2fd0fc8bbfd6890376898a6c0891dd82e9f \ + --hash=sha256:bf50cd79a75d181c9181df03572cdce0fbb75cc353bc350712073108cba98de5 \ + --hash=sha256:bff1b4290a66b490a2f4719358c0cdcd9bafb6b8f061e45c7a2460866bf50c2e \ + --hash=sha256:c061bb86a71b42465156a3ee7bd58c8c2ceacdbeb95d05a99893e08b8467359a \ + --hash=sha256:c8b29db45f8fe46ad280a7294f5c3ec36dbac9491f2d1c17345be8e69cc5928f \ + --hash=sha256:ce409136744f6521e39fd8e2a24c53fa18ad67aa5bc7c2cf83645cce5b5c4e50 \ + --hash=sha256:d050b3361367a06d752db6ead6e7edeb0009be66bc3bae0ee9d97fb326badc2a \ + --hash=sha256:d283d37a890ba4c1ae73ffadf8046435c76e7bc2247bbb63c00bd1a709c6544b \ + --hash=sha256:d9fad5155d72433c921b782e58892377c44bd6252b5af2f67f16b194987338a4 \ + --hash=sha256:daa4ee5a243f0f20d528d939d06670a298dd39b1ad5f8a72a4275124a7819eff \ + --hash=sha256:db0b55e0f3cc0be60c1f19efdde9a637c32740486004f20d1cff53c3c0ece4d2 \ + --hash=sha256:e61659ba32cf2cf1481e575d0462554625196a1f2fc06a1c777d3f48e8865d46 \ + --hash=sha256:ea3d8a3d18833cf4304cd2fc9cbb1efe188ca9b5efef2bdac7adc20594a0e46b \ + --hash=sha256:ec6a563cff360b50eed26f13adc43e61bc0c04d94b8be985e6fb24b81f6dcfdf \ + --hash=sha256:f5dfb42c4604dddc8e4305050aa6deb084540643ed5804d7455b5df8fe16f5e5 \ + --hash=sha256:fa173ec60341d6bb97a89f5ea19c85c5643c1e7dedebc22f5181eb73573142c5 \ + --hash=sha256:fa9db3f79de01457b03d4f01b34cf91bc0048eb2c3846ff26f66687c2f6d16ab \ + --hash=sha256:fce659a462a1be54d2ffcacea5e3ba2d74daa74f30f5f143fe0c58636e355fdd \ + --hash=sha256:ffee1f21e5ef0d712f9033568f8344d5da8cc2869dbd08d87c84656e6a2d2f68 mccabe==0.7.0 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325 \ --hash=sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e @@ -371,6 +452,9 @@ multidict==6.0.5 ; python_version >= "3.9" and python_version < "4.0" \ netaddr==1.2.1 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:6eb8fedf0412c6d294d06885c110de945cf4d22d2b510d0404f4e06950857987 \ --hash=sha256:bd9e9534b0d46af328cf64f0e5a23a5a43fca292df221c85580b27394793496e +packaging==24.0 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5 \ + --hash=sha256:eb82c5e3e56209074766e6885bb04b8c38a0c015d0a30036ebe7ece34c9989e9 pycodestyle==2.11.1 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:41ba0e7afc9752dfb53ced5489e89f8186be00e599e712660695b7a75ff2663f \ --hash=sha256:44fe31000b2d866f2e41841b18528a505fbd7fef9017b04eff4e2648a0fadc67 @@ -410,12 +494,12 @@ pycryptodomex==3.20.0 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:e48217c7901edd95f9f097feaa0388da215ed14ce2ece803d3f300b4e694abea \ --hash=sha256:f2e497413560e03421484189a6b65e33fe800d3bd75590e6d78d4dfdb7accf3b \ --hash=sha256:ff5c9a67f8a4fba4aed887216e32cbc48f2a6fb2673bb10a99e43be463e15913 -pydash==8.0.0 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:5a90d98b5f370bb9620f786221579df8f83d54f1f58de6a66f52b1bdba7175d1 \ - --hash=sha256:be2c35df332473a5a939d485422c71a03b19b1a98d6559efb832eadb4a2cfc36 pyflakes==3.2.0 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:1c61603ff154621fb2a9172037d84dca3500def8c8b630657d1701f026f8af3f \ --hash=sha256:84b5be138a2dfbb40689ca07e2152deb896a65c3a3e24c251c5c62489568074a +pygments==2.18.0 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:786ff802f32e91311bff3889f6e9a86e81505fe99f2735bb6d60ae0c5004f199 \ + --hash=sha256:b8e6aca0523f3ab76fee51799c488e38782ac06eafcf95e7ba832985c8e7b13a python-box==7.1.1 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:0036fd47d388deaca8ebd65aea905f88ee6ef91d1d8ce34898b66f1824afbe80 \ --hash=sha256:1b3f346e332dba16df0b0543d319d9e7ce07d93e5ae152175302894352aa2d28 \ @@ -489,9 +573,9 @@ pyyaml==6.0.1 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:fca0e3a251908a499833aa292323f32437106001d436eca0e6e7833256674585 \ --hash=sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d \ --hash=sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f -requests==2.31.0 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f \ - --hash=sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1 +requests==2.32.2 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:dd951ff5ecf3e3b3aa26b40703ba77495dab41da839ae72ef3c8e5d8e2433289 \ + --hash=sha256:fc06670dd0ed212426dfeb94fc1b983d917c4f9847c863f313c9dfaaffb7c23c responses==0.25.0 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:01ae6a02b4f34e39bffceb0fc6786b67a25eae919c6368d05eabc8d9576c2a66 \ --hash=sha256:2f0b9c2b6437db4b528619a77e5d565e4ec2a9532162ac1a131a83529db7be1a @@ -501,12 +585,45 @@ restfly==1.4.7 ; python_version >= "3.9" and python_version < "4.0" \ six==1.16.0 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \ --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254 +snowballstemmer==2.2.0 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:09b16deb8547d3412ad7b590689584cd0fe25ec8db3be37788be3810cbf19cb1 \ + --hash=sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a +sphinx-ansible-theme==0.10.3 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:21f56a96f0977cb6f1ee51f4cb397ae9466576f3020b73f5849c4ca293ba378d \ + --hash=sha256:cdcee91338e0aa1439e74a392b8b89263bd9e1ea452e3d110a1a81d0a2ee31c2 +sphinx-rtd-theme==2.0.0 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:bd5d7b80622406762073a04ef8fadc5f9151261563d47027de09910ce03afe6b \ + --hash=sha256:ec93d0856dc280cf3aee9a4c9807c60e027c7f7b461b77aeffed682e68f0e586 +sphinx==7.3.7 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:413f75440be4cacf328f580b4274ada4565fb2187d696a84970c23f77b64d8c3 \ + --hash=sha256:a4a7db75ed37531c05002d56ed6948d4c42f473a36f46e1382b0bd76ca9627bc +sphinxcontrib-applehelp==1.0.8 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:c40a4f96f3776c4393d933412053962fac2b84f4c99a7982ba42e09576a70619 \ + --hash=sha256:cb61eb0ec1b61f349e5cc36b2028e9e7ca765be05e49641c97241274753067b4 +sphinxcontrib-devhelp==1.0.6 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:6485d09629944511c893fa11355bda18b742b83a2b181f9a009f7e500595c90f \ + --hash=sha256:9893fd3f90506bc4b97bdb977ceb8fbd823989f4316b28c3841ec128544372d3 +sphinxcontrib-htmlhelp==2.0.5 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:0dc87637d5de53dd5eec3a6a01753b1ccf99494bd756aafecd74b4fa9e729015 \ + --hash=sha256:393f04f112b4d2f53d93448d4bce35842f62b307ccdc549ec1585e950bc35e04 +sphinxcontrib-jquery==4.1 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:1620739f04e36a2c779f1a131a2dfd49b2fd07351bf1968ced074365933abc7a \ + --hash=sha256:f936030d7d0147dd026a4f2b5a57343d233f1fc7b363f68b3d4f1cb0993878ae +sphinxcontrib-jsmath==1.0.1 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178 \ + --hash=sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8 +sphinxcontrib-qthelp==1.0.7 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:053dedc38823a80a7209a80860b16b722e9e0209e32fea98c90e4e6624588ed6 \ + --hash=sha256:e2ae3b5c492d58fcbd73281fbd27e34b8393ec34a073c792642cd8e529288182 +sphinxcontrib-serializinghtml==1.1.10 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:326369b8df80a7d2d8d7f99aa5ac577f51ea51556ed974e7716cfd4fca3f6cb7 \ + --hash=sha256:93f3f5dc458b91b192fe10c397e324f262cf163d79f3282c158e8436a2c4511f +tomli==2.0.1 ; python_version >= "3.9" and python_version < "3.11" \ + --hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \ + --hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f types-python-dateutil==2.9.0.20240316 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:5d2f2e240b86905e40944dd787db6da9263f0deabef1076ddaed797351ec0202 \ --hash=sha256:6b8cb66d960771ce5ff974e9dd45e38facb81718cc1e208b10b1baccbfdbee3b -typing-extensions==4.11.0 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:83f085bd5ca59c80295fc2a82ab5dac679cbe02b9f33f7d83af68e241bea51b0 \ - --hash=sha256:c1f94d72897edaf4ce775bb7558d5b79d8126906a14ea5ed1635921406c0387a urllib3==2.2.1 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:450b20ec296a467077128bff42b73080516e71b56ff59a60a02bef2232c4fa9d \ --hash=sha256:d0570876c61ab9e520d776c38acbbb5b05a776d3f9ff98a5c8fd5162a444cf19 @@ -604,6 +721,9 @@ yarl==1.9.4 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:ee04010f26d5102399bd17f8df8bc38dc7ccd7701dc77f4a68c5b8d733406958 \ --hash=sha256:f3bc6af6e2b8f92eced34ef6a96ffb248e863af20ef4fde9448cc8c9b858b749 \ --hash=sha256:f7d6b36dd2e029b6bcb8a13cf19664c7b8e19ab3a58e0fefbb5b8461447ed5ec -zscaler-sdk-python==0.1.2 ; python_version >= "3.9" and python_version < "4.0" \ - --hash=sha256:17eb22891eb1b479fafe6d38544aeef9a92b78cadf42985dfb9c13c26a0d849a \ - --hash=sha256:62ade86b44155e719b6c288216bc5ef2ed8ad0fd89debfd95fced6cbb80b85e5 +zipp==3.18.2 ; python_version >= "3.9" and python_version < "3.10" \ + --hash=sha256:6278d9ddbcfb1f1089a88fde84481528b07b0e10474e09dcfe53dad4069fa059 \ + --hash=sha256:dce197b859eb796242b0622af1b8beb0a722d52aa2f57133ead08edd5bf5374e +zscaler-sdk-python==0.1.8 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:2061c8ee9c5c9b19b4eceb0d91e601ca987c5a7096c6066054d29b51c035a387 \ + --hash=sha256:fd2a37b3f1e7b36e2e5e659cbf3c8088d4585b82edc0c37a2d615b4fade46f87 diff --git a/tests/integration/helper_tasks/zia_rule_labels/create_rule_labels.yml b/tests/integration/helper_tasks/zia_rule_labels/create_rule_labels.yml new file mode 100644 index 0000000..149fefa --- /dev/null +++ b/tests/integration/helper_tasks/zia_rule_labels/create_rule_labels.yml @@ -0,0 +1,48 @@ +--- +- name: Set initial variables + ansible.builtin.set_fact: + label_name: test_zia_ansible + label_description: test_zia_ansible + +- name: Ensure required environment variables are set + ansible.builtin.fail: + msg: "{{ env_var }} is not defined as environment variable" + when: lookup('env', env_var) is none + loop: + - ZIA_USERNAME + - ZIA_PASSWORD + - ZIA_API_KEY + - ZIA_CLOUD + loop_control: + loop_var: env_var + +- name: Ensure ZIA Credential environment variables are set + ansible.builtin.set_fact: + zia_cloud: + username: "{{ lookup('env', 'ZIA_USERNAME') }}" + password: "{{ lookup('env', 'ZIA_PASSWORD') }}" + api_key: "{{ lookup('env', 'ZIA_API_KEY') }}" + cloud: "{{ lookup('env', 'ZIA_CLOUD') | default(omit) }}" + no_log: true + +- name: Import Random String Generator Tasks + ansible.builtin.import_tasks: ../../generate_random_string.yml + +- name: Set dynamic name values with random string + ansible.builtin.set_fact: + label_name: "{{ label_name }}_{{ random_string }}" + label_description: "{{ label_description }}_{{ random_string }}" + +- name: Main block to Test Rule Label Configuration + block: + - name: Create Helper Rule Label + zscaler.ziacloud.zia_rule_labels: + provider: "{{ zia_cloud }}" + state: present + name: "{{ label_name }}" + description: "{{ label_description }}" + register: label_id + + - name: Set Rule Label ID as fact + ansible.builtin.set_fact: + label_id: "{{ label_id.data.id }}" diff --git a/tests/integration/helper_tasks/zia_rule_labels/delete_rule_labels.yml b/tests/integration/helper_tasks/zia_rule_labels/delete_rule_labels.yml new file mode 100644 index 0000000..2a5f418 --- /dev/null +++ b/tests/integration/helper_tasks/zia_rule_labels/delete_rule_labels.yml @@ -0,0 +1,38 @@ +--- +- name: Ensure required environment variables are set + ansible.builtin.fail: + msg: "{{ env_var }} is not defined as environment variable" + when: lookup('env', env_var) is none + loop: + - ZIA_USERNAME + - ZIA_PASSWORD + - ZIA_API_KEY + - ZIA_CLOUD + loop_control: + loop_var: env_var + +- name: Ensure ZIA Credential environment variables are set + ansible.builtin.set_fact: + zia_cloud: + username: "{{ lookup('env', 'ZIA_USERNAME') }}" + password: "{{ lookup('env', 'ZIA_PASSWORD') }}" + api_key: "{{ lookup('env', 'ZIA_API_KEY') }}" + cloud: "{{ lookup('env', 'ZIA_CLOUD') | default(omit) }}" + no_log: true + +- name: Main block to List All Rule Labels Configuration + block: + - name: List all Rule Labels + zscaler.ziacloud.zia_rule_labels_facts: + provider: "{{ zia_cloud }}" + register: all_labels + + - name: Delete all Rule Label 💥 + zscaler.ziacloud.zia_rule_labels: + provider: "{{ zia_cloud }}" + state: absent + name: "{{ rule_label.name }}" + loop: "{{ all_labels.data }}" + when: all_labels.data is defined + loop_control: + loop_var: rule_label diff --git a/tests/integration/helper_tasks/zia_rule_labels/verify_rule_labels.yml b/tests/integration/helper_tasks/zia_rule_labels/verify_rule_labels.yml new file mode 100644 index 0000000..a1c01aa --- /dev/null +++ b/tests/integration/helper_tasks/zia_rule_labels/verify_rule_labels.yml @@ -0,0 +1,37 @@ +--- +- name: Ensure required environment variables are set + ansible.builtin.fail: + msg: "{{ env_var }} is not defined as environment variable" + when: lookup('env', env_var) is none + loop: + - ZIA_USERNAME + - ZIA_PASSWORD + - ZIA_API_KEY + - ZIA_CLOUD + loop_control: + loop_var: env_var + +- name: Ensure ZIA Credential environment variables are set + ansible.builtin.set_fact: + zia_cloud: + username: "{{ lookup('env', 'ZIA_USERNAME') }}" + password: "{{ lookup('env', 'ZIA_PASSWORD') }}" + api_key: "{{ lookup('env', 'ZIA_API_KEY') }}" + cloud: "{{ lookup('env', 'ZIA_CLOUD') | default(omit) }}" + no_log: true + +- name: Main block to Fetch The Created Rule Label Configuration + block: + - name: Fetch the created Rule Label + zscaler.ziacloud.zia_rule_labels_facts: + provider: "{{ zia_cloud }}" + id: "{{ label_id }}" # assuming you have the ID stored in this variable + register: fetched_label + + - name: Verify App Rule Label attributes + ansible.builtin.assert: + that: + - fetched_label.data[0].name == label_name + - fetched_label.data[0].name == label_description + fail_msg: Verification failed for Rule Label! + success_msg: Verification successful for Rule Label! diff --git a/tests/integration/run_all_tests.yml b/tests/integration/run_all_tests.yml index 5ef6353..47fade7 100644 --- a/tests/integration/run_all_tests.yml +++ b/tests/integration/run_all_tests.yml @@ -39,6 +39,7 @@ - targets/zia_traffic_forwarding_gre_tunnels/tasks/main.yml - targets/zia_traffic_forwarding_static_ip/tasks/main.yml - targets/zia_traffic_forwarding_vpn_credentials/tasks/main.yml + - targets/zia_url_filtering_rules/tasks/main.yml - name: Run final sweep to clean tenant ansible.builtin.include_tasks: ./sweep.yml diff --git a/tests/integration/sweep.yml b/tests/integration/sweep.yml index e1ab530..8d3b477 100644 --- a/tests/integration/sweep.yml +++ b/tests/integration/sweep.yml @@ -12,6 +12,19 @@ loop: "{{ all_dlp_rules.data }}" when: all_dlp_rules.data is defined +- name: List all Cloud Firewall Rules + zscaler.ziacloud.zia_cloud_firewall_filtering_rule_facts: + provider: "{{ zia_cloud }}" + register: all_firewall_rules + +- name: Delete all Cloud Firewall Rules 💥 + zscaler.ziacloud.zia_cloud_firewall_filtering_rule: + provider: "{{ zia_cloud }}" + state: absent + name: "{{ item.name }}" + loop: "{{ all_firewall_rules.data }}" + when: all_firewall_rules.data is defined + - name: List all URL Filtering Rules zscaler.ziacloud.zia_url_filtering_rule_facts: provider: "{{ zia_cloud }}" @@ -93,8 +106,9 @@ - name: Set fact for each task status ansible.builtin.set_fact: + cloud_firewall_rules_failed: "{{ all_firewall_rules.failed | default(false) }}" dlp_web_rules_failed: "{{ all_dlp_rules.failed | default(false) }}" - url_filtering_rules_failed: "{{ all_url_rules.failed | default(false) }}" + url_rules_failed: "{{ all_url_rules.failed | default(false) }}" locations_failed: "{{ all_locations.failed | default(false) }}" rule_labels_failed: "{{ all_rule_labels.failed | default(false) }}" ip_dest_groups_failed: "{{ all_ip_dest_groups.failed | default(false) }}" @@ -106,8 +120,9 @@ sweep_successful: >- {{ not ( + cloud_firewall_rules_failed or dlp_web_rules_failed or - url_filtering_rules_failed or + url_rules_failed or locations_failed or rule_labels_failed or ip_dest_groups_failed or diff --git a/tests/integration/targets/zia_url_filtering_rules/defaults/main.yml b/tests/integration/targets/zia_url_filtering_rules/defaults/main.yml new file mode 100644 index 0000000..2605a49 --- /dev/null +++ b/tests/integration/targets/zia_url_filtering_rules/defaults/main.yml @@ -0,0 +1,45 @@ +--- +rule_name: test_zia_ansible +description: test_zia_ansible +rule_action: ALLOW +rule_order: 1 +enabled: true +url_categories: + - ANY +protocols: + - ANY_RULE +device_trust_levels: + - UNKNOWN_DEVICETRUSTLEVEL + - LOW_TRUST + - MEDIUM_TRUST + - HIGH_TRUST +user_agent_types: + - OPERA + - FIREFOX + - MSIE + - MSEDGE + - CHROME + - SAFARI + - MSCHREDGE + - OTHER +user_risk_score_levels: + - LOW + - MEDIUM + - HIGH + - CRITICAL +request_methods: + - CONNECT + - DELETE + - GET + - HEAD + - OPTIONS + - OTHER + - POST + - PUT + - TRACE + +# URL Filtering Rule Update +name_update: test_zia_ansible +description_update: test_zia_ansible_update +action_update: BLOCK +enabled_update: false diff --git a/tests/integration/targets/zia_url_filtering_rules/meta/main.yml b/tests/integration/targets/zia_url_filtering_rules/meta/main.yml new file mode 100644 index 0000000..23d65c7 --- /dev/null +++ b/tests/integration/targets/zia_url_filtering_rules/meta/main.yml @@ -0,0 +1,2 @@ +--- +dependencies: [] diff --git a/tests/integration/targets/zia_url_filtering_rules/tasks/main.yml b/tests/integration/targets/zia_url_filtering_rules/tasks/main.yml new file mode 100644 index 0000000..56e6da8 --- /dev/null +++ b/tests/integration/targets/zia_url_filtering_rules/tasks/main.yml @@ -0,0 +1,218 @@ +--- +- name: Include default variables + ansible.builtin.include_vars: + file: ../defaults/main.yml + +- name: Import Random String Generator Tasks + ansible.builtin.import_tasks: ../../../generate_random_string.yml + +- name: Set dynamic name values with random string + ansible.builtin.set_fact: + rule_name: "{{ rule_name }}_{{ random_string }}" + description: "{{ description }}_{{ random_string }}" + description_update: "{{ description_update }}_{{ random_string }}" + +- name: Ensure required environment variables are set + ansible.builtin.fail: + msg: "{{ env_var }} is not defined as environment variable" + when: lookup('env', env_var) is none + loop: + - ZIA_USERNAME + - ZIA_PASSWORD + - ZIA_API_KEY + - ZIA_CLOUD + loop_control: + loop_var: env_var + +- name: Ensure ZIA Credential environment variables are set + ansible.builtin.set_fact: + zia_cloud: + username: "{{ lookup('env', 'ZIA_USERNAME') }}" + password: "{{ lookup('env', 'ZIA_PASSWORD') }}" + api_key: "{{ lookup('env', 'ZIA_API_KEY') }}" + cloud: "{{ lookup('env', 'ZIA_CLOUD') | default(omit) }}" + no_log: true + +- name: Main block to Test URL Filtering Rule Configuration + block: + - name: Ensure URL Filtering Rule (leftover) + zscaler.ziacloud.zia_url_filtering_rules: + provider: "{{ zia_cloud }}" + state: absent + name: "{{ rule_name }}" + order: "{{ rule_order }}" + register: result + + rescue: + - name: Handle errors + ansible.builtin.debug: + msg: An error occurred. + + always: + - name: Cleanup operations + ansible.builtin.debug: + msg: Cleanup complete. + + - name: Ensure URL Filtering Rule is absent + zscaler.ziacloud.zia_url_filtering_rules: + provider: "{{ zia_cloud }}" + state: absent + name: "{{ rule_name }}" + order: "{{ rule_order }}" + register: result + + - name: Verify URL Filtering Rule is absent + ansible.builtin.assert: + that: + - not result.changed + - result.data is defined + + - name: Ensure URL Filtering Rule is (Present) + zscaler.ziacloud.zia_url_filtering_rules: + provider: "{{ zia_cloud }}" + state: present + name: "{{ rule_name }}" + description: "{{ description }}" + action: "{{ rule_action }}" + order: "{{ rule_order }}" + enabled: "{{ enabled }}" + url_categories: "{{ url_categories }}" + protocols: "{{ protocols }}" + device_trust_levels: "{{ device_trust_levels }}" + user_agent_types: "{{ user_agent_types }}" + user_risk_score_levels: "{{ user_risk_score_levels }}" + request_methods: "{{ request_methods }}" + register: result + + - name: Verify URL Filtering Rule is present + ansible.builtin.assert: + that: + - result.changed + - result.data is defined + - result.data.name is defined + + - name: Ensure URL Filtering Rule (again; idempotency check) + zscaler.ziacloud.zia_url_filtering_rules: + provider: "{{ zia_cloud }}" + state: present + name: "{{ rule_name }}" + description: "{{ description }}" + action: "{{ rule_action }}" + order: "{{ rule_order }}" + enabled: "{{ enabled }}" + url_categories: "{{ url_categories }}" + protocols: "{{ protocols }}" + device_trust_levels: "{{ device_trust_levels }}" + user_agent_types: "{{ user_agent_types }}" + user_risk_score_levels: "{{ user_risk_score_levels }}" + request_methods: "{{ request_methods }}" + register: result + + - name: Ensure URL Filtering Rule is present (idempotency check) + ansible.builtin.assert: + that: + - result.changed + + - name: Update URL Filtering Rule (Present) + zscaler.ziacloud.zia_url_filtering_rules: + provider: "{{ zia_cloud }}" + state: present + name: "{{ rule_name }}" + description: "{{ description_update }}" + action: "{{ action_update }}" + order: "{{ rule_order }}" + enabled: "{{ enabled_update }}" + url_categories: "{{ url_categories }}" + protocols: "{{ protocols }}" + device_trust_levels: "{{ device_trust_levels }}" + user_agent_types: "{{ user_agent_types }}" + user_risk_score_levels: "{{ user_risk_score_levels }}" + request_methods: "{{ request_methods }}" + register: result + + - name: Verify URL Filtering Rule is Updated + ansible.builtin.assert: + that: + - result.changed + - result.data is defined + - result.data.name == rule_name + - result.data.description == description_update + - result.data.action == action_update + + - name: Ensure URL Filtering Rule is Updated (again; idempotency check) + zscaler.ziacloud.zia_url_filtering_rules: + provider: "{{ zia_cloud }}" + state: present + name: "{{ rule_name }}" + description: "{{ description_update }}" + action: "{{ action_update }}" + order: "{{ rule_order }}" + enabled: "{{ enabled_update }}" + url_categories: "{{ url_categories }}" + protocols: "{{ protocols }}" + device_trust_levels: "{{ device_trust_levels }}" + user_agent_types: "{{ user_agent_types }}" + user_risk_score_levels: "{{ user_risk_score_levels }}" + request_methods: "{{ request_methods }}" + register: result + + - name: Ensure URL Filtering Rule update is idempotent + ansible.builtin.assert: + that: + - result.changed + + - name: Fetch all URL Filtering Rule + zscaler.ziacloud.zia_url_filtering_rule_facts: + provider: "{{ zia_cloud }}" + register: result + + - name: Ensure all URL Filtering Rule found + ansible.builtin.assert: + that: + - not result.changed + - result.data[0] is defined + + - name: Fetch this URL Filtering Rule + zscaler.ziacloud.zia_url_filtering_rule_facts: + provider: "{{ zia_cloud }}" + name: "{{ rule_name }}" + register: result + + - name: Ensure this URL Filtering Rule is found + ansible.builtin.assert: + that: + - not result.changed + - result.data is defined + - result.data[0].name is defined + - result.data[0].name == rule_name + + - name: Give the ZIA Cloud a 5 seconds to settle + ansible.builtin.pause: + seconds: 5 + + - name: Delete URL Filtering Rule + zscaler.ziacloud.zia_url_filtering_rules: + provider: "{{ zia_cloud }}" + state: absent + name: "{{ rule_name }}" + order: "{{ rule_order }}" + register: result + + - name: Verify URL Filtering Rule is Deleted + ansible.builtin.assert: + that: + - result.changed + + - name: Delete URL Filtering Rule (again; idempotency check) + zscaler.ziacloud.zia_url_filtering_rules: + provider: "{{ zia_cloud }}" + state: absent + name: "{{ rule_name }}" + order: "{{ rule_order }}" + register: result + + - name: Verify URL Filtering Rule is absent + ansible.builtin.assert: + that: + - not result.changed + - result.data is defined