Functioning mqtt ingestion and db write, formating changes, device manager initiated

This commit is contained in:
Andrej Mickov
2025-10-30 00:32:25 +01:00
parent 0b96c72f45
commit 12d3720421
45 changed files with 2168 additions and 820 deletions

View File

@@ -1,6 +1,26 @@
def main():
print("Hello from device-manager!")
from fastapi import FastAPI
from cert_manager import CertificateManager
from models import DeviceRegistrationRequest, DeviceRegistrationResponse
app = FastAPI()
cert_manager = CertificateManager()
@app.get("/")
async def hello():
return {"Hello": "World"}
@app.post("/devices/register")
async def register_device(request: DeviceRegistrationRequest) -> DeviceRegistrationResponse:
"""
Register a new device and issue an X.509 certificate.
"""
response = cert_manager.register_device(
name=request.name,
location=request.location,
)
if __name__ == "__main__":
main()
return response