Skip to content

Commit

Permalink
Merge pull request #305 from bsummers-tc/develop
Browse files Browse the repository at this point in the history
Release prep for 3.0.8
  • Loading branch information
bsummers-tc authored Apr 7, 2023
2 parents 7e48e8b + 783e0b4 commit 3c81123
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ disable = "C0103,C0302,C0330,C0415,E0401,R0205,R0801,R0902,R0903,R0904,R0912,R09
extension-pkg-whitelist = "pydantic"

[tool.pytest.ini_options]
# addopts = "-n auto"
junit_family = "xunit2"
testpaths = [
"tests",
Expand Down
12 changes: 8 additions & 4 deletions release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

### 3.0.8

- APP-3899 [CLI] Updated error handling on CLI when downloading template files
- APP-3900 [CLI] Updated proxy support for CLI
- APP-3906 [CLI] Don't create requirements.lock file if any errors occurred during tcex deps.
APP-3922 [API] Update TI Transforms to treat event_date field on some group types as a datetime transform.
- APP-3899 - [CLI] Updated error handling on CLI when downloading template files
- APP-3900 - [CLI] Updated proxy support for CLI
- APP-3906 - [CLI] Updated Deps command to no create the requirements.lock file on error
- APP-3922 - [API] Updated TI Transforms to treat event_date field on some group types as a datetime transform
- APP-3937 - [TcEx] Pinned dependencies to prevent pickup up packages that dropped support for Python 3.6
- APP-3938 - [API] Updated TI Transforms to support active field on indicators
- APP-3939 - [API] Updated TI Transforms to support Security Labels
- APP-3940 - [API] Updated `api.tc.v3` module to support changes in TC 7.1

### 3.0.7

Expand Down
3 changes: 3 additions & 0 deletions tcex/api/tc/v3/object_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ def create(self, params: Optional[dict] = None) -> 'Response':
"""
method = 'POST'
body = self.model.gen_body_json(method=method)

params = self.gen_params(params or {})
self._request(
method,
self.url(method),
Expand Down Expand Up @@ -345,6 +347,7 @@ def update(self, mode: Optional[str] = None, params: Optional[dict] = None) -> '
# validate an id is available
self._validate_id(unique_id, self.url(method))

params = self.gen_params(params or {})
self._request(
method,
self.url(method, unique_id=unique_id),
Expand Down
2 changes: 1 addition & 1 deletion tests/api/tc/v3/groups/test_group_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def test_victim_asset_associations(self):
)
staged_victim.stage_victim_asset(asset)

staged_victim.update(params={'owner': 'TCI'})
staged_victim.update(params={'owner': 'TCI', 'fields': ['_all_']})

assert asset.as_entity.get('type') == 'Victim Asset : EmailAddress'
assert asset.as_entity.get('value') == 'Trojan : malware@example.com'
Expand Down
6 changes: 3 additions & 3 deletions tests/api/tc/v3/indicators/test_indicator_snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def test_add_indicator_file_actions(self):
# Begin Snippet
relationship_type = 'File DNS Query'
indicator.stage_file_action({'relationship': relationship_type, 'indicator': host.model})
indicator.update()
indicator.update(params={'fields': ['_all_']})
# End Snippet

assert len(indicator.model.file_actions.data) == 1
Expand All @@ -323,7 +323,7 @@ def test_remove_indicator_file_actions(self):
# [Stage Testing] - Stage an the file action to be removed
indicator.stage_file_action({'relationship': relationship_type, 'indicator': host.model})
# [Delete Testing] - Delete the newly staged file action
indicator.update(mode='delete')
indicator.update(mode='delete', params={'fields': ['_all_']})
# End Snippet

assert len(indicator.model.file_actions.data) == 1
Expand All @@ -349,7 +349,7 @@ def test_replace_indicator_file_actions(self):
# [Stage Testing] - Stage an the file action. This will replace the existing file actions.
indicator.stage_file_action({'relationship': relationship_type, 'indicator': host_2.model})
# [Replace Testing] - Replace all the current file actions with the new file actions.
indicator.update(mode='replace')
indicator.update(mode='replace', params={'fields': ['_all_']})
# End Snippet

assert len(indicator.model.file_actions.data) == 1
Expand Down
8 changes: 4 additions & 4 deletions tests/api/tc/v3/v3_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def create_case(self, **kwargs):
case.stage_task(self.v3.task(**task))

# create object
case.create(kwargs.get('params', {}))
case.create(params={'fields': ['_all_']})

# store case id for cleanup
self._v3_objects.append(case)
Expand Down Expand Up @@ -482,7 +482,7 @@ def create_group(self, type_: Optional[str] = 'Adversary', **kwargs):
group.stage_tag(self.v3.tag(**tag))

# create object
group.create()
group.create(params={'fields': ['_all_']})

# store case id for cleanup
self._v3_objects.append(group)
Expand Down Expand Up @@ -589,7 +589,7 @@ def value_3_map():
indicator.stage_tag(self.v3.tag(**tag))

# create object
indicator.create()
indicator.create(params={'fields': ['_all_']})

# store case id for cleanup
self._v3_objects.append(indicator)
Expand Down Expand Up @@ -669,7 +669,7 @@ def create_victim(self, **kwargs):
victim.stage_tag(self.v3.tag(**tag))

# create object
victim.create()
victim.create(params={'fields': ['_all_']})

# store case id for cleanup
self._v3_objects.append(victim)
Expand Down

0 comments on commit 3c81123

Please sign in to comment.