TrinityCore
|
#include <LoginRESTService.h>
Public Types | |
using | RequestHandlerResult = Trinity::Net::Http::RequestHandlerResult |
using | HttpRequest = Trinity::Net::Http::Request |
using | HttpResponse = Trinity::Net::Http::Response |
using | HttpRequestContext = Trinity::Net::Http::RequestContext |
using | HttpSessionState = Trinity::Net::Http::SessionState |
Public Member Functions | |
LoginRESTService () | |
bool | StartNetwork (Trinity::Asio::IoContext &ioContext, std::string const &bindIp, uint16 port, int32 threadCount=1) override |
std::string const & | GetHostnameForClient (boost::asio::ip::address const &address) const |
uint16 | GetPort () const |
std::shared_ptr< Trinity::Net::Http::SessionState > | CreateNewSessionState (boost::asio::ip::address const &address) override |
Public Member Functions inherited from Trinity::Net::Http::HttpService< LoginHttpSession > | |
HttpService (std::string_view loggerSuffix) | |
bool | StartNetwork (Asio::IoContext &ioContext, std::string const &bindIp, uint16 port, int32 threadCount=1) override |
void | StopNetwork () override |
void | RegisterHandler (boost::beast::http::verb method, std::string_view path, Callable handler, RequestHandlerFlag flags=RequestHandlerFlag::None) |
void | RegisterHandler (boost::beast::http::verb method, std::string_view path, std::function< RequestHandlerResult(std::shared_ptr< AbstractSocket > session, RequestContext &context)> handler, RequestHandlerFlag flags=RequestHandlerFlag::None) |
virtual std::shared_ptr< SessionState > | CreateNewSessionState (boost::asio::ip::address const &address) |
Public Member Functions inherited from SocketMgr< LoginHttpSession > | |
virtual | ~SocketMgr () |
virtual bool | StartNetwork (Trinity::Asio::IoContext &ioContext, std::string const &bindIp, uint16 port, int threadCount) |
virtual void | StopNetwork () |
void | Wait () |
virtual void | OnSocketOpen (boost::asio::ip::tcp::socket &&sock, uint32 threadIndex) |
int32 | GetNetworkThreadCount () const |
uint32 | SelectThreadWithMinConnections () const |
std::pair< boost::asio::ip::tcp::socket *, uint32 > | GetSocketForAccept () |
Public Member Functions inherited from Trinity::Net::Http::DispatcherService | |
DispatcherService (std::string_view loggerSuffix) | |
RequestHandlerResult | HandleRequest (std::shared_ptr< AbstractSocket > session, RequestContext &context) |
Public Member Functions inherited from Trinity::Net::Http::SessionService | |
SessionService (std::string_view loggerSuffix) | |
void | Start (Asio::IoContext &ioContext) |
void | Stop () |
std::shared_ptr< SessionState > | FindAndRefreshSessionState (std::string_view id, boost::asio::ip::address const &address) |
void | MarkSessionInactive (boost::uuids::uuid const &id) |
Static Public Member Functions | |
static LoginRESTService & | Instance () |
Static Public Member Functions inherited from Trinity::Net::Http::DispatcherService | |
static RequestHandlerResult | HandleBadRequest (std::shared_ptr< AbstractSocket > session, RequestContext &context) |
static RequestHandlerResult | HandleUnauthorized (std::shared_ptr< AbstractSocket > session, RequestContext &context) |
static RequestHandlerResult | HandlePathNotFound (std::shared_ptr< AbstractSocket > session, RequestContext &context) |
Private Member Functions | |
RequestHandlerResult | HandleGetForm (std::shared_ptr< LoginHttpSession > session, HttpRequestContext &context) const |
RequestHandlerResult | HandleGetPortal (std::shared_ptr< LoginHttpSession > session, HttpRequestContext &context) const |
RequestHandlerResult | HandlePostLogin (std::shared_ptr< LoginHttpSession > session, HttpRequestContext &context) const |
RequestHandlerResult | HandlePostRefreshLoginTicket (std::shared_ptr< LoginHttpSession > session, HttpRequestContext &context) const |
void | MigrateLegacyPasswordHashes () const |
Static Private Member Functions | |
static void | OnSocketAccept (boost::asio::ip::tcp::socket &&sock, uint32 threadIndex) |
static std::string | ExtractAuthorization (HttpRequest const &request) |
static RequestHandlerResult | HandleGetGameAccounts (std::shared_ptr< LoginHttpSession > session, HttpRequestContext &context) |
static RequestHandlerResult | HandlePostLoginSrpChallenge (std::shared_ptr< LoginHttpSession > session, HttpRequestContext &context) |
static std::unique_ptr< Trinity::Crypto::SRP::BnetSRP6Base > | CreateSrpImplementation (SrpVersion version, SrpHashFunction hashFunction, std::string const &username, Trinity::Crypto::SRP::Salt const &salt, Trinity::Crypto::SRP::Verifier const &verifier) |
Private Attributes | |
JSON::Login::FormInputs | _formInputs |
std::string | _bindIP |
uint16 | _port |
std::array< std::string, 2 > | _hostnames |
std::array< boost::asio::ip::address, 2 > | _addresses |
uint32 | _loginTicketDuration |
Additional Inherited Members | |
Protected Member Functions inherited from Trinity::Net::Http::HttpService< LoginHttpSession > | |
NetworkThread< LoginHttpSession > * | CreateThreads () const override |
Protected Member Functions inherited from SocketMgr< LoginHttpSession > | |
SocketMgr () | |
virtual NetworkThread< LoginHttpSession > * | CreateThreads () const=0 |
Protected Member Functions inherited from Trinity::Net::Http::DispatcherService | |
void | RegisterHandler (boost::beast::http::verb method, std::string_view path, std::function< RequestHandlerResult(std::shared_ptr< AbstractSocket > session, RequestContext &context)> handler, RequestHandlerFlag flags=RequestHandlerFlag::None) |
Protected Member Functions inherited from Trinity::Net::Http::SessionService | |
void | InitAndStoreSessionState (std::shared_ptr< SessionState > state, boost::asio::ip::address const &address) |
void | KillInactiveSessions () |
Protected Attributes inherited from Trinity::Net::Http::HttpService< LoginHttpSession > | |
Asio::IoContext * | _ioContext |
std::string | _logger |
Protected Attributes inherited from SocketMgr< LoginHttpSession > | |
AsyncAcceptor * | _acceptor |
NetworkThread< LoginHttpSession > * | _threads |
int32 | _threadCount |
Definition at line 45 of file LoginRESTService.h.
Definition at line 49 of file LoginRESTService.h.
Definition at line 51 of file LoginRESTService.h.
Definition at line 50 of file LoginRESTService.h.
Definition at line 52 of file LoginRESTService.h.
Definition at line 48 of file LoginRESTService.h.
|
inline |
Definition at line 54 of file LoginRESTService.h.
|
overridevirtual |
Reimplemented from Trinity::Net::Http::HttpService< LoginHttpSession >.
Definition at line 546 of file LoginRESTService.cpp.
|
staticprivate |
Definition at line 524 of file LoginRESTService.cpp.
|
staticprivate |
Definition at line 140 of file LoginRESTService.cpp.
std::string const & Battlenet::LoginRESTService::GetHostnameForClient | ( | boost::asio::ip::address const & | address | ) | const |
Definition at line 129 of file LoginRESTService.cpp.
|
inline |
Definition at line 61 of file LoginRESTService.h.
|
private |
Definition at line 168 of file LoginRESTService.cpp.
|
staticprivate |
Definition at line 178 of file LoginRESTService.cpp.
|
private |
Definition at line 227 of file LoginRESTService.cpp.
|
private |
Definition at line 234 of file LoginRESTService.cpp.
|
staticprivate |
Definition at line 398 of file LoginRESTService.cpp.
|
private |
Definition at line 485 of file LoginRESTService.cpp.
|
static |
Definition at line 33 of file LoginRESTService.cpp.
|
private |
Definition at line 558 of file LoginRESTService.cpp.
|
staticprivate |
|
override |
|
private |
Definition at line 87 of file LoginRESTService.h.
|
private |
Definition at line 84 of file LoginRESTService.h.
|
private |
Definition at line 83 of file LoginRESTService.h.
|
private |
Definition at line 86 of file LoginRESTService.h.
|
private |
Definition at line 88 of file LoginRESTService.h.
|
private |
Definition at line 85 of file LoginRESTService.h.