Add CompanionAPIEndpoints integration in APIEndpoints class

- Introduced CompanionAPIEndpoints to handle routes under /api/companion/*.
- Enhanced the APIEndpoints class to create a nested companion object for improved modularity and organization of companion-related API functionality.
This commit is contained in:
agessaman
2026-02-15 22:10:23 -08:00
parent a3f96962ff
commit 22e337a707
3 changed files with 953 additions and 0 deletions
+4
View File
@@ -11,6 +11,7 @@ from repeater.config import update_global_flood_policy
from .cad_calibration_engine import CADCalibrationEngine
from .auth.middleware import require_auth
from .auth_endpoints import AuthAPIEndpoints
from .companion_endpoints import CompanionAPIEndpoints
from pymc_core.protocol import CryptoUtils
logger = logging.getLogger("HTTPServer")
@@ -146,6 +147,9 @@ class APIEndpoints:
# Create nested auth object for /api/auth/* routes
self.auth = AuthAPIEndpoints()
# Create nested companion object for /api/companion/* routes
self.companion = CompanionAPIEndpoints(daemon_instance, event_loop, self.config)
def _is_cors_enabled(self):
return self.config.get("web", {}).get("cors_enabled", False)