* @brief Process a single command request; remote-origin device-write commands must clear the * user consent gate first, matching the raw byte paths. */
| 152 | * user consent gate first, matching the raw byte paths. |
| 153 | */ |
| 154 | API::CommandResponse API::CommandHandler::processCommand(const CommandRequest& request, |
| 155 | const CommandOrigin origin) |
| 156 | { |
| 157 | const bool remote = (origin == CommandOrigin::Remote); |
| 158 | if (remote && !Server::instance().authorizeRemoteCommand(request.command)) { |
| 159 | return CommandResponse::makeError( |
| 160 | request.id, ErrorCode::ExecutionError, QStringLiteral("Device write denied by user")); |
| 161 | } |
| 162 | |
| 163 | return CommandRegistry::instance().execute(request.command, request.id, request.params); |
| 164 | } |
| 165 | |
| 166 | //-------------------------------------------------------------------------------------------------- |
| 167 | // Batch processing |
no test coverage detected