ЛР 7: TLS/mTLS, Argon2id, OpenBao и negative tests (оценка 3)
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
Яковлев Матвей Дмитриевич
2026-11-28 12:29:50 +01:00
parent 20afc2c790
commit 8c75b7266f
53 changed files with 3114 additions and 89 deletions
+26
View File
@@ -0,0 +1,26 @@
"""Local entry point: python -m app (HTTPS with required client cert inside the mesh)."""
import os
import ssl
import uvicorn
if __name__ == "__main__":
cert = os.environ.get("TLS_CERTFILE")
key = os.environ.get("TLS_KEYFILE")
options = {}
if cert and key:
options = dict(
ssl_certfile=cert,
ssl_keyfile=key,
ssl_ca_certs=os.environ.get("TLS_CLIENT_CA", "/certs/ca.crt"),
ssl_cert_reqs=ssl.CERT_REQUIRED if os.environ.get("TLS_REQUIRE_CLIENT", "1") == "1"
else ssl.CERT_NONE,
)
uvicorn.run(
"app.main:app",
host=os.environ.get("APP_HOST", "0.0.0.0"),
port=int(os.environ.get("APP_PORT", "8443")),
workers=1,
log_level=os.environ.get("LOG_LEVEL", "info"),
**options,
)