Repository navigation
feat(desktop): network layer, auth and API services (DTO, ApiClient, AuthService, secure storage) - #9
Merged
Merged
Conversation
…minService, storage backends, and unit tests
… GoogleTest suite in CMakeLists.txt and vcpkg.json
…orage signatures and test models
…d windeployqt in CMake
…AuthService tests
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.
What was added
Network layer, authentication, and services for the desktop client (files 02 and 03 from
docs/desktop-migration).ApiContracts.hpp): models synced with the real API (packages/api-contractsandapps/api). Supported both naming conventions (questionScores/question_scores),Unknownfor unrecognized enums,std::optionalviaadl_serializer, and error parsing for three formats ({error, code}, ProblemDetails, Supabase Auth).isWakingUpstate, retries for GET requests only (up to 2), refresh queue on 401 with request replay./auth/v1/token,/auth/v1/signup),GET /api/auth/me, "confirm email" handling,restoreSession(), andmockLoginwithout the admin role in Release.getOptions()) and AdminService.ISecureStorageinterface,QtKeychainSecureStorage, andInMemorySecureStorageimplementations. Access and refresh tokens are stored under separate keys; no tokens are saved to disk.ApiClient(refresh queue on a localQTcpServer),AuthService.Changes in shared files
CMakeLists.txt: added Qt6Keychain, test target, andwindeployqt.vcpkg.json: addedbuiltin-baseline,qtkeychain-qt6, andgtest..env.example,.gitignore.What the team needs to know
ISecureStorageacceptsstd::string_view(notconst std::string&).ApiErrorhas an explicit constructor.InterviewService::getOptions()(GET /api/options), do not hardcode them. The backend includes aseniorlevel, andtraineemight be missing.DEV_DIALOGUE_SUPABASE_ANON_KEY, Supabase URL, and API URL (see.env.example). The client only uses the anon key.How to test
Build in "x64 Native Tools Command Prompt for VS" (MSVC + Ninja):
Verified: Release and Debug builds, 27 out of 27 tests passed.
Known limitations (to be addressed separately)
ApiClientandAuthService). We need to keep only one and add a test for simultaneous scheduled refresh and a 401 error.QtKeychainSecureStoragehas not been tested on a live OS credential vault.InterviewServiceandAdminServicedo not have tests yet.NavigationViewModeland registration inmain.cppare not included in this PR.