feat: api route to get api client infos

This commit is contained in:
imperosol
2025-10-25 21:45:27 +02:00
parent 459edc1b6e
commit 766a3bcf6b
3 changed files with 46 additions and 22 deletions

16
api/api.py Normal file
View File

@@ -0,0 +1,16 @@
from ninja_extra import ControllerBase, api_controller, route
from api.auth import ApiKeyAuth
from api.schemas import ApiClientSchema
@api_controller("/client")
class ApiClientController(ControllerBase):
@route.get(
"/me",
auth=[ApiKeyAuth()],
response=ApiClientSchema,
url_name="api-client-infos",
)
def get_client_info(self):
return self.context.request.auth