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

[5.0.6] Custom Attribute Field Parsing from Dynamic Fields #260

Merged
merged 3 commits into from
Jul 10, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.11.2
3.11.1
7 changes: 7 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@ name = "pypi"

[packages]
e1839a8 = {path = ".",editable = true}

[dev-packages]
ipython = "*"
pytest = "*"
flaky = "*"
coverage = "*"
pytest-cov = "*"
6 changes: 3 additions & 3 deletions axonius_api_client/api/assets/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,14 +614,15 @@ def split_search(self, value: str, adapter: str = AGG_ADAPTER_NAME) -> Tuple[str
"""
search = value.strip().lower()

if ":" in search:
# Problem are fields containing ":" from adapters that populate dynamic fields
# PBUG: special check for 'custom attributes' coming from esx adapter.
if ":" in search and 'custom attributes' not in search:
adapter_split, field = [x.strip() for x in search.split(":", 1)]
if not adapter_split:
adapter_split = adapter
else:
field = search
adapter_split = adapter

qual_check = re.match(r"adapters_data\.(.*?)\.", field)
if qual_check and len(qual_check.groups()) == 1:
adapter_split = qual_check.groups()[0]
Expand All @@ -639,7 +640,6 @@ def split_search(self, value: str, adapter: str = AGG_ADAPTER_NAME) -> Tuple[str

if not fields:
raise ApiError(f"No fields provided in {value!r}, format must be 'adapter:field'")

return adapter_split, fields

def _prettify_schemas(
Expand Down
2 changes: 1 addition & 1 deletion axonius_api_client/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
"""Version information for this package."""
__version__ = "5.0.5"
__version__ = "5.0.6"
VERSION: str = __version__
"""Version of package."""

Expand Down