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
+1 -5
View File
@@ -3,10 +3,6 @@ from cmd_chat.server.server import run_server
from cmd_chat.client.client import Client
def run_http_server(ip: str, port: int, password: str | None) -> None:
run_server(host=ip, port=int(port), admin_password=password)
def main():
parser = argparse.ArgumentParser(description="Command-line chat application")
subparsers = parser.add_subparsers(dest="command", required=True)
@@ -25,7 +21,7 @@ def main():
args = parser.parse_args()
if args.command == "serve":
run_http_server(args.ip_address, args.port, args.password)
run_server(host=args.ip_address, port=int(args.port), password=args.password)
elif args.command == "connect":
Client(
server=args.ip_address,