mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-21 00:55:09 -07:00
Some checks are pending
Build Desktop / Configure (push) Waiting to run
Build Desktop / Debian 13 (push) Blocked by required conditions
Build Desktop / Debian 12 (push) Blocked by required conditions
Build Desktop / Fedora 44 (push) Blocked by required conditions
Build Desktop / Fedora 43 (push) Blocked by required conditions
Build Desktop / Servatrice_Debian 12 (push) Blocked by required conditions
Build Desktop / Ubuntu 26.04 (push) Blocked by required conditions
Build Desktop / Ubuntu 24.04 (push) Blocked by required conditions
Build Desktop / Arch (push) Blocked by required conditions
Build Desktop / macOS 15 (push) Blocked by required conditions
Build Desktop / macOS 13 Intel (push) Blocked by required conditions
Build Desktop / macOS 14 (push) Blocked by required conditions
Build Desktop / macOS 15 Debug (push) Blocked by required conditions
Build Desktop / Windows 10 (push) Blocked by required conditions
Build Docker Image / amd64 & arm64 (push) Waiting to run
* [Server/Client/Protocol] Reporting users + moderation queue functionality Took 6 minutes Took 3 minutes Took 8 seconds Took 11 minutes Took 12 minutes Took 7 minutes Took 15 seconds Took 2 minutes Took 1 minute Took 30 seconds Took 16 seconds * CI Fix Took 6 minutes * CI Fix Took 6 minutes * [Protocol] Add moderation investigation commands Adds the protocol layer for the moderation investigation suite: - Command_GetUserSessions/GetUserAlts/GetModeratorLastLogins/ResetUserPassword/RemoveUserAvatar (1013-1017) - Response extensions 1215-1219 with ServerInfo messages for sessions, alts, and staff logins - last_login on Response_ReportUserInfo and warning_il on Response_WarnList Took 2 minutes * [Utility] Add warning categories parser with infraction levels Parses the server's 'officialwarnings' setting (comma-separated, optional '|IL' suffix) into WarningCategory structs so the client can display the infraction level of each warning category. Includes GTest coverage. * [Server] Add moderation investigation tools Implements the server side of the moderation suite: - getUserSessions/getUserAlts/getModeratorLastLogins/removeUserAvatar DB methods - Handlers for all five new commands with audit records (PASSWORD_RESET, REMOVE_USER_AVATAR); password resets return a generated temporary password - cmdGetWarnList now reports per-category infraction levels from the officialwarnings setting; cmdReportUserInfo reports last_login - Update servatrice.ini.example with the warning taxonomy - Password/avatar mutations report RespNameNotFound when the user does not exist * [Client] Add moderation tab with investigate, password reset, and avatar removal - New Moderation tab: search a user to show account info, alternate accounts, login sessions, and staff last logins; actions to reset the user's password (shows the generated temporary password) and remove the user's avatar - 'Investigate user' entry in the user context menu opens the tab pre-loaded for that user - Warning dialog shows the infraction level of each warning category - Tab wired into TabSupervisor with a moderator-gated menu action, shortcut, and tabs.ini persistence (default closed) * [Server/Client/Protocol] Address PR #7091 review: security, bug, and perf fixes Security: - Promote RESET_USER_PASSWORD to admin-only dispatch (was moderator-accessible) - Reject password reset on users with equal/higher privilege than caller - Notify affected user via Event_NotifyUser::CUSTOM when password is reset - Add server-side category whitelist for reports - Drop reporter name fallback in comment/details authorization (ID-only) - Force password change: new DB column + login enforcement + client disconnect Bugs: - XSS via QTextEdit::append() → insertPlainText() in report tab and utils - allNotified initialized to true even with empty recipients list - Warning combo box: use currentData() instead of baked-in display text - Report resolution now records who resolved (resolved_by column + audit) Performance: - IP-correlation subquery: add 6-month window + LIMIT 200 - getUserSessions: clamp limit to 500 Non-blocking: - Palette-aware colors in report_utils.cpp (dark/light mode) - Report list pagination: offset/limit fields + total_count in response - SessionCommand enum gap comment for reserved values 1201-1203 Schema: 36→37 (force_password_change), 37→38 (resolved_by) Took 12 minutes Took 16 seconds * Fix macOs pedantry Took 5 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
90 lines
5.9 KiB
Protocol Buffer
90 lines
5.9 KiB
Protocol Buffer
syntax = "proto2";
|
||
|
||
/// Server response envelope linking to a command
|
||
/**
|
||
* This message is sent immediately after a client command, using the same `cmd_id`
|
||
* to connect the response to the command.
|
||
*
|
||
* Responses may contain standard outcome codes (`ResponseCode`) and indicate
|
||
* what type of response the server is sending (`ResponseType`).
|
||
*/
|
||
message Response {
|
||
|
||
// Outcome of the command sent by the client
|
||
enum ResponseCode {
|
||
RespNotConnected = -1; // Client is not connected or session expired
|
||
RespNothing = 0; // No response required
|
||
RespOk = 1; // Command succeeded
|
||
RespNotInRoom = 2; // Client is not in the room for this command
|
||
RespInternalError = 3; // Server encountered an unexpected error
|
||
RespInvalidCommand = 4; // Command was invalid or unrecognized
|
||
RespInvalidData = 5; // Command data was invalid or malformed
|
||
RespNameNotFound = 6; // Target user not found
|
||
RespLoginNeeded = 7; // Client must log in first
|
||
RespFunctionNotAllowed = 8; // Client tried to perform a restricted action
|
||
RespGameNotStarted = 9; // Game has not started yet
|
||
RespGameFull = 10; // Game is full
|
||
RespContextError = 11; // Context (room/game) mismatch
|
||
RespWrongPassword = 12; // Password for this room or game is incorrect
|
||
RespSpectatorsNotAllowed = 13; // Spectators are not allowed in this room/game
|
||
RespOnlyBuddies = 14; // Only buddies can perform this action
|
||
RespUserLevelTooLow = 15; // User’s permission level is insufficient
|
||
RespInIgnoreList = 16; // Target user has ignored the client
|
||
RespWouldOverwriteOldSession = 17; // Would overwrite an existing session
|
||
RespChatFlood = 18; // Too many messages sent in short time
|
||
RespUserIsBanned = 19; // Client is banned
|
||
RespAccessDenied = 20; // Access to this action is denied
|
||
RespUsernameInvalid = 21; // Username is invalid
|
||
RespRegistrationRequired = 22; // Registration is required
|
||
RespRegistrationAccepted = 23; // Server agrees to process client's registration request
|
||
RespUserAlreadyExists = 24; // Client attempted to register a name which is already registered
|
||
RespEmailRequiredToRegister = 25; // Server requires email to register accounts but client did not provide one
|
||
RespTooManyRequests = 26; // Server refused to complete command because client has sent too many too quickly
|
||
RespPasswordTooShort = 27; // Server requires a decent password
|
||
RespAccountNotActivated =
|
||
28; // Client attempted to log into a registered username but the account hasn't been activated
|
||
RespRegistrationDisabled = 29; // Server does not allow clients to register
|
||
RespRegistrationFailed = 30; // Server accepted a reg request but failed to perform the registration
|
||
RespActivationAccepted = 31; // Server accepted a reg user activation token
|
||
RespActivationFailed = 32; // Server didn't accept a reg user activation token
|
||
RespRegistrationAcceptedNeedsActivation =
|
||
33; // Server accepted client registration, but it will need token activation
|
||
RespClientIdRequired = 34; // Server requires client to generate and send its client id before allowing access
|
||
RespClientUpdateRequired = 35; // Client is missing features that the server is requiring
|
||
RespServerFull = 36; // Server user limit reached
|
||
RespEmailBlackListed = 37; // Server has blocked the email address provided for registration for some reason
|
||
RespPasswordChangeRequired = 38; // Server requires the user to change their password before proceeding
|
||
}
|
||
|
||
// Type of response, used to route handling on the client
|
||
enum ResponseType {
|
||
JOIN_ROOM = 1000; // Response for joining a room
|
||
LIST_USERS = 1001; // Response listing users
|
||
GET_GAMES_OF_USER = 1002; // Response with user's games
|
||
GET_USER_INFO = 1003; // Response with user info
|
||
DUMP_ZONE = 1004; // Response with zone dump
|
||
LOGIN = 1005; // Response to login attempt
|
||
DECK_LIST = 1006; // Response with deck list
|
||
DECK_DOWNLOAD = 1007; // Response for deck download
|
||
DECK_UPLOAD = 1008; // Response for deck upload
|
||
REGISTER = 1009; // Response to registration
|
||
ACTIVATE = 1010; // Response to activation
|
||
ADJUST_MOD = 1011; // Response to mod adjustments
|
||
BAN_HISTORY = 1012; // Response with ban history
|
||
WARN_HISTORY = 1013; // Response with warn history
|
||
WARN_LIST = 1014; // Response with current warnings
|
||
VIEW_LOG = 1015; // Response with logs
|
||
FORGOT_PASSWORD_REQUEST = 1016; // Response to password reset request
|
||
PASSWORD_SALT = 1017; // Response containing password salt
|
||
GET_ADMIN_NOTES = 1018; // Response with admin notes
|
||
REPLAY_LIST = 1100; // Response listing replays
|
||
REPLAY_DOWNLOAD = 1101; // Response for replay download
|
||
REPLAY_GET_CODE = 1102; // Response containing replay code
|
||
CARD_ART_RULE_LIST = 1200; // Response containing a list of card art rules
|
||
}
|
||
|
||
required uint64 cmd_id = 1; // Command ID that this response corresponds to
|
||
optional ResponseCode response_code = 2; // Outcome code of the command
|
||
|
||
extensions 100 to max; // Protobuf extensions reserved for future use
|
||
}
|