chore: initial project setup with backend, frontend, CI/CD, and documentation
Add complete NexaFabric project structure including: - FastAPI backend with SQLAlchemy models, JWT auth, RBAC, audit logging, and provider interfaces - React + TypeScript frontend with Vite, Tailwind CSS, TanStack Query, and Zustand - Docker Compose configuration for PostgreSQL, Redis, API, worker, frontend, and nginx - GitHub Actions and GitLab CI workflows for testing, linting, building, and security scanning - Environment
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from dataclasses import dataclass
|
||||
from typing import Any
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ProviderConnection:
|
||||
api_url: str
|
||||
token: str
|
||||
verify_tls: bool = True
|
||||
read_only: bool = True
|
||||
|
||||
|
||||
class HypervisorProvider(ABC):
|
||||
@abstractmethod
|
||||
async def test_connection(self, connection: ProviderConnection) -> dict[str, Any]:
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
class InventoryProvider(ABC):
|
||||
@abstractmethod
|
||||
async def sync_inventory(self, connection: ProviderConnection) -> dict[str, list[dict[str, Any]]]:
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
class NetworkProvider(ABC):
|
||||
@abstractmethod
|
||||
async def list_networks(self, connection: ProviderConnection) -> list[dict[str, Any]]:
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
class FirewallProvider(ABC):
|
||||
@abstractmethod
|
||||
async def preview_rules(self, connection: ProviderConnection, rules: list[dict[str, Any]]) -> dict[str, Any]:
|
||||
raise NotImplementedError
|
||||
|
||||
@abstractmethod
|
||||
async def apply_rules(self, connection: ProviderConnection, rules: list[dict[str, Any]]) -> dict[str, Any]:
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
class Provider(
|
||||
HypervisorProvider,
|
||||
InventoryProvider,
|
||||
NetworkProvider,
|
||||
FirewallProvider,
|
||||
ABC,
|
||||
):
|
||||
name: str
|
||||
|
||||
Reference in New Issue
Block a user