Commit Graph

15 Commits

Author SHA1 Message Date
mirai
264d19e932 NO LOGS 2026-01-03 12:00:52 +03:00
mirai
0756aab53f Final notes 2026-01-02 23:25:02 +03:00
mirai
5cbe355660 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
2026-01-02 23:09:00 +03:00
mirai
95f8a192b5 feat: complete client-server architecture refactoring
Server:
- Split into views, routes, helpers, models modules
- Merged /ws/talk and /ws/update into single /ws/chat endpoint
- Replaced polling with push-based broadcast model
- Added username uniqueness validation on connect
- Fixed run_server arguments bug (workers parameter)
- Removed deprecated loop argument from Sanic listeners
- Replaced datetime.utcnow() with timezone-aware datetime.now(timezone.utc)

Client:
- Rewrote client as single-file module
- Migrated from websocket-client to websockets (asyncio)
- Fixed websocket-client conflict with asyncio event loop on Windows
- Added progress indicators for key generation, exchange, connection
- Added animated 3D spinning cube in UI
- Updated RSA key from 512 to 2048 bits

CLI:
- Removed unnecessary asyncio.run() wrapper
- Simplified entry point
2026-01-02 14:42:33 +03:00
mirai
6411df575e Updated to modern version of Optional type 2025-11-18 10:46:15 +04:00
mirai
64b0967292 Fix renderer typing, preserve message text, and harden crypto key handling
Fix abstract renderer signatures and add small stubs so type checkers can
see expected attributes (e.g. username, _decrypt). This removes several
mypy false-positives that were caused by mixin/ABC mismatches.
Preserve message text containing ':' by using split(':', 1) in both
DefaultClientRenderer and RichClientRenderer.
Normalize renderer APIs: print_chat(...) now takes the response mapping
and returns None (matches runtime behavior).
Make RSA symmetric-key request more robust: read r.content instead of a
fixed-size r.raw.read(999), avoiding truncated key material.
Improve _connect_ws exception handling in client to ensure a valid
Exception is re-raised if connection attempts fail.
Correct server/service typing: memory_msgs is now typed as
list[Message] and we null-check incoming payload text before creating a
new Message.
Replace manual package list in setup.py with setuptools.find_packages()
so packaging uses valid Python package names.
Installed types-requests in the project venv so mypy no longer flags the
requests import.
Verification: ran python -m compileall and mypy cmd_chat — no issues
remain.
Notes:

Wire format still uses Python literal evaluation in some places (existing
behavior); switching to JSON for client/server payloads is recommended as a
follow-up for robustness and security.
2025-11-05 19:29:24 +05:30
mirai
c3467b89ae removed temporary files 2025-10-03 21:08:43 +03:00
mirai
82a78e7053 Update client.py 2025-10-03 20:58:44 +03:00
mirai
b0ff612023 Password update 2025-09-10 19:58:59 +03:00
mirai
6a044ecaf8 Working on 1.1.22 2023-12-03 16:18:09 +03:00
mirai
316a0e3e1e Reworked setup.py, now you can run cmd_chat directly. Reworked sanic http webserver to make it work. Update readme, etc... 2023-11-27 14:30:01 +03:00
mirai
c5fa982f65 Add CLI run options, update README 2023-11-27 06:50:16 +03:00
mirai
8c4799c634 Removed eval, fixed security vulnerability 2023-11-27 05:45:45 +03:00
mirai
4554d76d0b PyPi Update 2023-03-08 19:26:21 +03:00
mirai
a8f296c0f1 Code refactoring 2023-03-08 18:59:38 +03:00