Commit Graph

177 Commits

Author SHA1 Message Date
stalcke2288969 e217716604 GITBOOK-7: No subject 2025-07-24 11:39:54 +00:00
Artemy a0ef087110 SessionControllerTests 2025-07-24 18:29:35 +07:00
Artemy 6a6c3d513d UserSessionRevoker 2025-07-24 18:05:11 +07:00
Artemy 15f9370dbe Created SessionController and UserSessionReader
+ tests for UserSessionReader
2025-07-24 17:03:51 +07:00
stalcke2288969 19f1ccdfd5 GitBook: No commit message 2025-07-24 08:07:52 +00:00
Artemy 53ea25f9fd small fix 2025-07-24 14:45:01 +07:00
Artemy 73f22a3ace more tests for PresenceHub 2025-07-24 13:54:59 +07:00
Artemy caefcd5827 test 2025-07-24 13:43:51 +07:00
Artemy d5299f2b79 Create PresenceHubTests.cs 2025-07-23 22:46:16 +07:00
Artemy e277159022 UserNotificationScopeServiceTests 2025-07-23 22:41:46 +07:00
Artemy be0edb0f94 Refactor user ID access in SignalR hubs and add online user tracking
Introduces IHubUserAccessor and its implementation to centralize user ID retrieval from SignalR HubCallerContext, replacing duplicated logic in ChatsHub, FriendsHub, and PresenceHub. Moves extension and mapping files to a Common directory, adds UserToUserDtoMappingAction for online status mapping, and implements OnlineUserStore with tests for tracking online users. Updates dependency injection and test code to use the new abstractions.
2025-07-23 22:21:51 +07:00
Artemy 31fdf4cb37 Add user online presence tracking and notification
Introduced interfaces and services for tracking user online status, including IOnlineUserStore, IUserNotificationScopeService, and IUserPresenceReader. Added PresenceHub for real-time presence updates via SignalR. Updated OnlinePingingController to use new services and return online status and last seen. Extended UserDto with IsOnline property. Updated dependency injection and privacy settings enum. Removed obsolete IUserPresenceService.
2025-07-23 21:07:29 +07:00
Artemy cbff5857e7 Update ChatLoadControllerTests.cs 2025-07-23 15:11:33 +07:00
Artemy b24649e53a Refactor message loading API and add message query support
Reworked message loading endpoints and services to support flexible message querying with 'before' and 'after' parameters via a new MessageQuery contract. Updated controller actions, service interfaces, and implementations to use the new query model, and improved error handling. Added integration tests for ChatLoadController and introduced IUserPresenceService interface. Minor fixes and help text improvements in console client commands.
2025-07-23 13:06:34 +07:00
Artemy 1fc13000b1 RefreshControllerTests 2025-07-21 18:05:30 +07:00
Artemy 10b4e5207f bug fix 2025-07-21 17:20:35 +07:00
Artemy 93004a26b3 Unauthorized changet to Forbid 2025-07-21 17:16:51 +07:00
Artemy 4054e4046a New Settings entity 2025-07-21 17:06:01 +07:00
Artemy c434ca447c Media Controller Tests and other 2025-07-21 16:18:04 +07:00
Artemy c0d02e0fa1 Add access control for media downloads
Introduced IAccesserToDownloadMedia and its implementation to enforce access checks when downloading media files. Updated MediaController to use the new accesser service and improved error handling and validation in upload/download actions. Refactored and moved MediaService to the Medias namespace, registered new services in DI, and added comprehensive tests for access logic. Also fixed GroupMembershipConfiguration to make InvitationId optional and performed minor test and namespace cleanups.
2025-07-21 14:51:57 +07:00
Artemy 58e7716ded MessagesLoaderTests 2025-07-21 13:42:41 +07:00
Artemy 50d53d1ea4 Create MediaControllerTests.cs 2025-07-19 23:55:49 +07:00
Artemy 272809d1d8 AppTests 2025-07-19 23:18:08 +07:00
Artemy f524a9f0b7 Refactor console client to new Govor.ConsoleClient project
Removed Govor.Console implementation and introduced a new Govor.ConsoleClient project with a modular command-based architecture. Added dependency injection, command dispatcher, middleware pipeline, logging, and interactive command support. Updated solution and project files to reflect the new structure.
2025-07-19 19:08:21 +07:00
Artemy ff873ae179 Implement refresh token flow and refactor session handling
Added refresh token endpoint and controller, introduced IUserSessionRefresher and UserSessionRefresher for token renewal, and updated session handling to return both access and refresh tokens. Refactored AuthController, tests, and related interfaces to support new token flow. Fixed JwtAccessOption property typo, updated configuration, and extended UserSessionsRepository to support lookup by refresh token.
2025-07-19 17:51:06 +07:00
Artemy ab643c16a4 Implement user session management and JWT refresh tokens
Added user session models, interfaces, repository, and service for managing user sessions and refresh tokens. Refactored authentication flow to return user objects and open sessions with device info, supporting refresh token generation and validation. Updated JWT configuration to separate access and refresh options, and refactored related tests and API contracts. Improved media upload handling and error logging. Migrated dependency references and DI registrations accordingly.
2025-07-18 20:16:36 +07:00
Artemy 6063aafd9e Refactor friend request and media services, remove console commands
Refactored the friend request command service and SignalR hub to return and broadcast FriendshipDto objects, improving real-time updates. Enhanced media upload and download logic to support file storage and retrieval, including database integration. Removed all command classes and related infrastructure from the Govor.Console project, streamlining the console client. Updated dependency injection and interfaces to reflect these changes.
2025-07-13 19:03:01 +07:00
Artemy 97b2ea14b2 Test for friends controllers 2025-07-12 19:51:15 +07:00
Artemy 96587b491d Add AutoMapper and message response models
Introduced AutoMapper to the API project and registered it in the DI container. Added mapping profiles for core models to DTOs and response objects. Refactored controllers to use AutoMapper for mapping entities to response DTOs. Implemented new response models for messages, media attachments, reactions, and views. Updated MessagesLoader to load messages with related data. Added a migration to support ChatGroupId in messages. Updated dependencies and fixed minor issues in related files.
2025-07-12 16:39:06 +07:00
Artemy c7de2318fc using Govor.Core.Models.Users; 2025-07-11 21:52:37 +07:00
Artemy 9d06984e8c rework console client 2025-07-11 15:52:10 +07:00
Artemy 2ddc7ae699 Merge pull request #3 from Govor-team/feat/console-command-refactor
I refactored Govor.Console to use the command pattern. Here's what I …
2025-07-11 08:54:23 +03:00
google-labs-jules[bot] b42c7d6de6 I refactored Govor.Console to use the command pattern. Here's what I did:
- I implemented a command-based architecture for Govor.Console.
- Each of your actions (e.g., login, send friend request, list friends) is now encapsulated in its own command class inheriting from BaseCommand.
- I integrated friend-related functionalities (search, list, send/accept/reject request, block/unblock) using a mix of SignalR Hub and REST API calls.
- I included admin functionalities for managing friendships (list all, list user's, remove).
- I added a /help (-h) command to display available commands and their usage.
- I refactored Program.cs to handle command parsing and execution.
- I updated FriendsClient.cs, removing methods now handled directly by commands via SignalR.
- I added SignalR event handlers for real-time notifications (friend requests, accepts, etc.).
2025-07-11 05:47:22 +00:00
Artemy e8e2078514 app.MapHub<FriendsHub>("/api/friends"); 2025-07-11 12:19:32 +07:00
Artemy d9dfaff079 Refactor EF tests 2025-07-10 18:11:46 +07:00
Artemy 65a43c09d3 Refactor message service and move tests to Application.Tests
Renamed IMessageService to IMessageCommandService and updated all usages accordingly. Moved and renamed test files from Govor.API.Tests to the new Govor.Application.Tests project, updating namespaces to match. Refactored message-related services and controllers to use the new naming and structure. Added Govor.Application.Tests project to the solution.
2025-07-10 18:05:10 +07:00
Artemy a43a26b307 FriendsHubTests 2025-07-10 16:12:32 +07:00
Artemy 437bedb117 Refactor friend request services and add SignalR error handling
Split IFriendRequestService into command and query interfaces, refactor related services and tests, and update dependency injection. Add HubResult response model and a SignalR HubExceptionFilter for consistent error handling. Move and update FriendsHub to use new command service and result pattern. Update username validation to allow digits after Cyrillic letters. Add new controllers and configuration for SignalR. Remove obsolete IFriendRequestService and related code.
2025-07-10 15:31:57 +07:00
Artemy b1f3aa0266 rework and starts for new friends system 2025-07-08 22:28:04 +07:00
Artemy 92c1ff6458 IUserGroupsService + tests 2025-07-07 21:06:04 +07:00
Artemy a68feb4a17 Refactor group existence checks and add group repo tests
Renamed IGroupsExist and related methods from Exists to Exist for consistency. Added integration tests for GroupRepository. Introduced entity configurations for ChatGroup, GroupAdmins, GroupInvitation, and updated GroupMembership configuration. Updated usages and tests to match new method names and improved equality checks for ChatGroup.
2025-07-07 20:49:20 +07:00
Artemy 42be589a26 Update ChatGroupValidatorTests.cs 2025-07-07 19:46:45 +07:00
Artemy baeafad007 PrivateChatsRepositoryTests 2025-07-07 19:33:47 +07:00
Artemy b027b20fc3 ChatGroupValidator 2025-07-07 14:05:11 +07:00
Artemy 2cb6a93060 Add private chat support and group model enhancements
Introduces repositories, validators, and integration tests for private chats. Refactors group-related models to support invitations and memberships, updates group repository interfaces and implementations, and enhances message service logic to handle private chat creation and retrieval. Also registers new services and validators in DI, and updates related tests.
2025-07-07 13:55:29 +07:00
Artemy 66819a015a Refactor media attachments to use MediaFile entity
This commit introduces the MediaFile entity and updates the media attachments model, repositories, and related logic to reference MediaFile instead of storing file metadata directly in MediaAttachments. Controller, service, and SignalR request/response contracts are updated to support the new structure. Database configurations and validators are also adjusted accordingly. This refactor improves media management and normalization in the data model.
2025-07-06 21:09:12 +07:00
Artemy 42348c863f Add admin friendships controller and improve friend request handling
Introduces FriendshipsController for admin operations, including listing and removing friendships. Updates routing for admin controllers, improves error handling in UsersController, and enhances FriendsController and related services to include requester details in friendship DTOs. Refactors friend request acceptance to use query parameters and updates console client for improved user feedback and local development configuration.
2025-07-06 17:43:10 +07:00
Artemy 857751f0ad userId update in ChatHub 2025-07-06 16:02:45 +07:00
Artemy 6062113655 Add unit tests and implement group repository interfaces
Introduces comprehensive unit tests for MessageService covering send, edit, and delete message scenarios. Adds and implements IGroupsRepository, IGroupsReader, and IGroupsWriter interfaces with method stubs in GroupRepository. Updates ChatGroup model with Description and ImageId fields, and registers GroupRepository in DI. Fixes parameter order in SendMessage record.
2025-07-06 15:44:45 +07:00
Artemy 89f14c134f VerifyFriendshipTests 2025-07-06 14:22:50 +07:00