From e6c270a0fa4e703f2e3520ad52698be3b2d1fec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Fri, 1 Apr 2022 17:15:56 +0000 Subject: [PATCH] missing 401 --- api/kiwi_vpn_api/routers/_common.py | 2 +- api/kiwi_vpn_api/routers/service.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/api/kiwi_vpn_api/routers/_common.py b/api/kiwi_vpn_api/routers/_common.py index 5c8c4b9..1869d2e 100644 --- a/api/kiwi_vpn_api/routers/_common.py +++ b/api/kiwi_vpn_api/routers/_common.py @@ -32,7 +32,7 @@ class Responses: "content": None, } NEEDS_USER = { - "description": "Must be logged in", + "description": "Not logged in", "content": None, } NEEDS_PERMISSION = { diff --git a/api/kiwi_vpn_api/routers/service.py b/api/kiwi_vpn_api/routers/service.py index 89acd88..42d1c23 100644 --- a/api/kiwi_vpn_api/routers/service.py +++ b/api/kiwi_vpn_api/routers/service.py @@ -4,10 +4,9 @@ from fastapi import APIRouter, Depends, HTTPException, status -from ..config import Config from ..db import User from ..easyrsa import CertificateType, EasyRSA -from ._common import Responses, get_current_config, get_current_user +from ._common import Responses, get_current_user router = APIRouter(prefix="/service", tags=["service"]) @@ -17,11 +16,11 @@ router = APIRouter(prefix="/service", tags=["service"]) responses={ status.HTTP_200_OK: Responses.OK, status.HTTP_400_BAD_REQUEST: Responses.NOT_INSTALLED, + status.HTTP_401_UNAUTHORIZED: Responses.NEEDS_USER, status.HTTP_403_FORBIDDEN: Responses.NEEDS_PERMISSION, }, ) async def init_pki( - _: Config = Depends(get_current_config), current_user: User = Depends(get_current_user), ) -> None: