crowdsec-tracker-api 1.92.0__tar.gz → 1.94.2__tar.gz
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-1.92.0 → crowdsec_tracker_api-1.94.2}/PKG-INFO +1 -1
- {crowdsec_tracker_api-1.92.0 → crowdsec_tracker_api-1.94.2}/crowdsec_tracker_api/base_model.py +4 -2
- {crowdsec_tracker_api-1.92.0 → crowdsec_tracker_api-1.94.2}/crowdsec_tracker_api/http_client.py +11 -2
- {crowdsec_tracker_api-1.92.0 → crowdsec_tracker_api-1.94.2}/crowdsec_tracker_api/models.py +11 -23
- {crowdsec_tracker_api-1.92.0 → crowdsec_tracker_api-1.94.2}/crowdsec_tracker_api/services/cves.py +2 -2
- {crowdsec_tracker_api-1.92.0 → crowdsec_tracker_api-1.94.2}/crowdsec_tracker_api/services/integrations.py +3 -3
- {crowdsec_tracker_api-1.92.0 → crowdsec_tracker_api-1.94.2}/crowdsec_tracker_api.egg-info/PKG-INFO +1 -1
- {crowdsec_tracker_api-1.92.0 → crowdsec_tracker_api-1.94.2}/pyproject.toml +1 -1
- {crowdsec_tracker_api-1.92.0 → crowdsec_tracker_api-1.94.2}/LICENSE +0 -0
- {crowdsec_tracker_api-1.92.0 → crowdsec_tracker_api-1.94.2}/README.md +0 -0
- {crowdsec_tracker_api-1.92.0 → crowdsec_tracker_api-1.94.2}/crowdsec_tracker_api/__init__.py +0 -0
- {crowdsec_tracker_api-1.92.0 → crowdsec_tracker_api-1.94.2}/crowdsec_tracker_api/services/__init__.py +0 -0
- {crowdsec_tracker_api-1.92.0 → crowdsec_tracker_api-1.94.2}/crowdsec_tracker_api.egg-info/SOURCES.txt +0 -0
- {crowdsec_tracker_api-1.92.0 → crowdsec_tracker_api-1.94.2}/crowdsec_tracker_api.egg-info/dependency_links.txt +0 -0
- {crowdsec_tracker_api-1.92.0 → crowdsec_tracker_api-1.94.2}/crowdsec_tracker_api.egg-info/requires.txt +0 -0
- {crowdsec_tracker_api-1.92.0 → crowdsec_tracker_api-1.94.2}/crowdsec_tracker_api.egg-info/top_level.txt +0 -0
- {crowdsec_tracker_api-1.92.0 → crowdsec_tracker_api-1.94.2}/setup.cfg +0 -0
{crowdsec_tracker_api-1.92.0 → crowdsec_tracker_api-1.94.2}/crowdsec_tracker_api/base_model.py
RENAMED
|
@@ -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:
|
{crowdsec_tracker_api-1.92.0 → crowdsec_tracker_api-1.94.2}/crowdsec_tracker_api/http_client.py
RENAMED
|
@@ -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):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# generated by datamodel-codegen:
|
|
2
2
|
# filename: <stdin>
|
|
3
|
-
# timestamp: 2025-12-
|
|
3
|
+
# timestamp: 2025-12-29T14:24:53+00:00
|
|
4
4
|
|
|
5
5
|
from __future__ import annotations
|
|
6
6
|
|
|
@@ -546,7 +546,7 @@ class CvesGetCveIpsDetailsQueryParameters(BaseModelSdk):
|
|
|
546
546
|
description='Filter IPs seen since this date, format duration (e.g., 7d, 24h), default to 14d',
|
|
547
547
|
title='Since',
|
|
548
548
|
),
|
|
549
|
-
] =
|
|
549
|
+
] = '14d'
|
|
550
550
|
page: Annotated[
|
|
551
551
|
Optional[int], Field(description='Page number', ge=1, title='Page')
|
|
552
552
|
] = 1
|
|
@@ -662,13 +662,9 @@ class IntegrationCreateResponse(BaseModelSdk):
|
|
|
662
662
|
title='Endpoint',
|
|
663
663
|
),
|
|
664
664
|
]
|
|
665
|
-
stats: Annotated[
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
default_factory=lambda: Stats.model_validate({'count': 0}),
|
|
669
|
-
description='Stats of the integration',
|
|
670
|
-
),
|
|
671
|
-
]
|
|
665
|
+
stats: Annotated[Optional[Stats], Field(description='Stats of the integration')] = {
|
|
666
|
+
'count': 0
|
|
667
|
+
}
|
|
672
668
|
tags: Annotated[
|
|
673
669
|
Optional[List[str]],
|
|
674
670
|
Field(description='Tags associated with the integration', title='Tags'),
|
|
@@ -736,13 +732,9 @@ class IntegrationGetResponse(BaseModelSdk):
|
|
|
736
732
|
title='Endpoint',
|
|
737
733
|
),
|
|
738
734
|
]
|
|
739
|
-
stats: Annotated[
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
default_factory=lambda: Stats.model_validate({'count': 0}),
|
|
743
|
-
description='Stats of the integration',
|
|
744
|
-
),
|
|
745
|
-
]
|
|
735
|
+
stats: Annotated[Optional[Stats], Field(description='Stats of the integration')] = {
|
|
736
|
+
'count': 0
|
|
737
|
+
}
|
|
746
738
|
tags: Annotated[
|
|
747
739
|
Optional[List[str]],
|
|
748
740
|
Field(description='Tags associated with the integration', title='Tags'),
|
|
@@ -835,13 +827,9 @@ class IntegrationUpdateResponse(BaseModelSdk):
|
|
|
835
827
|
title='Endpoint',
|
|
836
828
|
),
|
|
837
829
|
]
|
|
838
|
-
stats: Annotated[
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
default_factory=lambda: Stats.model_validate({'count': 0}),
|
|
842
|
-
description='Stats of the integration',
|
|
843
|
-
),
|
|
844
|
-
]
|
|
830
|
+
stats: Annotated[Optional[Stats], Field(description='Stats of the integration')] = {
|
|
831
|
+
'count': 0
|
|
832
|
+
}
|
|
845
833
|
tags: Annotated[
|
|
846
834
|
Optional[List[str]],
|
|
847
835
|
Field(description='Tags associated with the integration', title='Tags'),
|
{crowdsec_tracker_api-1.92.0 → crowdsec_tracker_api-1.94.2}/crowdsec_tracker_api/services/cves.py
RENAMED
|
@@ -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.94.2")
|
|
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.94.2")
|
|
15
15
|
|
|
16
16
|
def get_integrations(
|
|
17
17
|
self,
|
|
@@ -124,7 +124,7 @@ class Integrations(Service):
|
|
|
124
124
|
integration_id: str,
|
|
125
125
|
page: int = 1,
|
|
126
126
|
page_size: Optional[int] = None,
|
|
127
|
-
):
|
|
127
|
+
)-> str:
|
|
128
128
|
endpoint_url = "/integrations/{integration_id}/content"
|
|
129
129
|
loc = locals()
|
|
130
130
|
headers = {}
|
|
@@ -143,7 +143,7 @@ class Integrations(Service):
|
|
|
143
143
|
url=endpoint_url, path_params=path_params, params=params, headers=headers
|
|
144
144
|
)
|
|
145
145
|
|
|
146
|
-
return
|
|
146
|
+
return response.text
|
|
147
147
|
|
|
148
148
|
def get_integration_content_stream(
|
|
149
149
|
self,
|
|
File without changes
|
|
File without changes
|
{crowdsec_tracker_api-1.92.0 → crowdsec_tracker_api-1.94.2}/crowdsec_tracker_api/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|