crowdsec-tracker-api 1.92.0__py3-none-any.whl → 1.94.2__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.
@@ -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(base_url=base_url, auth=auth)
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__(self, base_url: str, auth: httpx.Auth, aws_region="eu-west-1") -> None:
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
- self.client = httpx.Client(headers={"Accept-Encoding": "gzip"})
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-17T10:47:38+00:00
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
- ] = Since('14d')
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
- Optional[Stats],
667
- Field(
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
- Optional[Stats],
741
- Field(
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
- Optional[Stats],
840
- Field(
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'),
@@ -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 None
146
+ return response.text
147
147
 
148
148
  def get_integration_content_stream(
149
149
  self,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: crowdsec_tracker_api
3
- Version: 1.92.0
3
+ Version: 1.94.2
4
4
  Summary: This is the API to manage Crowdsec Live Exploit Tracker service
5
5
  Author-email: crowdsec <info@crowdsec.net>
6
6
  License: MIT
@@ -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=bvZy3rhXxczSRRBAa7Q_omSCMrX60d50hQREkI9T-cM,31289
5
+ crowdsec_tracker_api/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ crowdsec_tracker_api/services/cves.py,sha256=WDCvqdpiCgtPz_lLvROqy1ubyj_kcTQ3RcRyRrnxCjI,5435
7
+ crowdsec_tracker_api/services/integrations.py,sha256=qko4vX944CRK4kRFhr7ut0XAQaeyUSb3QxAy_KSxOuQ,5307
8
+ crowdsec_tracker_api-1.94.2.dist-info/licenses/LICENSE,sha256=fDPfY1qTG2iqaRIHXQOfPol7DIaWatUayHa8SUPk4cE,1064
9
+ crowdsec_tracker_api-1.94.2.dist-info/METADATA,sha256=iKkccyRy3Oc1rkTzlUtm5CnEZ2ldcOW7FM8W4-g49a0,1206
10
+ crowdsec_tracker_api-1.94.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
+ crowdsec_tracker_api-1.94.2.dist-info/top_level.txt,sha256=PjzuJQNS-E2cYLihw-evV3MrsY9OWAb8QNKEFEg1hhE,21
12
+ crowdsec_tracker_api-1.94.2.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,,