Skip to content

Commit

Permalink
Bump to 2.14.0a6
Browse files Browse the repository at this point in the history
  • Loading branch information
Skyman2413 committed Sep 30, 2024
1 parent 5e61c19 commit 0fb6d80
Show file tree
Hide file tree
Showing 9 changed files with 105 additions and 36 deletions.
6 changes: 6 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Release History
===============

2.14.0a6
---------------------
- Add Threat landscapes API Section
- Add `ThreatLandscapes` to `ResourceNames`
- Fix CustomLists API implementation (wrong request params names)

2.14.0a5
---------------------
- Add CustomLists API Section
Expand Down
2 changes: 1 addition & 1 deletion cybsi/__version__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "2.14.0a5"
__version__ = "2.14.0a6"
__title__ = "cybsi-python-sdk"
__description__ = "Cybersecurity threat intelligence development kit"
__license__ = "Apache License 2.0"
Expand Down
12 changes: 6 additions & 6 deletions cybsi/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from .artifact import ArtifactsAPI, ArtifactsAsyncAPI
from .auth import APIKeyAuth, APIKeysAPI
from .client_config import DEFAULT_LIMITS, DEFAULT_TIMEOUTS, Limits, Timeouts
from .custom_list import CustomListAPI, CustomListsAsyncAPI
from .custom_list import CustomListsAPI, CustomListsAsyncAPI
from .data_source import (
DataSourcesAPI,
DataSourcesAsyncAPI,
Expand All @@ -23,8 +23,8 @@
from .report import ReportsAPI, ReportsAsyncAPI
from .search import SearchAPI
from .search.api import SearchAsyncAPI
from .threat_landscape import ThreatLandscapesAPI, ThreatLandscapesAsyncAPI
from .ual import AccessLogsAPI
from .threat_landscapes import ThreatLandscapesAPI, ThreatLandscapesAsyncAPI
from .user import UsersAPI


Expand Down Expand Up @@ -192,12 +192,12 @@ def access_logs(self) -> AccessLogsAPI:
return AccessLogsAPI(self._connector)

@property
def custom_lists(self) -> CustomListAPI:
def custom_lists(self) -> CustomListsAPI:
"""Custom list API handle."""
return CustomListAPI(self._connector)
return CustomListsAPI(self._connector)

@property
def threat_landscape(self) -> ThreatLandscapesAPI:
def threat_landscapes(self) -> ThreatLandscapesAPI:
"""Threat Landscape API handle."""
return ThreatLandscapesAPI(self._connector)

Expand Down Expand Up @@ -305,7 +305,7 @@ def dictionaries(self) -> DictionariesAsyncAPI:
return DictionariesAsyncAPI(self._connector)

@property
def threat_landscape(self) -> ThreatLandscapesAsyncAPI:
def threat_landscapes(self) -> ThreatLandscapesAsyncAPI:
"""Threat Landscape API handle."""
return ThreatLandscapesAsyncAPI(self._connector)

Expand Down
2 changes: 1 addition & 1 deletion cybsi/api/custom_list/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

from .api import (
CustomListAPI,
CustomListsAPI,
CustomListsAsyncAPI,
CustomListCommonView,
CustomListForm,
Expand Down
12 changes: 6 additions & 6 deletions cybsi/api/custom_list/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
_PATH = "/custom-lists"


class CustomListAPI(BaseAPI):
class CustomListsAPI(BaseAPI):
"""
API to operate custom lists.
Expand Down Expand Up @@ -165,7 +165,7 @@ def add_item(
Note:
Calls `POST /custom-lists/{custom_list_uuid}/items`
Args:
list_uuid: UUID of custom list
custom_list_uuid: UUID of custom list
dictionary_item_uuid: Dictionary item UUID
Raises:
:class:`~cybsi.api.error.NotFoundError`: Custom list not found.
Expand All @@ -177,7 +177,7 @@ def add_item(
* :attr:`cybsi.api.error.SemanticErrorCodes.DictionaryItemNotFound`
* :attr:`cybsi.api.error.SemanticErrorCodes.DictionaryMismatch`
"""
params = {"dictionary_item_uuid": dictionary_item_uuid}
params = {"dictionaryItemUUID": str(dictionary_item_uuid)}
path = f"{_PATH}/{custom_list_uuid}/items"
self._connector.do_post(path=path, json=params)

Expand Down Expand Up @@ -231,7 +231,7 @@ def get_related_items(
Semantic error codes specific for this method:
* :attr:`cybsi.api.error.SemanticErrorCodes.DictionaryNotFound`
"""
params: Dict[str, Any] = {"dictionary_uuid": dictionary_uuid}
params: Dict[str, Any] = {"dictionaryUUID": str(dictionary_uuid)}
if cursor:
params["cursor"] = cursor
if limit:
Expand Down Expand Up @@ -413,7 +413,7 @@ async def add_item(
* :attr:`cybsi.api.error.SemanticErrorCodes.DictionaryItemNotFound`
* :attr:`cybsi.api.error.SemanticErrorCodes.DictionaryMismatch`
"""
params = {"dictionary_item_uuid": dictionary_item_uuid}
params = {"dictionaryItemUUID": dictionary_item_uuid}
path = f"{_PATH}/{custom_list_uuid}/items"
await self._connector.do_post(path=path, json=params)

Expand Down Expand Up @@ -467,7 +467,7 @@ async def get_related_items(
Semantic error codes specific for this method:
* :attr:`cybsi.api.error.SemanticErrorCodes.DictionaryNotFound`
"""
params: Dict[str, Any] = {"dictionary_uuid": dictionary_uuid}
params: Dict[str, Any] = {"dictionaryUUID": str(dictionary_uuid)}
if cursor:
params["cursor"] = cursor
if limit:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
ThreatLandscapesAsyncAPI,
ThreatLandscapeCommonView,
ThreatLandscapeView,
ThreatLanscapeForm,
ThreatLandscapeForm,
ThreatLandscapesCustomListView,
)
)
Loading

0 comments on commit 0fb6d80

Please sign in to comment.