Implement networking, RSA authentication, and persistent chat - #2
Merged
Conversation
Jochengehtab
approved these changes
Jul 12, 2026
Member
|
Please run clang format before merging |
There was a problem hiding this comment.
Pull request overview
This PR introduces an end-to-end client/server messenger implementation: a shared versioned protocol, TCP networking, RSA-based challenge/response authentication, and SQLite-backed persistence, plus a Qt Quick/QML client UI and updated documentation.
Changes:
- Adds a shared protocol (
Message, message types, limits, transcript + RNG helpers) used by both client and server. - Implements server-side session handling, authentication flow, registration request workflow, message broadcast, and SQLite storage/migrations.
- Implements a Qt Quick client UI with connection/key management plus client-side authentication and message send/receive logic.
Reviewed changes
Copilot reviewed 23 out of 26 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/shared/message.h | Defines protocol constants, message types, Message struct, transcript + RNG helpers. |
| src/shared/message.cpp | Implements QDataStream serialization, transcript encoding, secure random bytes helper. |
| src/shared/CMakeLists.txt | Adds Messenger-Shared static library and exports includes/Qt dependency. |
| src/server/Storage/message_store.h | Declares SQLite-backed storage API for users, registration requests, and messages. |
| src/server/Storage/message_store.cpp | Implements SQLite open/migrations, registration request/user management, message save/load. |
| src/server/session.h | Declares per-connection session state, authentication context, and socket IO signals/slots. |
| src/server/session.cpp | Implements message IO framing via QDataStream transactions + authentication timeout handling. |
| src/server/server.h | Expands server into a QObject with QTcpServer, active sessions, and MessageStore. |
| src/server/server.cpp | Implements listen/shutdown, auth handshake, registration request handling, broadcast + admin CLI. |
| src/server/Migrations/001_create_messages.sql | Adds initial schema for users and messages + indexes. |
| src/server/Migrations/002_create_registration_requests.sql | Adds schema for registration requests + indexes/constraints. |
| src/server/CMakeLists.txt | Links Qt Core/Network/Sql, shared protocol lib + RSA lib; copies migrations post-build. |
| src/client/network_manager.h | Declares QML-facing networking/authentication state machine and signals. |
| src/client/network_manager.cpp | Implements TCP connect/auth, challenge signing, protocol parsing, and chat message send/receive. |
| src/client/connection_store.h | Declares persistent connection/key storage and background RSA key generation controls. |
| src/client/connection_store.cpp | Implements key management on disk, settings persistence, and async key generation workflow. |
| src/client/CMakeLists.txt | Links QuickControls2 + shared protocol + RSA, adds new client sources. |
| src/client/client.h | Adds owned NetworkManager and ConnectionStore for QML context. |
| src/client/client.cpp | Wires up QML context properties, sets app/org names, sets Quick style. |
| src/client/Main.qml | Implements full UI for connect/auth, RSA key management, and chat interface. |
| docs/connection-establishment.md | Documents handshake, message types, transcript definition, and server/client behavior. |
| README.md | Updates product/architecture overview and references authentication flow documentation. |
| .gitignore | Ignores SQLite artifacts and IDE settings directory. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements the complete client-server communication flow for the messenger. It adds a Qt/QML user interface, RSA-based authentication, user management, and persistent chat history using SQLite.
Changes
Security