Skip to content

Implement networking, RSA authentication, and persistent chat - #2

Merged
LordofGhost merged 41 commits into
mainfrom
feature/networking
Jul 12, 2026
Merged

Implement networking, RSA authentication, and persistent chat#2
LordofGhost merged 41 commits into
mainfrom
feature/networking

Conversation

@LordofGhost

Copy link
Copy Markdown
Member

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

  • Implement TCP communication between the client and server
  • Add a shared, versioned messaging protocol
  • Implement RSA-based challenge-response authentication
  • Add registration requests that can be approved or rejected through the server CLI
  • Add local RSA key management and storage to the client
  • Persist users and chat messages using SQLite
  • Load and distribute previous chat history
  • Broadcast new messages to authenticated clients
  • Add server commands for:
    • Listing, approving, and rejecting registration requests
    • Listing and deleting users
    • Clearing the chat history
  • Add a Qt Quick UI for connections, key management, and chatting
  • Expand the README with feature details and screenshots
  • Document the connection and authentication flow
  • Update the RSA submodule

Security

  • Private RSA keys remain exclusively on the client.
  • Each authentication attempt uses fresh client and server nonces.
  • Messages and chat history are only available after successful authentication.
  • Invalid protocol versions, message types, and signatures are rejected.
  • Authentication attempts have a timeout.

Copilot AI review requested due to automatic review settings July 12, 2026 18:26
@Jochengehtab

Copy link
Copy Markdown
Member

Please run clang format before merging

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/client/connection_store.cpp
Comment thread src/client/connection_store.cpp
Comment thread src/server/Storage/message_store.cpp
Comment thread src/client/network_manager.h
Comment thread src/client/network_manager.h
@LordofGhost
LordofGhost merged commit b11483f into main Jul 12, 2026
7 checks passed
@LordofGhost
LordofGhost deleted the feature/networking branch July 12, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants