refactor: consolidate logging to shared aitbc-core package and upgrade database dependencies
- Upgrade SQLAlchemy to 2.0.47 with asyncio extras in blockchain-node and coordinator-api - Add asyncpg >=0.29.0 for PostgreSQL async support - Remove uvloop as optional dependency, make it required >=0.22.0 - Delete duplicate logger.py from blockchain-node (117 lines) - Refactor coordinator-api logging to use shared aitbc.logging from aitbc-core package - Add aitbc-core package dependency to coordinator
This commit is contained in:
@@ -2,7 +2,7 @@ from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from pydantic import Field
|
||||
from pydantic import Field, field_validator
|
||||
from pydantic_settings import BaseSettings
|
||||
|
||||
|
||||
@@ -13,11 +13,18 @@ class Settings(BaseSettings):
|
||||
debug: bool = Field(default=False)
|
||||
|
||||
coordinator_base_url: str = Field(default="http://localhost:8011", alias="COORDINATOR_BASE_URL")
|
||||
coordinator_api_key: str = Field(default="${CLIENT_API_KEY}", alias="COORDINATOR_API_KEY")
|
||||
coordinator_api_key: str = Field(..., alias="COORDINATOR_API_KEY")
|
||||
|
||||
rest_prefix: str = Field(default="/v1", alias="REST_PREFIX")
|
||||
ledger_db_path: Path = Field(default=Path("./data/wallet_ledger.db"), alias="LEDGER_DB_PATH")
|
||||
|
||||
@field_validator('coordinator_api_key')
|
||||
@classmethod
|
||||
def validate_api_key(cls, v: str) -> str:
|
||||
if v.startswith('$') or not v or v == 'your_api_key_here':
|
||||
raise ValueError('COORDINATOR_API_KEY must be set to a valid value and cannot be a template placeholder')
|
||||
return v
|
||||
|
||||
class Config:
|
||||
env_file = ".env"
|
||||
case_sensitive = False
|
||||
|
||||
Reference in New Issue
Block a user