From 68b80144a4a5e32d8950d09790c09a0b67c8d7fd Mon Sep 17 00:00:00 2001 From: Sebastian Serfling Date: Tue, 22 Aug 2023 22:23:14 +0200 Subject: [PATCH] Remove API key From Console --- auth.py | 1 - main.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/auth.py b/auth.py index 066c9d5..29ed9b5 100644 --- a/auth.py +++ b/auth.py @@ -16,7 +16,6 @@ def get_settings(): return Settings() async def get_api_key(settings: Settings = Depends(get_settings), api_key_header: str = Security(api_key_header)): - print(settings) if api_key_header == settings.API_KEY: return api_key_header else: diff --git a/main.py b/main.py index 9405a28..87df814 100644 --- a/main.py +++ b/main.py @@ -45,7 +45,7 @@ def database(query,name,user): app = FastAPI() @app.get("/") -async def notify(): +async def notify(api_key: APIKey = Depends(auth.get_api_key)): return database(f"SELECT * FROM Notifications", "Stines-GmbH","") @app.get("/gettime")