feat: add SRP authentication, improve security

- Replace RSA key exchange with SRP (Secure Remote Password)
- Password never transmitted over network
- Add unit tests for endpoints
- Fix datetime.UTC compatibility for Python < 3.11
- Fix logger.exception usage
- Update README with new auth flow diagram
This commit is contained in:
mirai
2026-01-02 23:09:00 +03:00
parent e3a3dd3f0f
commit 5cbe355660
26 changed files with 470 additions and 482 deletions
+3 -5
View File
@@ -2,22 +2,20 @@ from typing import Optional
from .logger import logger
from .factory import create_app
app = create_app()
def run_server(
host: str = "0.0.0.0",
port: int = 8000,
admin_password: Optional[str] = None,
password: Optional[str] = None,
workers: int = 1,
) -> None:
app.ctx.admin_password = admin_password
app = create_app(password=password or "")
logger.info(f"Starting server on {host}:{port}")
app.run(
host=host,
port=port,
workers=workers,
single_process=True,
debug=False,
access_log=True,
)