Merge pull request 'Upgraded modules' (#10) from feature/module-upgrade into main

Reviewed-on: #10
This commit was merged in pull request #10.
This commit is contained in:
florian committed 2026-10-18 10:44:44 +00:00
commit cc59471b07
2 files changed
+30 -31

No files matched your search

+24 -24
View File
@@ -1,29 +1,29 @@
--extra-index-url https://git.gansejunge.com/api/packages/notifier/pypi/simple/ --extra-index-url https://git.gansejunge.com/api/packages/notifier/pypi/simple/
annotated-types==0.7.0 annotated-doc==0.0.5
anyio==4.11.0 annotated-types==0.8.0
anyio==4.15.1
argon2-cffi==25.1.0 argon2-cffi==25.1.0
argon2-cffi-bindings==25.1.0 argon2-cffi-bindings==26.1.0
cffi==2.0.0
click==8.3.0
cryptography==46.0.2
fastapi==0.118.0
h11==0.16.0
idna==3.10
lib-db-module==0.2.0
lib-secret-manager==0.2.0
lib-uvicorn-config==0.2.0
mysql-connector-python==9.4.0
prometheus_client==0.23.1
pycparser==2.23
pydantic==2.12.0
pydantic_core==2.41.1
python-json-logger==4.0.0
simple-logger-handler==0.1.0
sniffio==1.3.1
starlette==0.48.0
typing-inspection==0.4.2
typing_extensions==4.15.0
uvicorn==0.37.0
certifi==2026.7.22 certifi==2026.7.22
cffi==2.1.1
click==8.5.0
cryptography==46.0.2
fastapi==0.143.5
h11==0.16.0
httpcore==1.0.9 httpcore==1.0.9
httpx==0.28.1 httpx==0.28.1
idna==3.20
lib-db-module==0.3.0
lib-secret-manager==0.3.1
mysql-connector-python==9.4.0
opentelemetry-api==1.45.1
prometheus_client==0.26.0
pycparser==3.11
pydantic==2.14.1
pydantic_core==2.50.1
python-json-logger==4.2.0
simple-logger-handler==0.2.1
starlette==1.8.0
typing-inspection==0.4.4
typing_extensions==4.16.0
uvicorn==0.54.0
+6 -7
View File
@@ -15,10 +15,9 @@ from starlette.exceptions import HTTPException as StarletteHTTPException
from db_module import close_connection_pool, create_connection_pool, get_db, start_healthcheck_thread from db_module import close_connection_pool, create_connection_pool, get_db, start_healthcheck_thread
from metrics_server import REQUEST_COUNTER from metrics_server import REQUEST_COUNTER
from secret_manager import cleanup_secret_files, return_credentials from secret_manager import cleanup_secret_files, get_secret
from secret_manager.fernet_encryption import encrypt_token from secret_manager.fernet_encryption import encrypt_token
from simple_logger_handler import LOG_LEVEL, setup_logger from simple_logger_handler import LOG_LEVEL, setup_logger
from uvicorn_logger_config import LOGGING_CONFIG
from validator import is_valid_platform, is_valid_token, verify_api_key from validator import is_valid_platform, is_valid_token, verify_api_key
logger = setup_logger(__name__) logger = setup_logger(__name__)
@@ -51,7 +50,7 @@ async def lifespan(app: FastAPI):
"BACKEND_API_INTERNAL_URL", "BACKEND_API_INTERNAL_URL",
"http://backend-api-internal.app-notifications.svc.cluster.local:8101", "http://backend-api-internal.app-notifications.svc.cluster.local:8101",
) )
api_key_backend_api = return_credentials("/etc/secrets/api_key") api_key_backend_api = get_secret(os.getenv("BACKEND_API_KEY",""),"/etc/secrets/api_key")
try: try:
logger.info("[FastAPI] Creating MySQL connection pool...") logger.info("[FastAPI] Creating MySQL connection pool...")
@@ -259,15 +258,15 @@ async def pull_notifications(
return data return data
async def start_servers(): async def start_servers():
logger.debug("[FastAPI] Starting servers...") logger.info("[Server] Starting main API (port 8100) and metrics server (port 9000)...")
config_main = uvicorn.Config("main:api", host="0.0.0.0", port=8100, log_level=LOG_LEVEL.lower(), log_config=LOGGING_CONFIG) config_main = uvicorn.Config("main:api", host="0.0.0.0", port=8100, log_level=LOG_LEVEL.lower(), log_config=None)
config_metrics = uvicorn.Config("metrics_server:metrics_api", host="0.0.0.0", port=9000, log_level=LOG_LEVEL.lower(),log_config=LOGGING_CONFIG) config_metrics = uvicorn.Config("metrics_server:metrics_api", host="0.0.0.0", port=9000, log_level=LOG_LEVEL.lower(),log_config=None)
server_main = uvicorn.Server(config_main) server_main = uvicorn.Server(config_main)
server_metrics = uvicorn.Server(config_metrics) server_metrics = uvicorn.Server(config_metrics)
await asyncio.gather(server_main.serve(), server_metrics.serve()) await asyncio.gather(server_main.serve(), server_metrics.serve())
logger.debug("[FastAPI] Servers started") logger.info("[Server] Both servers have stopped.")
if __name__ == "__main__": if __name__ == "__main__":
asyncio.run(start_servers()) asyncio.run(start_servers())