Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add types-protobuf, fix AWSWAF type hint #31792

Merged
merged 6 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions Packs/AWS_WAF/Integrations/AWSWAF/AWSWAF.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
from CommonServerPython import * # noqa # pylint: disable=unused-wildcard-import
from CommonServerUserPython import * # noqa
from AWSApiModule import * # noqa: E402
from typing import TYPE_CHECKING, Callable, Tuple, Any, List
from typing import TYPE_CHECKING, Any
from collections.abc import Callable

# The following import are used only for type hints and autocomplete.
# It is not used at runtime, and not exist in the docker image.
Expand All @@ -11,7 +12,7 @@
from mypy_boto3_wafv2.type_defs import (
RegexTypeDef,
UpdateRuleGroupResponseTypeDef,
RuleOutputTypeDef,
RuleTypeDef,
VisibilityConfigTypeDef
)

Expand Down Expand Up @@ -153,7 +154,7 @@ def get_tags_dict_from_args(tag_keys: list, tag_values: list) -> list:
return [{'Key': k, 'Value': v} for k, v in zip(tag_keys, tag_values)]


def build_regex_pattern_object(regex_patterns: list) -> List["RegexTypeDef"]:
def build_regex_pattern_object(regex_patterns: list) -> list["RegexTypeDef"]:
"""
Creates a list of dictionaries which represent a regex set object
Args:
Expand Down Expand Up @@ -431,7 +432,7 @@ def append_new_rule(rules: list, rule: dict) -> list:


def get_required_response_fields_from_rule_group(client: "WAFV2Client", kwargs: dict
) -> Tuple[List["RuleOutputTypeDef"], "VisibilityConfigTypeDef", str]:
) -> tuple[list["RuleTypeDef"], "VisibilityConfigTypeDef", str]:
"""
Gets all the fields from the response that are required for the update request
Args:
Expand Down
2 changes: 1 addition & 1 deletion Packs/AWS_WAF/Integrations/AWSWAF/AWSWAF.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,7 @@ script:
script: '-'
type: python
subtype: python3
dockerimage: demisto/boto3py3:1.0.0.75596
dockerimage: demisto/boto3py3:1.0.0.83962
fromversion: 6.5.0
tests:
- No tests (auto formatted)
3 changes: 1 addition & 2 deletions Packs/AWS_WAF/Integrations/AWSWAF/AWSWAF_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import json
import io
from CommonServerPython import *
import pytest
from AWSWAF import OPERATOR_TO_STATEMENT_OPERATOR, REGEX_MATCH_STATEMENT, BYTE_MATCH_STATEMENT
Expand Down Expand Up @@ -56,7 +55,7 @@ def delete_rule_group(self, **kwargs):


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


Expand Down
6 changes: 6 additions & 0 deletions Packs/AWS_WAF/ReleaseNotes/1_0_4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

#### Integrations

##### AWS-WAF
- Documentation and metadata improvements.
- Updated the Docker image to: demisto/boto3py3:1.0.0.83962.
2 changes: 1 addition & 1 deletion Packs/AWS_WAF/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "AWS WAF",
"description": "Amazon Web Services Web Application Firewall (WAF)",
"support": "xsoar",
"currentVersion": "1.0.3",
"currentVersion": "1.0.4",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down
44 changes: 22 additions & 22 deletions poetry.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ boto3-stubs = { extras = [
"ssm",
"wafv2",
], version = "^1.28.31" }
types-protobuf = "^4.24.0.4"

[tool.poetry.group.native]
# This is the python dependencies from the py3-native docker image.
Expand Down