Skip to content

Commit 40de9d5

Browse files
he2ssgithub-actions[bot]
authored andcommitted
Update python SDK 1.87.2
1 parent b8b182c commit 40de9d5

File tree

18 files changed

+216
-224
lines changed

18 files changed

+216
-224
lines changed

crowdsec_service_api/__init__.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,15 @@ class Server(Enum):
2424
'AllowlistCreateRequest',
2525
'AllowlistCreateResponse',
2626
'AllowlistGetItemsResponse',
27+
'AllowlistGetItemsResponsePage',
2728
'AllowlistGetResponse',
29+
'AllowlistGetResponsePage',
2830
'AllowlistItemUpdateRequest',
2931
'AllowlistItemUpdateResponse',
3032
'AllowlistItemsCreateRequest',
3133
'AllowlistScope',
3234
'AllowlistSubscriberEntity',
35+
'AllowlistSubscriberEntityPage',
3336
'AllowlistSubscribersCount',
3437
'AllowlistSubscriptionRequest',
3538
'AllowlistSubscriptionResponse',
@@ -50,6 +53,7 @@ class Server(Enum):
5053
'BlocklistSources',
5154
'BlocklistStats',
5255
'BlocklistSubscriberEntity',
56+
'BlocklistSubscriberEntityPage',
5357
'BlocklistSubscribersCount',
5458
'BlocklistSubscription',
5559
'BlocklistSubscriptionRequest',
@@ -72,23 +76,18 @@ class Server(Enum):
7276
'IntegrationCreateRequest',
7377
'IntegrationCreateResponse',
7478
'IntegrationGetResponse',
79+
'IntegrationGetResponsePage',
7580
'IntegrationType',
7681
'IntegrationUpdateRequest',
7782
'IntegrationUpdateResponse',
7883
'Links',
7984
'MetricUnits',
8085
'OriginMetrics',
8186
'OutputFormat',
82-
'PageTAnyCustomizedAllowlistGetItemsResponse',
83-
'PageTAnyCustomizedAllowlistGetResponse',
84-
'PageTAnyCustomizedAllowlistSubscriberEntity',
85-
'PageTAnyCustomizedBlocklistSubscriberEntity',
86-
'PageTAnyCustomizedIntegrationGetResponse',
87-
'PageTAnyCustomizedPublicBlocklistResponse',
8887
'Permission',
8988
'PricingTiers',
9089
'PublicBlocklistResponse',
91-
'PublicPaginatedBlocklistResponse',
90+
'PublicBlocklistResponsePage',
9291
'RawMetrics',
9392
'RemediationMetrics',
9493
'RemediationMetricsData',
@@ -112,12 +111,12 @@ class Server(Enum):
112111
'Behavior',
113112
'Classification',
114113
'Classifications',
114+
'GetCVEIPsResponsePage',
115115
'GetCVEResponse',
116116
'History',
117117
'IPItem',
118118
'Location',
119119
'MitreTechnique',
120-
'PageTypeVarCustomizedIPItem',
121120
'Reference',
122121
'ScoreBreakdown',
123122
'Scores',
0 Bytes
Binary file not shown.
94 Bytes
Binary file not shown.

crowdsec_service_api/http_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def _replace_path_params(self, url: str, path_params: dict):
6363
return url
6464

6565
def _normalize_url(self, url: str):
66+
self.base_url = self.base_url.rstrip("/")
6667
parsed_url = urlparse(url)
6768
if not parsed_url.netloc:
6869
return f"{self.base_url}{url}"

crowdsec_service_api/models.py

Lines changed: 72 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: <stdin>
3-
# timestamp: 2025-12-02T11:13:39+00:00
3+
# timestamp: 2025-12-02T14:56:05+00:00
44

55
from __future__ import annotations
66

@@ -832,6 +832,15 @@ class BlocklistsGetBlocklistsQueryParameters(BaseModelSdk):
832832
] = 50
833833

834834

