Skip to content

Commit 1d430f8

Browse files
authored
Merge pull request #52
add sitx endpoint
2 parents 35bb83b + fd61d29 commit 1d430f8

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "vulners"
3-
version = "3.1.3"
3+
version = "3.1.4"
44
description = "Python library and command-line utility for Vulners (https://vulners.com)"
55
readme = "README.md"
66
authors = ["Vulners Team"]

vulners/vulners/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from .misc import MiscApi
88
from .report import ReportApi
99
from .search import SearchApi
10+
from .stix import StixApi
1011
from .subscription import SubscriptionApi
1112
from .subscription_v4 import SubscriptionV4Api
1213
from .webhook import WebhookApi
@@ -17,6 +18,10 @@ class VulnersApi(VulnersApiBase):
1718
def search(self) -> SearchApi:
1819
return SearchApi(self)
1920

21+
@cached_property
22+
def stix(self) -> StixApi:
23+
return StixApi(self)
24+
2025
@deprecated(
2126
"VulnersApi.find() is deprecated and will be removed in future releases.\n"
2227
"Use VulnersApi.search.search_bulletins() instead."

vulners/vulners/stix.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from typing import Annotated
2+
3+
from pydantic import Field
4+
5+
from ..base import Unset, VulnersApiProxy, endpoint
6+
7+
8+
class StixApi(VulnersApiProxy):
9+
make_bundle_by_id = endpoint(
10+
"StixApi.bundle",
11+
description="Make bundle of STIX objects for the given bulletin ID",
12+
method="GET",
13+
url="/api/v4/stix/bundle",
14+
params={
15+
"id": Annotated[str, Field(description="Bulletin ID")],
16+
"opencti_id": Annotated[
17+
str | None,
18+
Field(default=None, description="Existing OpenCTI object ID"),
19+
],
20+
},
21+
response_handler=lambda resp: resp["result"],
22+
)

0 commit comments

Comments
 (0)