Commit fc96abc5 authored by Volodymyr Yurchenko's avatar Volodymyr Yurchenko
Browse files

Pass credentials to ConnectJBox

parent 58caa378
Pipeline #957927 passed with stage
in 2 minutes and 22 seconds
...@@ -38,10 +38,10 @@ private: ...@@ -38,10 +38,10 @@ private:
const int default_WSport = 8097; const int default_WSport = 8097;
const std::string default_server = DEFAULT_JCENTRAL_SERVER; const std::string default_server = DEFAULT_JCENTRAL_SERVER;
std::string fWSHost; // websocket port std::string fWSHost; // websocket host
int fWSPort; // websocket port int fWSPort; // websocket port
TString sUsercert; // location of user certificate TString sUsercert; // location of user certificate
TString sUserkey; // location of user private key TString sUserkey; // location of user private key
// Libwebsockets // Libwebsockets
static int destroy_flag; // Flags to know connection status static int destroy_flag; // Flags to know connection status
...@@ -69,7 +69,7 @@ public: ...@@ -69,7 +69,7 @@ public:
TJAlienConnectionManager(); TJAlienConnectionManager();
~TJAlienConnectionManager(); ~TJAlienConnectionManager();
int CreateConnection(); int CreateConnection();
void ConnectJBox(); void ConnectJBox(TJAlienCredentialsObject c);
void ConnectJCentral(TJAlienCredentialsObject c, string host = DEFAULT_JCENTRAL_SERVER); void ConnectJCentral(TJAlienCredentialsObject c, string host = DEFAULT_JCENTRAL_SERVER);
void MakeWebsocketConnection(TJAlienCredentialsObject creds, string host, int WSPort); void MakeWebsocketConnection(TJAlienCredentialsObject creds, string host, int WSPort);
void ForceRestart(); void ForceRestart();
......
...@@ -45,7 +45,7 @@ int TJAlienConnectionManager::CreateConnection() ...@@ -45,7 +45,7 @@ int TJAlienConnectionManager::CreateConnection()
} }
if (co.kind == cJBOX_TOKEN || co.kind == cJOB_TOKEN) { if (co.kind == cJBOX_TOKEN || co.kind == cJOB_TOKEN) {
ConnectJBox(); ConnectJBox(co);
} }
if (connection_flag) { if (connection_flag) {
...@@ -99,14 +99,8 @@ void TJAlienConnectionManager::clearFlags() ...@@ -99,14 +99,8 @@ void TJAlienConnectionManager::clearFlags()
} }
//______________________________________________________________________________ //______________________________________________________________________________
void TJAlienConnectionManager::ConnectJBox() void TJAlienConnectionManager::ConnectJBox(TJAlienCredentialsObject c)
{ {
if (!creds.has(cJBOX_TOKEN)) {
return;
}
TJAlienCredentialsObject c = creds.get(cJBOX_TOKEN);
TJClientFile jcf; TJClientFile jcf;
if (jcf.isValid) { if (jcf.isValid) {
MakeWebsocketConnection(c, (std::string)jcf.fHost, jcf.fWSPort); MakeWebsocketConnection(c, (std::string)jcf.fHost, jcf.fWSPort);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment