Skip to content

Commit b7d6bee

Browse files
nitescucgithub-actions[bot]
authored andcommitted
Update python SDK 1.116.0
1 parent 4a44fef commit b7d6bee

File tree

18 files changed

+232
-53
lines changed

18 files changed

+232
-53
lines changed

crowdsec_tracker_api/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,15 @@ class Server(Enum):
4141
'AllowlistSubscription',
4242
'AttackDetail',
4343
'Behavior',
44-
'CVEEvent',
44+
'CVEEventOutput',
4545
'CVEResponseBase',
4646
'CVEsubscription',
4747
'CWE',
4848
'Classification',
4949
'Classifications',
5050
'EntityType',
5151
'ExploitationPhase',
52+
'FingerprintEventOutput',
5253
'FingerprintRuleResponse',
5354
'FingerprintRuleSummary',
5455
'FingerprintTimelineItem',
@@ -70,8 +71,8 @@ class Server(Enum):
7071
'LookupImpactCVEItem',
7172
'LookupImpactFingerprintItem',
7273
'LookupImpactResponsePage',
73-
'LookupListItem',
74-
'LookupListResponsePage',
74+
'LookupListItemWithStats',
75+
'LookupListWithStatsResponsePage',
7576
'MitreTechnique',
7677
'Reference',
7778
'ScoreBreakdown',
@@ -80,6 +81,8 @@ class Server(Enum):
8081
'SubscribeCVEIntegrationRequest',
8182
'SubscribeFingerprintIntegrationRequest',
8283
'TimelineItem',
84+
'TopProductItem',
85+
'VendorStatsResponse',
8386
'ApiKeyAuth',
8487
'Server',
8588
'Page'
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

crowdsec_tracker_api/models.py

Lines changed: 90 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: <stdin>
3-
# timestamp: 2026-02-24T17:00:06+00:00
3+
# timestamp: 2026-03-18T08:48:04+00:00
44

55
from __future__ import annotations
66

@@ -142,13 +142,12 @@ class Behavior(BaseModelSdk):
142142
]
143143

144144

145-
class CVEEvent(BaseModelSdk):
146-
date: Annotated[datetime, Field(description='Date of the event', title='Date')]
147-
description: Annotated[
148-
str, Field(description='Description of the event', title='Description')
149-
]
150-
label: Annotated[str, Field(description='Label of the event', title='Label')]
151-
name: Annotated[str, Field(description='Name of the event', title='Name')]
145+
class CVEEventOutput(BaseModelSdk):
146+
name: Annotated[str, Field(title='Name')]
147+
date: Annotated[str, Field(title='Date')]
148+
description: Annotated[str, Field(title='Description')]
149+
label: Annotated[str, Field(title='Label')]
150+
sorting_priority: Annotated[int, Field(title='Sorting Priority')]
152151

153152

154153
class CvssScore(RootModelSdk[float]):
@@ -212,6 +211,13 @@ class ExploitationPhase(BaseModelSdk):
212211
]
213212

214213

214+
class FingerprintEventOutput(BaseModelSdk):
215+
name: Annotated[str, Field(title='Name')]
216+
date: Annotated[str, Field(title='Date')]
217+
description: Annotated[str, Field(title='Description')]
218+
label: Annotated[str, Field(title='Label')]
219+
220+
215221
class FingerprintRuleResponse(BaseModelSdk):
216222
id: Annotated[str, Field(description='Fingerprint rule identifier', title='Id')]
217223
name: Annotated[str, Field(description='Fingerprint rule name', title='Name')]
@@ -290,7 +296,7 @@ class FingerprintRuleResponse(BaseModelSdk):
290296
),
291297
] = None
292298
events: Annotated[
293-
Optional[List[CVEEvent]],
299+
Optional[List[FingerprintEventOutput]],
294300
Field(
295301
description='List of events related to the fingerprint rule', title='Events'
296302
),
@@ -459,7 +465,7 @@ class GetCVEResponse(BaseModelSdk):
459465
Field(description='List of CWEs associated with the CVE', title='Cwes'),
460466
]
461467
events: Annotated[
462-
Optional[List[CVEEvent]],
468+
Optional[List[CVEEventOutput]],
463469
Field(description='List of events related to the CVE', title='Events'),
464470
] = None
465471