835+
class BlocklistsSearchBlocklistQueryParameters(BaseModelSdk):
836+
page: Annotated[
837+
Optional[int], Field(description='Page number', ge=1, title='Page')
838+
] = 1
839+
size: Annotated[
840+
Optional[int], Field(description='Page size', ge=1, le=100, title='Size')
841+
] = 50
842+
843+
835844
class BlocklistsGetBlocklistPathParameters(BaseModelSdk):
836845
blocklist_id: Annotated[
837846
str, Field(examples=['5f9d88b9e5c4f5b9a3d3e8b1'], title='Blocklist Id')
@@ -865,7 +874,7 @@ class BlocklistsUploadBlocklistContentQueryParameters(BaseModelSdk):
865874
Optional[AwareDatetime],
866875
Field(
867876
description='Blocklist expiration',
868-
examples='2025-12-02T11:13:31.099008+00:00',
877+
examples='2025-12-02T14:55:58.773978+00:00',
869878
title='Expiration',
870879
),
871880
] = None
@@ -1154,6 +1163,15 @@ class AllowlistSubscriberEntity(BaseModelSdk):
11541163
entity_type: SubscriberEntityType
11551164

11561165

1166+
class AllowlistSubscriberEntityPage(BaseModelSdk):
1167+
items: Annotated[List[AllowlistSubscriberEntity], Field(title='Items')]
1168+
total: Annotated[int, Field(ge=0, title='Total')]
1169+
page: Annotated[int, Field(ge=1, title='Page')]
1170+
size: Annotated[int, Field(ge=1, title='Size')]
1171+
pages: Annotated[int, Field(ge=0, title='Pages')]
1172+
links: Links
1173+
1174+
11571175
class AllowlistSubscribersCount(BaseModelSdk):
11581176
entity_type: Annotated[
11591177
SubscriberEntityType, Field(description='Subscriber entity type')
@@ -1389,6 +1407,15 @@ class BlocklistSubscriberEntity(BaseModelSdk):
13891407
remediation: Annotated[str, Field(description='Remediation', title='Remediation')]
13901408

13911409

1410+
class BlocklistSubscriberEntityPage(BaseModelSdk):
1411+
items: Annotated[List[BlocklistSubscriberEntity], Field(title='Items')]
1412+
total: Annotated[int, Field(ge=0, title='Total')]
1413+
page: Annotated[int, Field(ge=1, title='Page')]
1414+
size: Annotated[int, Field(ge=1, title='Size')]
1415+
pages: Annotated[int, Field(ge=0, title='Pages')]
1416+
links: Links
1417+
1418+
13921419
class BlocklistSubscribersCount(BaseModelSdk):
13931420
entity_type: Annotated[
13941421
SubscriberEntityType, Field(description='Subscriber entity type')
@@ -1562,6 +1589,15 @@ class IntegrationGetResponse(BaseModelSdk):
15621589
] = []
15631590

15641591

1592+
class IntegrationGetResponsePage(BaseModelSdk):
1593+
items: Annotated[List[IntegrationGetResponse], Field(title='Items')]
1594+
total: Annotated[int, Field(ge=0, title='Total')]
1595+
page: Annotated[int, Field(ge=1, title='Page')]
1596+
size: Annotated[int, Field(ge=1, title='Size')]
1597+
pages: Annotated[int, Field(ge=0, title='Pages')]
1598+
links: Links
1599+
1600+
15651601
class IntegrationUpdateRequest(BaseModelSdk):
15661602
model_config = ConfigDict(
15671603
extra='forbid',
@@ -1658,33 +1694,6 @@ class OriginMetrics(BaseModelSdk):
16581694
]
16591695

16601696

1661-
class PageTAnyCustomizedAllowlistSubscriberEntity(BaseModelSdk):
1662-
items: Annotated[List[AllowlistSubscriberEntity], Field(title='Items')]
1663-
total: Annotated[int, Field(ge=0, title='Total')]
1664-
page: Annotated[int, Field(ge=1, title='Page')]
1665-
size: Annotated[int, Field(ge=1, title='Size')]
1666-
pages: Annotated[int, Field(ge=0, title='Pages')]
1667-
links: Links
1668-
1669-
1670-
class PageTAnyCustomizedBlocklistSubscriberEntity(BaseModelSdk):
1671-
items: Annotated[List[BlocklistSubscriberEntity], Field(title='Items')]
1672-
total: Annotated[int, Field(ge=0, title='Total')]
1673-
page: Annotated[int, Field(ge=1, title='Page')]
1674-
size: Annotated[int, Field(ge=1, title='Size')]
1675-
pages: Annotated[int, Field(ge=0, title='Pages')]
1676-
links: Links
1677-
1678-
1679-
class PageTAnyCustomizedIntegrationGetResponse(BaseModelSdk):
1680-
items: Annotated[List[IntegrationGetResponse], Field(title='Items')]
1681-
total: Annotated[int, Field(ge=0, title='Total')]
1682-
page: Annotated[int, Field(ge=1, title='Page')]
1683-
size: Annotated[int, Field(ge=1, title='Size')]
1684-
pages: Annotated[int, Field(ge=0, title='Pages')]
1685-
links: Links
1686-
1687-
16881697
class PublicBlocklistResponse(BaseModelSdk):
16891698
id: Annotated[str, Field(description='Blocklist id', title='Id')]
16901699
created_at: Annotated[
@@ -1761,17 +1770,13 @@ class PublicBlocklistResponse(BaseModelSdk):
17611770
] = []
17621771

17631772

1764-
class PublicPaginatedBlocklistResponse(BaseModelSdk):
1765-
items: Annotated[
1766-
List[PublicBlocklistResponse],
1767-
Field(description='List of blocklists', title='Items'),
1768-
]
1769-
page: Annotated[int, Field(description='Page number', title='Page')]
1770-
total: Annotated[
1771-
int, Field(description='Total number of blocklists', title='Total')
1772-
]
1773-
size: Annotated[int, Field(description='Page size', title='Size')]
1774-
pages: Annotated[int, Field(description='Total number of pages', title='Pages')]
1773+
class PublicBlocklistResponsePage(BaseModelSdk):
1774+
items: Annotated[List[PublicBlocklistResponse], Field(title='Items')]
1775+
total: Annotated[int, Field(ge=0, title='Total')]
1776+
page: Annotated[int, Field(ge=1, title='Page')]
1777+
size: Annotated[int, Field(ge=1, title='Size')]
1778+
pages: Annotated[int, Field(ge=0, title='Pages')]
1779+
links: Links
17751780

17761781

17771782
class RemediationMetrics(BaseModelSdk):
@@ -2470,15 +2475,6 @@ class IPItem(BaseModelSdk):
24702475
scores: Annotated[Optional[Scores], Field(description='Scoring information')] = None
24712476

24722477

2473-
class PageTypeVarCustomizedIPItem(BaseModelSdk):
2474-
items: Annotated[List[IPItem], Field(title='Items')]
2475-
total: Annotated[int, Field(ge=0, title='Total')]
2476-
page: Annotated[int, Field(ge=1, title='Page')]
2477-
size: Annotated[int, Field(ge=1, title='Size')]
2478-
pages: Annotated[int, Field(ge=0, title='Pages')]
2479-
links: Links
2480-
2481-
24822478
class AllowlistGetItemsResponse(BaseModelSdk):
24832479
id: Annotated[
24842480
str,
@@ -2529,6 +2525,15 @@ class AllowlistGetItemsResponse(BaseModelSdk):
25292525
] = None
25302526

25312527

2528+
class AllowlistGetItemsResponsePage(BaseModelSdk):
2529+
items: Annotated[List[AllowlistGetItemsResponse], Field(title='Items')]
2530+
total: Annotated[int, Field(ge=0, title='Total')]
2531+
page: Annotated[int, Field(ge=1, title='Page')]
2532+
size: Annotated[int, Field(ge=1, title='Size')]
2533+
pages: Annotated[int, Field(ge=0, title='Pages')]
2534+
links: Links
2535+
2536+
25322537
class AllowlistGetResponse(BaseModelSdk):
25332538
id: Annotated[
25342539
str,
@@ -2579,6 +2584,15 @@ class AllowlistGetResponse(BaseModelSdk):
25792584
] = []
25802585

25812586

2587+
class AllowlistGetResponsePage(BaseModelSdk):
2588+
items: Annotated[List[AllowlistGetResponse], Field(title='Items')]
2589+
total: Annotated[int, Field(ge=0, title='Total')]
2590+
page: Annotated[int, Field(ge=1, title='Page')]
2591+
size: Annotated[int, Field(ge=1, title='Size')]
2592+
pages: Annotated[int, Field(ge=0, title='Pages')]
2593+
links: Links
2594+
2595+
25822596
class AllowlistItemUpdateResponse(BaseModelSdk):
25832597
id: Annotated[
25842598
str,
@@ -2643,33 +2657,6 @@ class ComputedSavedMetrics(BaseModelSdk):
26432657
] = []
26442658

26452659

2646-
class PageTAnyCustomizedAllowlistGetItemsResponse(BaseModelSdk):
2647-
items: Annotated[List[AllowlistGetItemsResponse], Field(title='Items')]
2648-
total: Annotated[int, Field(ge=0, title='Total')]
2649-
page: Annotated[int, Field(ge=1, title='Page')]
2650-
size: Annotated[int, Field(ge=1, title='Size')]
2651-
pages: Annotated[int, Field(ge=0, title='Pages')]
2652-
links: Links
2653-
2654-
2655-
class PageTAnyCustomizedAllowlistGetResponse(BaseModelSdk):
2656-
items: Annotated[List[AllowlistGetResponse], Field(title='Items')]
2657-
total: Annotated[int, Field(ge=0, title='Total')]
2658-
page: Annotated[int, Field(ge=1, title='Page')]
2659-
size: Annotated[int, Field(ge=1, title='Size')]
2660-
pages: Annotated[int, Field(ge=0, title='Pages')]
2661-
links: Links
2662-
2663-
2664-
class PageTAnyCustomizedPublicBlocklistResponse(BaseModelSdk):
2665-
items: Annotated[List[PublicBlocklistResponse], Field(title='Items')]
2666-
total: Annotated[int, Field(ge=0, title='Total')]
2667-
page: Annotated[int, Field(ge=1, title='Page')]
2668-
size: Annotated[int, Field(ge=1, title='Size')]
2669-
pages: Annotated[int, Field(ge=0, title='Pages')]
2670-
links: Links
2671-
2672-
26732660
class RawMetrics(BaseModelSdk):
26742661
dropped: Annotated[
26752662
Optional[List[RemediationMetrics]],
@@ -2705,6 +2692,15 @@ class Index(BaseModelSdk):
27052692
] = None
27062693

27072694

2695+
class GetCVEIPsResponsePage(BaseModelSdk):
2696+
items: Annotated[List[IPItem], Field(title='Items')]
2697+
total: Annotated[int, Field(ge=0, title='Total')]
2698+
page: Annotated[int, Field(ge=1, title='Page')]
2699+
size: Annotated[int, Field(ge=1, title='Size')]
2700+
pages: Annotated[int, Field(ge=0, title='Pages')]
2701+
links: Links
2702+
2703+
27082704
class ComputedMetrics(BaseModelSdk):
27092705
saved: Annotated[ComputedSavedMetrics, Field(description='estimated saved metrics')]
27102706
dropped: Annotated[
Binary file not shown.

crowdsec_service_api/services/allowlists.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def list_allowlists(
1515
self,
1616
page: int = 1,
1717
size: int = 50,
18-
)-> Page[AllowlistGetResponse]:
18+
)-> AllowlistGetResponsePage:
1919
endpoint_url = "/allowlists"
2020
loc = locals()
2121
headers = {}
@@ -30,7 +30,7 @@ def list_allowlists(
3030
url=endpoint_url, path_params=path_params, params=params, headers=headers
3131
)
3232

33-
return Page[AllowlistGetResponse](_client=self, **response.json())
33+
return AllowlistGetResponsePage(**response.json())
3434

3535
def create_allowlist(
3636
self,
@@ -128,7 +128,7 @@ def get_allowlist_items(
128128
allowlist_id: str,
129129
page: int = 1,
130130
size: int = 50,
131-
)-> Page[AllowlistGetItemsResponse]:
131+
)-> AllowlistGetItemsResponsePage:
132132
endpoint_url = "/allowlists/{allowlist_id}/items"
133133
loc = locals()
134134
headers = {}
@@ -147,7 +147,7 @@ def get_allowlist_items(
147147
url=endpoint_url, path_params=path_params, params=params, headers=headers
148148
)
149149

150-
return Page[AllowlistGetItemsResponse](_client=self, **response.json())
150+
return AllowlistGetItemsResponsePage(**response.json())
151151

152152
def create_allowlist_items(
153153
self,
@@ -248,7 +248,7 @@ def get_allowlist_subscribers(
248248
allowlist_id: str,
249249
page: int = 1,
250250
size: int = 50,
251-
)-> Page[AllowlistSubscriberEntity]:
251+
)-> AllowlistSubscriberEntityPage:
252252
endpoint_url = "/allowlists/{allowlist_id}/subscribers"
253253
loc = locals()
254254
headers = {}
@@ -267,7 +267,7 @@ def get_allowlist_subscribers(
267267
url=endpoint_url, path_params=path_params, params=params, headers=headers
268268
)
269269

270-
return Page[AllowlistSubscriberEntity](_client=self, **response.json())
270+
return AllowlistSubscriberEntityPage(**response.json())
271271

272272
def subscribe_allowlist(
273273
self,

0 commit comments

Comments
 (0)