diff --git a/api/kiwi_vpn_api/routers/__init__.py b/api/kiwi_vpn_api/routers/__init__.py index 283056a..25a4dbf 100644 --- a/api/kiwi_vpn_api/routers/__init__.py +++ b/api/kiwi_vpn_api/routers/__init__.py @@ -7,11 +7,12 @@ This file: Main API router definition. from fastapi import APIRouter from ..config import Settings -from . import admin, device, user +from . import admin, device, service, user main_router = APIRouter(prefix=f"/{Settings._.api_v1_prefix}") main_router.include_router(admin.router) +main_router.include_router(service.router) main_router.include_router(device.router) main_router.include_router(user.router) diff --git a/api/kiwi_vpn_api/routers/service.py b/api/kiwi_vpn_api/routers/service.py new file mode 100644 index 0000000..2922829 --- /dev/null +++ b/api/kiwi_vpn_api/routers/service.py @@ -0,0 +1,24 @@ +""" +/service endpoints. +""" + +from fastapi import APIRouter, Depends, HTTPException, status + +from ..config import Config +from ._common import Responses, get_current_config + +router = APIRouter(prefix="/service", tags=["service"]) + + +@router.put( + "/pki/init", + responses={ + status.HTTP_200_OK: Responses.OK, + status.HTTP_400_BAD_REQUEST: Responses.NOT_INSTALLED, + status.HTTP_403_FORBIDDEN: Responses.NEEDS_PERMISSION, + }, +) +async def init_pki( + _: Config = Depends(get_current_config), +) -> None: + pass