@@ -674,7 +680,7 @@ class LookupImpactCVEItem(BaseModelSdk):
674680
Field(description='List of CWEs associated with the CVE', title='Cwes'),
675681
]
676682
events: Annotated[
677-
Optional[List[CVEEvent]],
683+
Optional[List[CVEEventOutput]],
678684
Field(description='List of events related to the CVE', title='Events'),
679685
] = None
680686
type: Annotated[
@@ -760,7 +766,7 @@ class LookupImpactFingerprintItem(BaseModelSdk):
760766
),
761767
] = None
762768
events: Annotated[
763-
Optional[List[CVEEvent]],
769+
Optional[List[FingerprintEventOutput]],
764770
Field(
765771
description='List of events related to the fingerprint rule', title='Events'
766772
),
@@ -786,12 +792,31 @@ class LookupImpactResponsePage(BaseModelSdk):
786792
links: Links
787793

788794

789-
class LookupListItem(BaseModelSdk):
795+
class LookupListItemWithStats(BaseModelSdk):
790796
value: Annotated[str, Field(description='Lookup entry value', title='Value')]
797+
nb_cves: Annotated[
798+
Optional[int], Field(description='Number of CVEs', ge=0, title='Nb Cves')
799+
] = 0
800+
nb_fingerprints: Annotated[
801+
Optional[int],
802+
Field(description='Number of fingerprint rules', ge=0, title='Nb Fingerprints'),
803+
] = 0
804+
nb_ips_cves: Annotated[
805+
Optional[int],
806+
Field(description='Number of IPs across CVEs', ge=0, title='Nb Ips Cves'),
807+
] = 0
808+
nb_ips_fingerprints: Annotated[
809+
Optional[int],
810+
Field(
811+
description='Number of IPs across fingerprint rules',
812+
ge=0,
813+
title='Nb Ips Fingerprints',
814+
),
815+
] = 0
791816

792817

793-
class LookupListResponsePage(BaseModelSdk):
794-
items: Annotated[List[LookupListItem], Field(title='Items')]
818+
class LookupListWithStatsResponsePage(BaseModelSdk):
819+
items: Annotated[List[LookupListItemWithStats], Field(title='Items')]
795820
total: Annotated[int, Field(ge=0, title='Total')]
796821
page: Annotated[int, Field(ge=1, title='Page')]
797822
size: Annotated[int, Field(ge=1, title='Size')]
@@ -866,6 +891,52 @@ class TimelineItem(BaseModelSdk):
866891
]
867892

868893

