crowdsec-tracker-api 1.92.0__py3-none-any.whl → 1.95.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- crowdsec_tracker_api/base_model.py +4 -2
- crowdsec_tracker_api/http_client.py +11 -2
- crowdsec_tracker_api/models.py +21 -23
- crowdsec_tracker_api/services/cves.py +2 -2
- crowdsec_tracker_api/services/integrations.py +9 -4
- {crowdsec_tracker_api-1.92.0.dist-info → crowdsec_tracker_api-1.95.0.dist-info}/METADATA +1 -1
- crowdsec_tracker_api-1.95.0.dist-info/RECORD +12 -0
- crowdsec_tracker_api-1.92.0.dist-info/RECORD +0 -12
- {crowdsec_tracker_api-1.92.0.dist-info → crowdsec_tracker_api-1.95.0.dist-info}/WHEEL +0 -0
- {crowdsec_tracker_api-1.92.0.dist-info → crowdsec_tracker_api-1.95.0.dist-info}/licenses/LICENSE +0 -0
- {crowdsec_tracker_api-1.92.0.dist-info → crowdsec_tracker_api-1.95.0.dist-info}/top_level.txt +0 -0
|
@@ -37,8 +37,10 @@ class Page(BaseModelSdk, Generic[T]):
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
class Service:
|
|
40
|
-
def __init__(self, base_url: str, auth: Auth) -> None:
|
|
41
|
-
self.http_client = HttpClient(
|
|
40
|
+
def __init__(self, base_url: str, auth: Auth, user_agent: str = None) -> None:
|
|
41
|
+
self.http_client = HttpClient(
|
|
42
|
+
base_url=base_url, auth=auth, user_agent=user_agent
|
|
43
|
+
)
|
|
42
44
|
|
|
43
45
|
def next_page(self, page: BaseModelSdk) -> Optional[BaseModelSdk]:
|
|
44
46
|
if not hasattr(page, "links") or not page.links:
|
|
@@ -45,11 +45,20 @@ class ApiKeyAuth(httpx.Auth):
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
class HttpClient:
|
|
48
|
-
def __init__(
|
|
48
|
+
def __init__(
|
|
49
|
+
self,
|
|
50
|
+
base_url: str,
|
|
51
|
+
auth: httpx.Auth,
|
|
52
|
+
user_agent: str = None,
|
|
53
|
+
aws_region="eu-west-1",
|
|
54
|
+
) -> None:
|
|
49
55
|
self.aws_region = aws_region
|
|
50
56
|
self.base_url = base_url
|
|
51
57
|
self.auth = auth
|
|
52
|
-
|
|
58
|
+
headers = {"Accept-Encoding": "gzip"}
|
|
59
|
+
if user_agent:
|
|
60
|
+
headers["User-Agent"] = user_agent
|
|
61
|
+
self.client = httpx.Client(headers=headers)
|
|
53
62
|
self.timeout = 30
|
|
54
63
|
|
|
55
64
|
def _replace_path_params(self, url: str, path_params: dict):
|
crowdsec_tracker_api/models.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# generated by datamodel-codegen:
|
|
2
2
|
# filename: <stdin>
|
|
3
|
-
# timestamp: 2025-12-
|
|
3
|
+
# timestamp: 2025-12-31T15:56:47+00:00
|
|
4
4
|
|
|
5
5
|
from __future__ import annotations
|
|
6
6
|
|
|
@@ -445,6 +445,16 @@ class IntegrationsUpdateIntegrationPathParameters(BaseModelSdk):
|
|
|
445
445
|
integration_id: Annotated[str, Field(title='Integration Id')]
|
|
446
446
|
|
|
447
447
|
|
|
448
|
+
class IntegrationsDeleteIntegrationQueryParameters(BaseModelSdk):
|
|
449
|
+
force: Annotated[
|
|
450
|
+
Optional[bool],
|
|
451
|
+
Field(
|
|
452
|
+
description='Force delete the integration even if it has active subscriptions (it will unsubscribe from all lists)',
|
|
453
|
+
title='Force',
|
|
454
|
+
),
|
|
455
|
+
] = False
|
|
456
|
+
|
|
457
|
+
|
|
448
458
|
class IntegrationsDeleteIntegrationPathParameters(BaseModelSdk):
|
|
449
459
|
integration_id: Annotated[str, Field(title='Integration Id')]
|
|
450
460
|
|
|
@@ -546,7 +556,7 @@ class CvesGetCveIpsDetailsQueryParameters(BaseModelSdk):
|
|
|
546
556
|
description='Filter IPs seen since this date, format duration (e.g., 7d, 24h), default to 14d',
|
|
547
557
|
title='Since',
|
|
548
558
|
),
|
|
549
|
-
] =
|
|
559
|
+
] = '14d'
|
|
550
560
|
page: Annotated[
|
|
551
561
|
Optional[int], Field(description='Page number', ge=1, title='Page')
|
|
552
562
|
] = 1
|
|
@@ -662,13 +672,9 @@ class IntegrationCreateResponse(BaseModelSdk):
|
|
|
662
672
|
title='Endpoint',
|
|
663
673
|
),
|
|
664
674
|
]
|
|
665
|
-
stats: Annotated[
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
default_factory=lambda: Stats.model_validate({'count': 0}),
|
|
669
|
-
description='Stats of the integration',
|
|
670
|
-
),
|
|
671
|
-
]
|
|
675
|
+
stats: Annotated[Optional[Stats], Field(description='Stats of the integration')] = {
|
|
676
|
+
'count': 0
|
|
677
|
+
}
|
|
672
678
|
tags: Annotated[
|
|
673
679
|
Optional[List[str]],
|
|
674
680
|
Field(description='Tags associated with the integration', title='Tags'),
|
|
@@ -736,13 +742,9 @@ class IntegrationGetResponse(BaseModelSdk):
|
|
|
736
742
|
title='Endpoint',
|
|
737
743
|
),
|
|
738
744
|
]
|
|
739
|
-
stats: Annotated[
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
default_factory=lambda: Stats.model_validate({'count': 0}),
|
|
743
|
-
description='Stats of the integration',
|
|
744
|
-
),
|
|
745
|
-
]
|
|
745
|
+
stats: Annotated[Optional[Stats], Field(description='Stats of the integration')] = {
|
|
746
|
+
'count': 0
|
|
747
|
+
}
|
|
746
748
|
tags: Annotated[
|
|
747
749
|
Optional[List[str]],
|
|
748
750
|
Field(description='Tags associated with the integration', title='Tags'),
|
|
@@ -835,13 +837,9 @@ class IntegrationUpdateResponse(BaseModelSdk):
|
|
|
835
837
|
title='Endpoint',
|
|
836
838
|
),
|
|
837
839
|
]
|
|
838
|
-
stats: Annotated[
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
default_factory=lambda: Stats.model_validate({'count': 0}),
|
|
842
|
-
description='Stats of the integration',
|
|
843
|
-
),
|
|
844
|
-
]
|
|
840
|
+
stats: Annotated[Optional[Stats], Field(description='Stats of the integration')] = {
|
|
841
|
+
'count': 0
|
|
842
|
+
}
|
|
845
843
|
tags: Annotated[
|
|
846
844
|
Optional[List[str]],
|
|
847
845
|
Field(description='Tags associated with the integration', title='Tags'),
|
|
@@ -11,7 +11,7 @@ from ..http_client import HttpClient
|
|
|
11
11
|
|
|
12
12
|
class Cves(Service):
|
|
13
13
|
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
|
|
14
|
-
super().__init__(base_url=base_url, auth=auth)
|
|
14
|
+
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_tracker_api/1.95.0")
|
|
15
15
|
|
|
16
16
|
def get_cves(
|
|
17
17
|
self,
|
|
@@ -21,7 +21,7 @@ class Cves(Service):
|
|
|
21
21
|
page: int = 1,
|
|
22
22
|
size: int = 50,
|
|
23
23
|
)-> GetCVEsResponsePage:
|
|
24
|
-
endpoint_url = "/cves
|
|
24
|
+
endpoint_url = "/cves"
|
|
25
25
|
loc = locals()
|
|
26
26
|
headers = {}
|
|
27
27
|
params = json.loads(
|
|
@@ -11,7 +11,7 @@ from ..http_client import HttpClient
|
|
|
11
11
|
|
|
12
12
|
class Integrations(Service):
|
|
13
13
|
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
|
|
14
|
-
super().__init__(base_url=base_url, auth=auth)
|
|
14
|
+
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_tracker_api/1.95.0")
|
|
15
15
|
|
|
16
16
|
def get_integrations(
|
|
17
17
|
self,
|
|
@@ -77,11 +77,16 @@ class Integrations(Service):
|
|
|
77
77
|
def delete_integration(
|
|
78
78
|
self,
|
|
79
79
|
integration_id: str,
|
|
80
|
+
force: bool = False,
|
|
80
81
|
):
|
|
81
82
|
endpoint_url = "/integrations/{integration_id}"
|
|
82
83
|
loc = locals()
|
|
83
84
|
headers = {}
|
|
84
|
-
params =
|
|
85
|
+
params = json.loads(
|
|
86
|
+
IntegrationsDeleteIntegrationQueryParameters(**loc).model_dump_json(
|
|
87
|
+
exclude_none=True
|
|
88
|
+
)
|
|
89
|
+
)
|
|
85
90
|
path_params = json.loads(
|
|
86
91
|
IntegrationsDeleteIntegrationPathParameters(**loc).model_dump_json(
|
|
87
92
|
exclude_none=True
|
|
@@ -124,7 +129,7 @@ class Integrations(Service):
|
|
|
124
129
|
integration_id: str,
|
|
125
130
|
page: int = 1,
|
|
126
131
|
page_size: Optional[int] = None,
|
|
127
|
-
):
|
|
132
|
+
)-> str:
|
|
128
133
|
endpoint_url = "/integrations/{integration_id}/content"
|
|
129
134
|
loc = locals()
|
|
130
135
|
headers = {}
|
|
@@ -143,7 +148,7 @@ class Integrations(Service):
|
|
|
143
148
|
url=endpoint_url, path_params=path_params, params=params, headers=headers
|
|
144
149
|
)
|
|
145
150
|
|
|
146
|
-
return
|
|
151
|
+
return response.text
|
|
147
152
|
|
|
148
153
|
def get_integration_content_stream(
|
|
149
154
|
self,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
crowdsec_tracker_api/__init__.py,sha256=qVgdTR0nEMf7N9E1vr2W8fushTJNNahUiKRrkKPK5eE,1359
|
|
2
|
+
crowdsec_tracker_api/base_model.py,sha256=z6dOHObB9zrdrBvt1sEymqWkTo2jKVo3tj0rtQmah9A,1978
|
|
3
|
+
crowdsec_tracker_api/http_client.py,sha256=HdEn7rolYXCSVZDy2l5AejO9mYdHVjuXWAPt_5W7xT0,4794
|
|
4
|
+
crowdsec_tracker_api/models.py,sha256=gJtYV2XxtFfZji7aHgBOVfL3yoY9bpRSyumYDGyzRRo,31599
|
|
5
|
+
crowdsec_tracker_api/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
crowdsec_tracker_api/services/cves.py,sha256=33JL3AR6o1i8J7EJWDgDnyYlNhrXfLSD6enbbKH7A8I,5435
|
|
7
|
+
crowdsec_tracker_api/services/integrations.py,sha256=HBERLc8Mi5eQr0fhdbDJNRuJixjH7p1pZOSQGH1L5TI,5484
|
|
8
|
+
crowdsec_tracker_api-1.95.0.dist-info/licenses/LICENSE,sha256=fDPfY1qTG2iqaRIHXQOfPol7DIaWatUayHa8SUPk4cE,1064
|
|
9
|
+
crowdsec_tracker_api-1.95.0.dist-info/METADATA,sha256=-_JGlqz06fXN4zSTZVb9WkQezkdg0nIxPdv-j_HFp-E,1206
|
|
10
|
+
crowdsec_tracker_api-1.95.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
11
|
+
crowdsec_tracker_api-1.95.0.dist-info/top_level.txt,sha256=PjzuJQNS-E2cYLihw-evV3MrsY9OWAb8QNKEFEg1hhE,21
|
|
12
|
+
crowdsec_tracker_api-1.95.0.dist-info/RECORD,,
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
crowdsec_tracker_api/__init__.py,sha256=qVgdTR0nEMf7N9E1vr2W8fushTJNNahUiKRrkKPK5eE,1359
|
|
2
|
-
crowdsec_tracker_api/base_model.py,sha256=UMpRf5Y9N85ldRqsfjfjZJW8LwLugrgJTWpMOulu4cY,1909
|
|
3
|
-
crowdsec_tracker_api/http_client.py,sha256=7Ub19T1aRnbMz5TcLgzFWq3sy08-6PwuyGFVFrivUf0,4627
|
|
4
|
-
crowdsec_tracker_api/models.py,sha256=oQVYZ9V_DsIigbToqOhkmLBCIGyABjoKdR5aLvDquNw,31563
|
|
5
|
-
crowdsec_tracker_api/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
crowdsec_tracker_api/services/cves.py,sha256=LAeOeChFpUQoH6UgGrFchuvMSpREPv28_fubsvTuFQM,5394
|
|
7
|
-
crowdsec_tracker_api/services/integrations.py,sha256=Gu-hMno46E6huEh6maqyvho-epam3mecUuKt4fblhhk,5250
|
|
8
|
-
crowdsec_tracker_api-1.92.0.dist-info/licenses/LICENSE,sha256=fDPfY1qTG2iqaRIHXQOfPol7DIaWatUayHa8SUPk4cE,1064
|
|
9
|
-
crowdsec_tracker_api-1.92.0.dist-info/METADATA,sha256=Pcf69OFxq2SYVssVKQba7uktpXMEyUbnoWiZd_CiucQ,1206
|
|
10
|
-
crowdsec_tracker_api-1.92.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
11
|
-
crowdsec_tracker_api-1.92.0.dist-info/top_level.txt,sha256=PjzuJQNS-E2cYLihw-evV3MrsY9OWAb8QNKEFEg1hhE,21
|
|
12
|
-
crowdsec_tracker_api-1.92.0.dist-info/RECORD,,
|
|
File without changes
|
{crowdsec_tracker_api-1.92.0.dist-info → crowdsec_tracker_api-1.95.0.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{crowdsec_tracker_api-1.92.0.dist-info → crowdsec_tracker_api-1.95.0.dist-info}/top_level.txt
RENAMED
|
File without changes
|