diff --git a/TODO b/TODO index d25ba89f..343ebbcc 100644 --- a/TODO +++ b/TODO @@ -61,7 +61,7 @@ - Make a dedicated audio layout in mobile environment (keep the same layout for videos?) - Handle internal path -[Remote API] +[Lms API] - Implement partial text search options in the GetXXX messages [REST API] diff --git a/src/Makefile.am b/src/Makefile.am index ef3bb63e..e537e5c2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -67,14 +67,14 @@ lms_SOURCES = \ if LMSAPI lms_SOURCES += \ - $(srcdir)/remote/server/Connection.cpp \ - $(srcdir)/remote/server/ConnectionManager.cpp \ - $(srcdir)/remote/server/AudioCollectionRequestHandler.cpp \ - $(srcdir)/remote/server/AuthRequestHandler.cpp \ - $(srcdir)/remote/server/MediaRequestHandler.cpp \ - $(srcdir)/remote/server/RequestHandler.cpp \ - $(srcdir)/remote/server/Server.cpp \ - $(srcdir)/service/RemoteServerService.cpp + $(srcdir)/lms-api/server/Connection.cpp \ + $(srcdir)/lms-api/server/ConnectionManager.cpp \ + $(srcdir)/lms-api/server/AudioCollectionRequestHandler.cpp \ + $(srcdir)/lms-api/server/AuthRequestHandler.cpp \ + $(srcdir)/lms-api/server/MediaRequestHandler.cpp \ + $(srcdir)/lms-api/server/RequestHandler.cpp \ + $(srcdir)/lms-api/server/Server.cpp \ + $(srcdir)/service/LmsAPIServerService.cpp nodist_lms_SOURCES = \ $(builddir)/auth.pb.cc \ @@ -112,10 +112,10 @@ MOSTLYCLEANFILES = \ $(builddir)/messages.pb.cc \ $(builddir)/messages.pb.h -%.pb.cc %.pb.h: $(srcdir)/remote/proto/%.proto - $(PROTOC) --proto_path=$(srcdir)/remote/proto/ --cpp_out=$(builddir)/ $^ +%.pb.cc %.pb.h: $(srcdir)/lms-api/proto/%.proto + $(PROTOC) --proto_path=$(srcdir)/lms-api/proto/ --cpp_out=$(builddir)/ $^ endif -lms_CXXFLAGS=-DBOOST_LOG_DYN_LINK -std=c++11 -Wall -I$(top_srcdir)/third-party -I$(srcdir)/ui -I$(srcdir)/remote +lms_CXXFLAGS=-DBOOST_LOG_DYN_LINK -std=c++11 -Wall -I$(top_srcdir)/third-party -I$(srcdir)/ui -I$(srcdir)/lms-api diff --git a/src/config/ConfigReader.hpp b/src/config/ConfigReader.hpp index 5701a3b5..32ffbc56 100644 --- a/src/config/ConfigReader.hpp +++ b/src/config/ConfigReader.hpp @@ -27,7 +27,7 @@ #include "logger/Logger.hpp" #include "service/UserInterfaceService.hpp" -#include "service/RemoteServerService.hpp" +#include "service/LmsAPIServerService.hpp" #include "service/DatabaseUpdateService.hpp" class ConfigReader diff --git a/src/remote/messages/Header.hpp b/src/lms-api/messages/Header.hpp similarity index 98% rename from src/remote/messages/Header.hpp rename to src/lms-api/messages/Header.hpp index e98ac5b2..6744b343 100644 --- a/src/remote/messages/Header.hpp +++ b/src/lms-api/messages/Header.hpp @@ -24,7 +24,7 @@ #include -namespace Remote +namespace LmsAPI { @@ -104,7 +104,7 @@ class Header -} // namespace Remote +} // namespace LmsAPI #endif diff --git a/src/lms-api/proto/auth.proto b/src/lms-api/proto/auth.proto new file mode 100644 index 00000000..b054ef06 --- /dev/null +++ b/src/lms-api/proto/auth.proto @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2013 Emeric Poupon + * + * This file is part of LMS. + * + * LMS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * LMS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with LMS. If not, see . + */ + +import "common.proto"; + +package LmsAPI; + +message AuthRequest +{ + message Password + { + required string user_login = 1; + required string user_password = 2; + } + + enum Type + { + TypePassword = 1; + } + + required Type type = 1; + + optional Password password = 2; +} + +message AuthResponse +{ + + message PasswordResult + { + enum Type + { + TypePasswordInvalid = 1; + TypeLoginThrottling = 2; // The attempt was not processed because of throttling + TypePasswordValid = 3; + } + required Type type = 1; + + optional uint32 delay = 2; // in seconds, in case of PasswordInvalid/LoginThrottling + } + + enum Type + { + TypePasswordResult = 1; + } + + required Type type = 1; + + optional PasswordResult password_result = 2; +} + diff --git a/src/remote/proto/collection.proto b/src/lms-api/proto/collection.proto similarity index 82% rename from src/remote/proto/collection.proto rename to src/lms-api/proto/collection.proto index a5cc6944..8037ab02 100644 --- a/src/remote/proto/collection.proto +++ b/src/lms-api/proto/collection.proto @@ -1,6 +1,25 @@ +/* + * Copyright (C) 2013 Emeric Poupon + * + * This file is part of LMS. + * + * LMS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * LMS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with LMS. If not, see . + */ + import "common.proto"; -package Remote; +package LmsAPI; message AudioCollectionRequest { diff --git a/src/lms-api/proto/common.proto b/src/lms-api/proto/common.proto new file mode 100644 index 00000000..3042d84d --- /dev/null +++ b/src/lms-api/proto/common.proto @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2013 Emeric Poupon + * + * This file is part of LMS. + * + * LMS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * LMS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with LMS. If not, see . + */ + +package LmsAPI; + +message Error +{ + required bool error = 1; + optional string message = 2; +} + diff --git a/src/remote/proto/media.proto b/src/lms-api/proto/media.proto similarity index 76% rename from src/remote/proto/media.proto rename to src/lms-api/proto/media.proto index acb5d787..5dae7257 100644 --- a/src/remote/proto/media.proto +++ b/src/lms-api/proto/media.proto @@ -1,8 +1,25 @@ +/* + * Copyright (C) 2013 Emeric Poupon + * + * This file is part of LMS. + * + * LMS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * LMS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with LMS. If not, see . + */ + import "common.proto"; -package Remote; - - +package LmsAPI; message MediaRequest { diff --git a/src/remote/proto/messages.proto b/src/lms-api/proto/messages.proto similarity index 62% rename from src/remote/proto/messages.proto rename to src/lms-api/proto/messages.proto index b9b2f704..7ba930c3 100644 --- a/src/remote/proto/messages.proto +++ b/src/lms-api/proto/messages.proto @@ -1,9 +1,29 @@ +/* + * Copyright (C) 2013 Emeric Poupon + * + * This file is part of LMS. + * + * LMS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * LMS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with LMS. If not, see . + */ + import "common.proto"; + import "auth.proto"; import "collection.proto"; import "media.proto"; -package Remote; +package LmsAPI; // Every request sent by the client must be a ClientMessage // The server will answer using a ServerMessage diff --git a/src/remote/server/AudioCollectionRequestHandler.cpp b/src/lms-api/server/AudioCollectionRequestHandler.cpp similarity index 99% rename from src/remote/server/AudioCollectionRequestHandler.cpp rename to src/lms-api/server/AudioCollectionRequestHandler.cpp index 63344ead..2f4a5427 100644 --- a/src/remote/server/AudioCollectionRequestHandler.cpp +++ b/src/lms-api/server/AudioCollectionRequestHandler.cpp @@ -29,7 +29,7 @@ #include "database/Types.hpp" #include "cover/CoverArtGrabber.hpp" -namespace Remote { +namespace LmsAPI { namespace Server { using namespace Database; @@ -387,7 +387,7 @@ AudioCollectionRequestHandler::processGetRevision(AudioCollectionResponse::Revis -} // namespace Remote +} // namespace LmsAPI } // namespace Server diff --git a/src/remote/server/AudioCollectionRequestHandler.hpp b/src/lms-api/server/AudioCollectionRequestHandler.hpp similarity index 98% rename from src/remote/server/AudioCollectionRequestHandler.hpp rename to src/lms-api/server/AudioCollectionRequestHandler.hpp index 66c38a1e..5d7522c4 100644 --- a/src/remote/server/AudioCollectionRequestHandler.hpp +++ b/src/lms-api/server/AudioCollectionRequestHandler.hpp @@ -24,7 +24,7 @@ #include "messages.pb.h" -namespace Remote { +namespace LmsAPI { namespace Server { class AudioCollectionRequestHandler @@ -54,7 +54,7 @@ class AudioCollectionRequestHandler static const std::size_t _maxCoverArtSize = 512; // in pixels, square }; -} // namespace Remote +} // namespace LmsAPI } // namespace Server #endif diff --git a/src/remote/server/AuthRequestHandler.cpp b/src/lms-api/server/AuthRequestHandler.cpp similarity index 98% rename from src/remote/server/AuthRequestHandler.cpp rename to src/lms-api/server/AuthRequestHandler.cpp index f8f225c6..b0f98a70 100644 --- a/src/remote/server/AuthRequestHandler.cpp +++ b/src/lms-api/server/AuthRequestHandler.cpp @@ -23,7 +23,7 @@ #include "AuthRequestHandler.hpp" -namespace Remote { +namespace LmsAPI { namespace Server { AuthRequestHandler::AuthRequestHandler(Database::Handler& db) @@ -100,6 +100,6 @@ AuthRequestHandler::processPassword(const AuthRequest::Password& request, AuthRe return res; } -} // namespace Remote } // namespace Server +} // namespace LmsAPI diff --git a/src/remote/server/AuthRequestHandler.hpp b/src/lms-api/server/AuthRequestHandler.hpp similarity index 90% rename from src/remote/server/AuthRequestHandler.hpp rename to src/lms-api/server/AuthRequestHandler.hpp index c7ec1f29..363dcab2 100644 --- a/src/remote/server/AuthRequestHandler.hpp +++ b/src/lms-api/server/AuthRequestHandler.hpp @@ -17,14 +17,14 @@ * along with LMS. If not, see . */ -#ifndef REMOTE_AUTH_REQUEST_HANDLER -#define REMOTE_AUTH_REQUEST_HANDLER +#ifndef LMSAPI_AUTH_REQUEST_HANDLER +#define LMSAPI_AUTH_REQUEST_HANDLER #include "database/DatabaseHandler.hpp" #include "messages.pb.h" -namespace Remote { +namespace LmsAPI { namespace Server { class AuthRequestHandler @@ -41,7 +41,7 @@ class AuthRequestHandler Database::Handler& _db; }; -} // namespace Remote } // namespace Server +} // namespace LmsAPI #endif diff --git a/src/remote/server/Connection.cpp b/src/lms-api/server/Connection.cpp similarity index 90% rename from src/remote/server/Connection.cpp rename to src/lms-api/server/Connection.cpp index 619551af..27203b62 100644 --- a/src/remote/server/Connection.cpp +++ b/src/lms-api/server/Connection.cpp @@ -33,7 +33,7 @@ #include "ConnectionManager.hpp" #include "Connection.hpp" -namespace Remote { +namespace LmsAPI { namespace Server { Connection::Connection(boost::asio::io_service& ioService, @@ -79,11 +79,11 @@ void Connection::readMsg() { // Read a header first - boost::asio::streambuf::mutable_buffers_type bufs = _inputStreamBuf.prepare(Remote::Header::size); + boost::asio::streambuf::mutable_buffers_type bufs = _inputStreamBuf.prepare(LmsAPI::Header::size); boost::asio::async_read(_socket, bufs, - boost::asio::transfer_exactly(Remote::Header::size), + boost::asio::transfer_exactly(LmsAPI::Header::size), boost::bind(&Connection::handleReadHeader, shared_from_this(), boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); @@ -114,9 +114,9 @@ Connection::handleReadHeader(const boost::system::error_code& error, std::size_t { if (!error) { - if (bytes_transferred != Remote::Header::size) + if (bytes_transferred != LmsAPI::Header::size) { - LMS_LOG(MOD_REMOTE, SEV_ERROR) << "bytes_transferred (" << bytes_transferred << ") != Remote::Header::size!"; + LMS_LOG(MOD_REMOTE, SEV_ERROR) << "bytes_transferred (" << bytes_transferred << ") != LmsAPI::Header::size!"; _connectionManager.stop(shared_from_this()); return; } @@ -125,7 +125,7 @@ Connection::handleReadHeader(const boost::system::error_code& error, std::size_t std::istream is(&_inputStreamBuf); - Remote::Header header; + LmsAPI::Header header; if (!header.from_istream(is)) { LMS_LOG(MOD_REMOTE, SEV_ERROR) << "Cannot read header from buffer!"; @@ -161,8 +161,8 @@ Connection::handleReadMsg(const boost::system::error_code& error, std::size_t by std::istream is(&_inputStreamBuf); std::ostream os(&_outputStreamBuf); - Remote::ServerMessage response; - Remote::ClientMessage request; + LmsAPI::ServerMessage response; + LmsAPI::ClientMessage request; if (!request.ParseFromIstream(&is)) { @@ -188,23 +188,23 @@ Connection::handleReadMsg(const boost::system::error_code& error, std::size_t by return; } - if (_outputStreamBuf.size() >= Remote::Header::max_data_size) + if (_outputStreamBuf.size() >= LmsAPI::Header::max_data_size) { - LMS_LOG(MOD_REMOTE, SEV_ERROR) << "output message is too big! " << _outputStreamBuf.size() << " > " << Remote::Header::max_data_size; + LMS_LOG(MOD_REMOTE, SEV_ERROR) << "output message is too big! " << _outputStreamBuf.size() << " > " << LmsAPI::Header::max_data_size; _connectionManager.stop(shared_from_this()); return; } - std::array headerBuffer; + std::array headerBuffer; { - Remote::Header header; + LmsAPI::Header header; header.setDataSize(_outputStreamBuf.size()); header.to_buffer(headerBuffer); } std::size_t n = boost::asio::write(_socket, boost::asio::buffer(headerBuffer), - boost::asio::transfer_exactly(Remote::Header::size), + boost::asio::transfer_exactly(LmsAPI::Header::size), ec); if (ec) { @@ -213,7 +213,7 @@ Connection::handleReadMsg(const boost::system::error_code& error, std::size_t by } else { - assert(n == Remote::Header::size); + assert(n == LmsAPI::Header::size); } // Now send serialized payload @@ -247,4 +247,4 @@ Connection::handleReadMsg(const boost::system::error_code& error, std::size_t by } // namespace Server -} // namespace Remote +} // namespace LmsAPI diff --git a/src/remote/server/Connection.hpp b/src/lms-api/server/Connection.hpp similarity index 96% rename from src/remote/server/Connection.hpp rename to src/lms-api/server/Connection.hpp index d61614e9..72fdca27 100644 --- a/src/remote/server/Connection.hpp +++ b/src/lms-api/server/Connection.hpp @@ -17,8 +17,8 @@ * along with LMS. If not, see . */ -#ifndef REMOTE_CONNECTION_HPP -#define REMOTE_CONNECTION_HPP +#ifndef LMSAPI_CONNECTION_HPP +#define LMSAPI_CONNECTION_HPP #include #include @@ -30,7 +30,7 @@ #include "messages/Header.hpp" -namespace Remote { +namespace LmsAPI { namespace Server { class ConnectionManager; @@ -91,7 +91,7 @@ class Connection : public std::enable_shared_from_this } // namespace Server -} // namespace Remote +} // namespace LmsAPI #endif diff --git a/src/remote/server/ConnectionManager.cpp b/src/lms-api/server/ConnectionManager.cpp similarity index 96% rename from src/remote/server/ConnectionManager.cpp rename to src/lms-api/server/ConnectionManager.cpp index 406d6092..c4fc6eb7 100644 --- a/src/remote/server/ConnectionManager.cpp +++ b/src/lms-api/server/ConnectionManager.cpp @@ -23,7 +23,7 @@ #include "ConnectionManager.hpp" -namespace Remote { +namespace LmsAPI { namespace Server { ConnectionManager::ConnectionManager() @@ -57,6 +57,6 @@ ConnectionManager::stopAll() } // namespace Server -} // namespace Remote +} // namespace LmsAPI diff --git a/src/remote/server/ConnectionManager.hpp b/src/lms-api/server/ConnectionManager.hpp similarity index 97% rename from src/remote/server/ConnectionManager.hpp rename to src/lms-api/server/ConnectionManager.hpp index b3ea48cf..ce2b194a 100644 --- a/src/remote/server/ConnectionManager.hpp +++ b/src/lms-api/server/ConnectionManager.hpp @@ -24,7 +24,7 @@ #include "Connection.hpp" -namespace Remote { +namespace LmsAPI { namespace Server { /// Manages open connections so that they may be cleanly stopped when the server @@ -53,6 +53,6 @@ class ConnectionManager }; } // namespace Server -} // namespace Remote +} // namespace LmsAPI #endif diff --git a/src/remote/server/MediaRequestHandler.cpp b/src/lms-api/server/MediaRequestHandler.cpp similarity index 99% rename from src/remote/server/MediaRequestHandler.cpp rename to src/lms-api/server/MediaRequestHandler.cpp index 7b9734be..be3e6b53 100644 --- a/src/remote/server/MediaRequestHandler.cpp +++ b/src/lms-api/server/MediaRequestHandler.cpp @@ -23,7 +23,7 @@ #include "database/Types.hpp" -namespace Remote { +namespace LmsAPI { namespace Server { MediaRequestHandler::MediaRequestHandler(Database::Handler& db) @@ -211,7 +211,7 @@ MediaRequestHandler::processTerminate(const MediaRequest::Terminate& request, Me -} // namespace Remote +} // namespace LmsAPI } // namespace Server diff --git a/src/remote/server/MediaRequestHandler.hpp b/src/lms-api/server/MediaRequestHandler.hpp similarity index 97% rename from src/remote/server/MediaRequestHandler.hpp rename to src/lms-api/server/MediaRequestHandler.hpp index 675ca59c..f3f30c20 100644 --- a/src/remote/server/MediaRequestHandler.hpp +++ b/src/lms-api/server/MediaRequestHandler.hpp @@ -28,7 +28,7 @@ #include "media.pb.h" -namespace Remote { +namespace LmsAPI { namespace Server { class MediaRequestHandler @@ -58,8 +58,8 @@ class MediaRequestHandler static const std::size_t _maxTranscoders = 1; }; -} // namespace Remote } // namespace Server +} // namespace LmsAPI #endif diff --git a/src/remote/server/RequestHandler.cpp b/src/lms-api/server/RequestHandler.cpp similarity index 98% rename from src/remote/server/RequestHandler.cpp rename to src/lms-api/server/RequestHandler.cpp index f8fd2bba..3f27c21b 100644 --- a/src/remote/server/RequestHandler.cpp +++ b/src/lms-api/server/RequestHandler.cpp @@ -21,7 +21,7 @@ #include "RequestHandler.hpp" -namespace Remote { +namespace LmsAPI { namespace Server { RequestHandler::RequestHandler(boost::filesystem::path dbPath) @@ -95,7 +95,7 @@ RequestHandler::process(const ClientMessage& request, ServerMessage& response) } // namespace Server -} // namespace Remote +} // namespace LmsAPI diff --git a/src/remote/server/RequestHandler.hpp b/src/lms-api/server/RequestHandler.hpp similarity index 97% rename from src/remote/server/RequestHandler.hpp rename to src/lms-api/server/RequestHandler.hpp index 15d1b510..84f184e3 100644 --- a/src/remote/server/RequestHandler.hpp +++ b/src/lms-api/server/RequestHandler.hpp @@ -30,7 +30,7 @@ #include "AudioCollectionRequestHandler.hpp" #include "MediaRequestHandler.hpp" -namespace Remote { +namespace LmsAPI { namespace Server { class RequestHandler @@ -52,7 +52,7 @@ class RequestHandler }; } // namespace Server -} // namespace Remote +} // namespace LmsAPI #endif diff --git a/src/remote/server/Server.cpp b/src/lms-api/server/Server.cpp similarity index 98% rename from src/remote/server/Server.cpp rename to src/lms-api/server/Server.cpp index 50c1063b..6d095521 100644 --- a/src/remote/server/Server.cpp +++ b/src/lms-api/server/Server.cpp @@ -27,7 +27,7 @@ #include "Server.hpp" -namespace Remote { +namespace LmsAPI { namespace Server { Server::Server(const endpoint_type& bindEndpoint, @@ -109,4 +109,4 @@ Server::stop() } } // namespace Server -} // namespace Remote +} // namespace LmsAPI diff --git a/src/remote/server/Server.hpp b/src/lms-api/server/Server.hpp similarity index 98% rename from src/remote/server/Server.hpp rename to src/lms-api/server/Server.hpp index 297a26ac..57b77a2b 100644 --- a/src/remote/server/Server.hpp +++ b/src/lms-api/server/Server.hpp @@ -32,7 +32,7 @@ #include "RequestHandler.hpp" -namespace Remote { +namespace LmsAPI { namespace Server { class Server @@ -76,6 +76,6 @@ class Server }; } // namespace Server -} // namespace Remote +} // namespace LmsAPI #endif diff --git a/src/main/main.cpp b/src/main/main.cpp index 48502d8e..635d696a 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -28,7 +28,7 @@ #include "service/ServiceManager.hpp" #include "service/DatabaseUpdateService.hpp" #include "service/UserInterfaceService.hpp" -#include "service/RemoteServerService.hpp" +#include "service/LmsAPIServerService.hpp" int main(int argc, char* argv[]) { diff --git a/src/remote/proto/auth.proto b/src/remote/proto/auth.proto deleted file mode 100644 index de3bfadd..00000000 --- a/src/remote/proto/auth.proto +++ /dev/null @@ -1,48 +0,0 @@ -import "common.proto"; - -package Remote; - -message AuthRequest -{ - message Password - { - required string user_login = 1; - required string user_password = 2; - } - - enum Type - { - TypePassword = 1; - } - - required Type type = 1; - - optional Password password = 2; -} - -message AuthResponse -{ - - message PasswordResult - { - enum Type - { - TypePasswordInvalid = 1; - TypeLoginThrottling = 2; // The attempt was not processed because of throttling - TypePasswordValid = 3; - } - required Type type = 1; - - optional uint32 delay = 2; // in seconds, in case of PasswordInvalid/LoginThrottling - } - - enum Type - { - TypePasswordResult = 1; - } - - required Type type = 1; - - optional PasswordResult password_result = 2; -} - diff --git a/src/remote/proto/common.proto b/src/remote/proto/common.proto deleted file mode 100644 index a4f35ec4..00000000 --- a/src/remote/proto/common.proto +++ /dev/null @@ -1,9 +0,0 @@ - -package Remote; - -message Error -{ - required bool error = 1; - optional string message = 2; -} - diff --git a/src/service/RemoteServerService.cpp b/src/service/LmsAPIServerService.cpp similarity index 97% rename from src/service/RemoteServerService.cpp rename to src/service/LmsAPIServerService.cpp index 178a7447..a6cc6f16 100644 --- a/src/service/RemoteServerService.cpp +++ b/src/service/LmsAPIServerService.cpp @@ -19,7 +19,7 @@ #include "logger/Logger.hpp" -#include "RemoteServerService.hpp" +#include "LmsAPIServerService.hpp" namespace Service { diff --git a/src/service/RemoteServerService.hpp b/src/service/LmsAPIServerService.hpp similarity index 95% rename from src/service/RemoteServerService.hpp rename to src/service/LmsAPIServerService.hpp index f5fd80cf..d9bf6192 100644 --- a/src/service/RemoteServerService.hpp +++ b/src/service/LmsAPIServerService.hpp @@ -25,7 +25,7 @@ #include "Service.hpp" -#include "remote/server/Server.hpp" +#include "lms-api/server/Server.hpp" namespace Service { @@ -51,7 +51,7 @@ class RemoteServerService : public Service private: - Remote::Server::Server _server; + LmsAPI::Server::Server _server; }; } // namespace Service