894+
class TopProductItem(BaseModelSdk):
895+
value: Annotated[str, Field(description='Product name', title='Value')]
896+
nb_ips_cves: Annotated[
897+
Optional[int],
898+
Field(description='Number of IPs across CVEs', ge=0, title='Nb Ips Cves'),
899+
] = 0
900+
nb_ips_fingerprints: Annotated[
901+
Optional[int],
902+
Field(
903+
description='Number of IPs across fingerprint rules',
904+
ge=0,
905+
title='Nb Ips Fingerprints',
906+
),
907+
] = 0
908+
909+
910+
class VendorStatsResponse(BaseModelSdk):
911+
value: Annotated[str, Field(description='Vendor name', title='Value')]
912+
nb_cves: Annotated[
913+
Optional[int], Field(description='Number of CVEs', ge=0, title='Nb Cves')
914+
] = 0
915+
nb_fingerprints: Annotated[
916+
Optional[int],
917+
Field(description='Number of fingerprint rules', ge=0, title='Nb Fingerprints'),
918+
] = 0
919+
nb_ips_cves: Annotated[
920+
Optional[int],
921+
Field(description='Number of IPs across CVEs', ge=0, title='Nb Ips Cves'),
922+
] = 0
923+
nb_ips_fingerprints: Annotated[
924+
Optional[int],
925+
Field(
926+
description='Number of IPs across fingerprint rules',
927+
ge=0,
928+
title='Nb Ips Fingerprints',
929+
),
930+
] = 0
931+
top_products: Annotated[
932+
Optional[List[TopProductItem]],
933+
Field(
934+
description='Top products for this vendor sorted by total IPs descending',
935+
title='Top Products',
936+
),
937+
] = None
938+
939+
869940
class IntegrationsGetIntegrationsQueryParameters(BaseModelSdk):
870941
tag: Annotated[
871942
Optional[List[str]],
@@ -1063,6 +1134,10 @@ class VendorsGetVendorsQueryParameters(BaseModelSdk):
10631134
] = 50
10641135

10651136

1137+
class VendorsGetVendorStatsPathParameters(BaseModelSdk):
1138+
vendor: Annotated[str, Field(title='Vendor')]
1139+
1140+
10661141
class VendorsGetVendorImpactQueryParameters(BaseModelSdk):
10671142
sort_by: Annotated[
10681143
Optional[GetCVEsSortBy], Field(description='Field to sort by', title='Sort By')
Binary file not shown.

crowdsec_tracker_api/services/cves.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
class Cves(Service):
1313
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
14-
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_tracker_api/1.108.1")
14+
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_tracker_api/1.116.0")
1515

1616
def get_cves(
1717
self,

crowdsec_tracker_api/services/fingerprints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
class Fingerprints(Service):
1313
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
14-
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_tracker_api/1.108.1")
14+
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_tracker_api/1.116.0")
1515

1616
def get_fingerprint_rules(
1717
self,

crowdsec_tracker_api/services/integrations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
class Integrations(Service):
1313
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
14-
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_tracker_api/1.108.1")
14+
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_tracker_api/1.116.0")
1515

1616
def get_integrations(
1717
self,

crowdsec_tracker_api/services/products.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111

1212
class Products(Service):
1313
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
14-
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_tracker_api/1.108.1")
14+
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_tracker_api/1.116.0")
1515

1616
def get_products(
1717
self,
1818
query: Optional[str] = None,
1919
page: int = 1,
2020
size: int = 50,
21-
)-> LookupListResponsePage:
21+
)-> LookupListWithStatsResponsePage:
2222
endpoint_url = "/products"
2323
loc = locals()
2424
headers = {}
@@ -33,7 +33,7 @@ def get_products(
3333
url=endpoint_url, path_params=path_params, params=params, headers=headers
3434
)
3535

36-
return LookupListResponsePage(_client=self, **response.json())
36+
return LookupListWithStatsResponsePage(_client=self, **response.json())
3737

3838
def get_product_impact(
3939
self,

crowdsec_tracker_api/services/tags.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111

1212
class Tags(Service):
1313
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
14-
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_tracker_api/1.108.1")
14+
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_tracker_api/1.116.0")
1515

1616
def get_tags(
1717
self,
1818
query: Optional[str] = None,
1919
page: int = 1,
2020
size: int = 50,
21-
)-> LookupListResponsePage:
21+
)-> LookupListWithStatsResponsePage:
2222
endpoint_url = "/tags"
2323
loc = locals()
2424
headers = {}
@@ -33,7 +33,7 @@ def get_tags(
3333
url=endpoint_url, path_params=path_params, params=params, headers=headers
3434
)
3535

36-
return LookupListResponsePage(_client=self, **response.json())
36+
return LookupListWithStatsResponsePage(_client=self, **response.json())
3737

3838
def get_tag_impact(
3939
self,

0 commit comments

Comments
 (0)