crypticorn 2.17.0rc6__py3-none-any.whl → 2.17.0rc7__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.
@@ -15,10 +15,10 @@ from typing import Annotated, Literal
15
15
  from fastapi import APIRouter, Response, Depends
16
16
  from prometheus_client import generate_latest, CONTENT_TYPE_LATEST
17
17
  from crypticorn.common.metrics import registry
18
- from crypticorn.common.auth import AuthHandler, basic_auth
18
+ from crypticorn.common.auth import AuthHandler
19
19
 
20
20
  class EnhancedApiRouter(APIRouter):
21
- def __init__(self, enable_metrics: bool = False, auth_handler: AuthHandler = None, *args, **kwargs):
21
+ def __init__(self, enable_metrics: bool = False, auth_handler: AuthHandler = AuthHandler(), *args, **kwargs):
22
22
  """
23
23
  Enhanced API Router that allows for metrics and authentication.
24
24
  If enable_metrics is True, the router will include the metrics endpoint.
@@ -28,10 +28,7 @@ class EnhancedApiRouter(APIRouter):
28
28
  self.enable_metrics = enable_metrics
29
29
  self.auth_handler = auth_handler
30
30
 
31
- if self.enable_metrics and not self.auth_handler:
32
- raise ValueError("auth_handler must be provided if enable_metrics is True")
33
-
34
- router = EnhancedApiRouter(tags=["Status"], prefix="", enable_metrics=False, auth_handler=None)
31
+ router = EnhancedApiRouter(tags=["Status"], prefix="")
35
32
 
36
33
 
37
34
  @router.get("/", operation_id="ping")
@@ -54,7 +51,7 @@ async def time(type: Literal["iso", "unix"] = "iso") -> str:
54
51
 
55
52
 
56
53
  @router.get("/metrics", operation_id="getMetrics", include_in_schema=router.enable_metrics)
57
- def metrics(username: Annotated[str, Depends(basic_auth)]):
54
+ def metrics(username: Annotated[str, Depends(router.auth_handler.basic_auth)]):
58
55
  """
59
56
  Get Prometheus metrics for the application. Returns plain text.
60
57
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: crypticorn
3
- Version: 2.17.0rc6
3
+ Version: 2.17.0rc7
4
4
  Summary: Maximise Your Crypto Trading Profits with Machine Learning
5
5
  Author-email: Crypticorn <timon@crypticorn.com>
6
6
  License-Expression: MIT
@@ -85,7 +85,7 @@ crypticorn/common/urls.py,sha256=v23H2gevTNZ6HMRXDPiuc8znBbNdNqj0JTAdm5Hhms8,122
85
85
  crypticorn/common/utils.py,sha256=LcWudhcjZtULg87yYghh5muTYdHvk3UmkEAXmX7xgLk,3073
86
86
  crypticorn/common/warnings.py,sha256=Ho2XmjsXbR0_8kTADG5PweWqOlrKlRwOr6Df-RKxDiU,3084
87
87
  crypticorn/common/router/admin_router.py,sha256=190ikRy0lMTR1rq2Oywutuq1qQzL6X1yI-xZut11jMo,3740
88
- crypticorn/common/router/status_router.py,sha256=ETsrcR1p8Nnien5g6LnBXO575yZxM-LeUtLI5FqW8a0,2381
88
+ crypticorn/common/router/status_router.py,sha256=vqZo6nZZfQMgdZzvdi6Ax5pywqVOK-Zhkm7FRbZxJ6Q,2210
89
89
  crypticorn/dex/__init__.py,sha256=9_mqFYSxgg17HU0yDXiKyle7sfa625wC4qPQU_FPZ4k,110
90
90
  crypticorn/dex/main.py,sha256=7XOaSmtuSDu1qqSrIFgRdMze566cZgBhgr7Chm5iAsE,66
91
91
  crypticorn/dex/client/__init__.py,sha256=UubUEV0qetNHNMa_sx1RfD0WAWxB9bATH1zQUDevmnM,1923
@@ -316,9 +316,9 @@ crypticorn/trade/client/models/strategy_update.py,sha256=hoZTORJ3puMY5WbQQw2n77G
316
316
  crypticorn/trade/client/models/tpsl.py,sha256=iuHwBxHaUdtJn7NhcTE6Skzv4nmoSF8jEnf7_bTglwk,3730
317
317
  crypticorn/trade/client/models/tpsl_create.py,sha256=nX4i2BGWv5rmu3SLgRngfvEMFOWa3CIy0G3fyoxI-e4,3351
318
318
  crypticorn/trade/client/models/trading_action_type.py,sha256=BysUEOl85zs79EA2zOcDN1EExcpQdABaJ4Jz08_z8VU,857
319
- crypticorn-2.17.0rc6.dist-info/licenses/LICENSE,sha256=HonAVvzFXkP2C1d7D3ByIKPwjGH8NcHTAQvKH7uvOHQ,1856
320
- crypticorn-2.17.0rc6.dist-info/METADATA,sha256=rHq8w0k7ZIShJAPch2houkaZgqApT_HnttaXUrIHLK0,11712
321
- crypticorn-2.17.0rc6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
322
- crypticorn-2.17.0rc6.dist-info/entry_points.txt,sha256=d_xHsGvUTebPveVUK0SrpDFQ5ZRSjlI7lNCc11sn2PM,59
323
- crypticorn-2.17.0rc6.dist-info/top_level.txt,sha256=EP3NY216qIBYfmvGl0L2Zc9ItP0DjGSkiYqd9xJwGcM,11
324
- crypticorn-2.17.0rc6.dist-info/RECORD,,
319
+ crypticorn-2.17.0rc7.dist-info/licenses/LICENSE,sha256=HonAVvzFXkP2C1d7D3ByIKPwjGH8NcHTAQvKH7uvOHQ,1856
320
+ crypticorn-2.17.0rc7.dist-info/METADATA,sha256=V9z0IS7vD3dcwMF8tsrmjgKMmXoAQ2cohi9sE2BhqHw,11712
321
+ crypticorn-2.17.0rc7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
322
+ crypticorn-2.17.0rc7.dist-info/entry_points.txt,sha256=d_xHsGvUTebPveVUK0SrpDFQ5ZRSjlI7lNCc11sn2PM,59
323
+ crypticorn-2.17.0rc7.dist-info/top_level.txt,sha256=EP3NY216qIBYfmvGl0L2Zc9ItP0DjGSkiYqd9xJwGcM,11
324
+ crypticorn-2.17.0rc7.dist-info/RECORD,,