Skip to content

Commit

Permalink
Merge branch 'master' into panos-audit-comment
Browse files Browse the repository at this point in the history
  • Loading branch information
yaakovpraisler committed Mar 4, 2024
2 parents 4bf4707 + d6dbab4 commit bb62da1
Show file tree
Hide file tree
Showing 55 changed files with 692 additions and 125 deletions.
16 changes: 8 additions & 8 deletions Packs/CTIX/Integrations/CTIX/CTIX.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import requests
import urllib.parse
import urllib3
from typing import Any, Dict
from typing import Any

# Disable insecure warnings
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
Expand Down Expand Up @@ -233,7 +233,7 @@ def test_module(client: Client):
demisto.results('ok')


def ip_details_command(client: Client, args: Dict[str, Any]) -> List[CommandResults]:
def ip_details_command(client: Client, args: dict[str, Any]) -> List[CommandResults]:
"""
ip command: Returns IP details for a list of IPs
"""
Expand Down Expand Up @@ -304,7 +304,7 @@ def ip_details_command(client: Client, args: Dict[str, Any]) -> List[CommandResu
return ip_data_list


def domain_details_command(client: Client, args: Dict[str, Any]) -> List[CommandResults]:
def domain_details_command(client: Client, args: dict[str, Any]) -> List[CommandResults]:
"""
domain command: Returns domain details for a list of domains
"""
Expand Down Expand Up @@ -374,7 +374,7 @@ def domain_details_command(client: Client, args: Dict[str, Any]) -> List[Command
return domain_data_list


def url_details_command(client: Client, args: Dict[str, Any]) -> List[CommandResults]:
def url_details_command(client: Client, args: dict[str, Any]) -> List[CommandResults]:
"""
url command: Returns URL details for a list of URL
"""
Expand Down Expand Up @@ -443,7 +443,7 @@ def url_details_command(client: Client, args: Dict[str, Any]) -> List[CommandRes
return url_data_list


def file_details_command(client: Client, args: Dict[str, Any]) -> List[CommandResults]:
def file_details_command(client: Client, args: dict[str, Any]) -> List[CommandResults]:
"""
file command: Returns FILE details for a list of FILE
"""
Expand Down Expand Up @@ -489,7 +489,7 @@ def file_details_command(client: Client, args: Dict[str, Any]) -> List[CommandRe
elif hash_type == "sha256":
file_standard_context.sha256 = file_key
elif hash_type == "sha512":
file_standard_context.sha512 == file_key
file_standard_context.sha512 = file_key

file_data_list.append(CommandResults(
readable_output=tableToMarkdown('File Data', file_data, removeNull=True),
Expand Down Expand Up @@ -517,7 +517,7 @@ def file_details_command(client: Client, args: Dict[str, Any]) -> List[CommandRe
elif hash_type == "sha256":
file_standard_context.sha256 = file_key
elif hash_type == "sha512":
file_standard_context.sha512 == file_key
file_standard_context.sha512 = file_key

file_data_list.append(CommandResults(
readable_output=f'No matches found for FILE {file_key}',
Expand All @@ -529,7 +529,7 @@ def file_details_command(client: Client, args: Dict[str, Any]) -> List[CommandRe
return file_data_list


def create_intel_command(client: Client, args: Dict[str, Any]) -> Dict:
def create_intel_command(client: Client, args: dict[str, Any]) -> dict:
"""
create_intel command: Creates Intel in CTIX
"""
Expand Down
2 changes: 1 addition & 1 deletion Packs/CTIX/Integrations/CTIX/CTIX.yml
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ script:
- contextPath: CTIX.Intel.status
description: Status code returned from the api.
type: String
dockerimage: demisto/python3:3.10.13.84405
dockerimage: demisto/python3:3.10.13.87159
subtype: python3
tests:
- No tests
5 changes: 2 additions & 3 deletions Packs/CTIX/Integrations/CTIX/CTIX_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import io
import json

'''CONSTANTS'''
Expand All @@ -9,7 +8,7 @@


def util_load_json(path):
with io.open(path, mode='r', encoding='utf-8') as f:
with open(path, encoding='utf-8') as f:
return json.loads(f.read())


Expand Down Expand Up @@ -276,6 +275,6 @@ def test_create_intel(requests_mock):
}
response = create_intel_command(client, post_data)

assert 'data', 'status' in response['CTIX']['Intel']['response']
assert all(k in response['CTIX']['Intel']['response'] for k in ('data', 'status'))
assert 'status' in response['CTIX']['Intel']
assert response['CTIX']['Intel']['response']['status'] == 201
Loading

0 comments on commit bb62da1

Please sign in to comment.