diff --git a/convert_to_utf8.py b/convert_to_utf8.py deleted file mode 100644 index 857ac59..0000000 --- a/convert_to_utf8.py +++ /dev/null @@ -1,36 +0,0 @@ -import os -import chardet - - -def convert_to_utf8(filename): - """Convert a file to UTF-8 encoding.""" - # Detect encoding - with open(filename, "rb") as file: - raw_data = file.read() - result = chardet.detect(raw_data) - current_encoding = result["encoding"] - - # Read in current encoding - with open(filename, "r", encoding=current_encoding) as file: - content = file.read() - - # Write in UTF-8 encoding - with open(filename, "w", encoding="utf-8") as file: - file.write(content) - - -def convert_directory_to_utf8(directory): - """Convert all files in a directory (and its subdirectories) to UTF-8.""" - for root, dirs, files in os.walk(directory): - for file in files: - file_path = os.path.join(root, file) - try: - convert_to_utf8(file_path) - print(f"Converted {file_path} to UTF-8") - except Exception as e: - print(f"Failed to convert {file_path}: {e}") - - -# Replace 'path/to/your/directory' with the path to your modules/plugins directory -directory_path = "./plugins/modules" -convert_directory_to_utf8(directory_path) diff --git a/plugins/modules/zpa_application_segment_inspection.py b/plugins/modules/zpa_application_segment_inspection.py index 191531e..8605359 100644 --- a/plugins/modules/zpa_application_segment_inspection.py +++ b/plugins/modules/zpa_application_segment_inspection.py @@ -162,6 +162,11 @@ - By default, this field is set to false. type: bool required: false + bypass_on_reauth: + description: + - Indicates if Bypass During Reauthentication is enabled for the application + type: bool + required: false bypass_type: description: - Indicates whether users can bypass ZPA to access applications. @@ -345,6 +350,7 @@ def core(module): "udp_protocols", "enabled", "bypass_type", + "bypass_on_reauth", "health_reporting", "double_encrypt", "tcp_keep_alive", @@ -480,6 +486,7 @@ def core(module): "inspect_traffic_with_zia", None ), adp_enabled=existing_app.get("adp_enabled", None), + bypass_on_reauth=existing_app.get("bypass_on_reauth", None), name=existing_app.get("name", None), common_apps_dto=existing_app.get( "common_apps_dto", None @@ -514,6 +521,7 @@ def core(module): description=app.get("description", None), enabled=app.get("enabled", None), bypass_type=app.get("bypass_type", None), + bypass_on_reauth=app.get("bypass_on_reauth", None), domain_names=app.get("domain_names", None), double_encrypt=app.get("double_encrypt", None), health_check_type=app.get("health_check_type", None), @@ -535,8 +543,8 @@ def core(module): server_group_ids=app.get("server_group_ids", None), tcp_port_ranges=convert_ports_list(app.get("tcp_port_range", None)), udp_port_ranges=convert_ports_list(app.get("udp_port_range", None)), - tcp_protocols=existing_app.get("tcp_protocols", None), - udp_protocols=existing_app.get("udp_protocols", None), + tcp_protocols=app.get("tcp_protocols", None), + udp_protocols=app.get("udp_protocols", None), ) ) app = client.app_segments_inspection.add_segment_inspection(**app) @@ -567,14 +575,15 @@ def main(): apps_config_spec = dict( name=dict(type="str", required=True), description=dict(type="str", required=False), - enabled=dict(type="bool", required=False, default=True), - app_types=dict(type="list", elements="str", choices=["INSPECT"], required=True), + enabled=dict(type="bool", required=False, default=False), + app_types=dict(type="list", elements="str", choices=["INSPECT"], required=False), application_port=dict(type="str", required=False), - application_protocol=dict(type="str", choices=["HTTP", "HTTPS"], required=True), + application_protocol=dict(type="str", choices=["NONE", "HTTP", "HTTPS"], required=False), certificate_id=dict(type="str", required=False), trust_untrusted_cert=dict(type="bool", required=False), allow_options=dict(type="bool", required=False), - domain=dict(type="str", required=True), + domain=dict(type="str", required=False), + protocols=dict(type="list", elements="str", choices=["SMB", "LDAP", "KERBEROS"], required=False), ) argument_spec.update( id=dict(type="str", required=False), @@ -586,6 +595,7 @@ def main(): is_incomplete_dr_config=dict(type="bool", required=False), inspect_traffic_with_zia=dict(type="bool", required=False), adp_enabled=dict(type="bool", required=False), + bypass_on_reauth=dict(type="bool", required=False), bypass_type=dict( type="str", required=False, diff --git a/sanity.py b/sanity.py deleted file mode 100644 index 642b5c3..0000000 --- a/sanity.py +++ /dev/null @@ -1,31 +0,0 @@ -import os - -# Define the modules directory, ignore versions, and path to the sanity tests directory -modules_directory = "plugins/modules" -sanity_tests_directory = "tests/sanity" -ignore_versions = ["2.13", "2.14", "2.15", "2.16"] -license_issue = "validate-modules:missing-gplv3-license" - -# Check if the sanity tests directory exists, if not, create it -if not os.path.exists(sanity_tests_directory): - os.makedirs(sanity_tests_directory) - -# Get a list of all module files in the modules directory, excluding __init__.py -modules = [ - f for f in os.listdir(modules_directory) if f.endswith(".py") and f != "__init__.py" -] - -# Ensure that there are no duplicate modules -modules = list(set(modules)) - -# For each version, generate an ignore file within the sanity tests directory -for version in ignore_versions: - with open( - os.path.join(sanity_tests_directory, f"ignore-{version}.txt"), "w" - ) as ignore_file: - for module in modules: - ignore_file.write(f"{modules_directory}/{module} {license_issue}\n") - -print( - f"Generated ignore files in {sanity_tests_directory} for versions: {', '.join(ignore_versions)}" -)