$treeview $search $mathjax $extrastylesheet
otsdaq
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #ifndef _ots_Utilities_RemoteWebUsers_h 00002 #define _ots_Utilities_RemoteWebUsers_h 00003 00004 #include "otsdaq-core/SOAPUtilities/SOAPMessenger.h" //for xdaq::ApplicationDescriptor 00005 #include "otsdaq-core/WebUsersUtilities/WebUsers.h" 00006 00007 #include <iostream> 00008 #include <string> 00009 00010 #include "otsdaq-core/TableCore/TableGroupKey.h" //for TableGroupKey 00011 00012 namespace ots 00013 { 00014 class AllSupervisorInfo; 00015 class HttpXmlDocument; 00016 00017 // RemoteWebUsers 00018 // This class provides the functionality for client supervisors to check with the Gateway 00019 // Supervisor to verify user access. It also provides the functionality for client 00020 // supervisors to retreive user info. 00021 class RemoteWebUsers : public SOAPMessenger 00022 { 00023 public: 00024 RemoteWebUsers(xdaq::Application* application); 00025 00026 // for external supervisors to check with Supervisor for login 00027 // if false, user request handling code should just return.. out is handled on false; 00028 // on true, out is untouched 00029 bool xmlRequestToGateway(cgicc::Cgicc& cgi, 00030 std::ostringstream* out, 00031 HttpXmlDocument* xmldoc, 00032 const AllSupervisorInfo& allSupervisorInfo, 00033 WebUsers::RequestUserInfo& userInfo); 00034 00035 // uint8_t* userPermissions = 0, 00036 // const uint8_t permissionsThreshold = 1, 00037 // const bool allowNoUser = false, 00038 // const std::set<std::string>& groupsAllowed = {}, 00039 // const std::set<std::string>& groupsDisallowed = {}, 00040 // const bool refreshCookie = true, 00041 // const bool checkLock = false, 00042 // const bool lockRequired = false, 00043 // std::string* userWithLock = 0, 00044 // std::string* username = 0, 00045 // std::string* displayName = 0, 00046 // std::string* userGroups = 0, 00047 // uint64_t* activeSessionIndex = 0); 00048 00049 std::string getActiveUserList( 00050 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* supervisorDescriptor); 00051 void sendSystemMessage( 00052 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* supervisorDescriptor, 00053 const std::string& toUser, 00054 const std::string& msg); 00055 void makeSystemLogbookEntry( 00056 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* supervisorDescriptor, 00057 const std::string& entryText); 00058 std::pair<std::string /*group name*/, TableGroupKey> getLastConfigGroup( 00059 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* supervisorDescriptor, 00060 const std::string& actionOfLastGroup, 00061 std::string& actionTimeString); // actionOfLastGroup = "Configured" or "Started", 00062 // for example 00063 00064 private: 00065 bool cookieCodeIsActiveForRequest( 00066 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* supervisorDescriptor, 00067 std::string& cookieCode, 00068 uint8_t* userPermissions = 0, 00069 std::string ip = "0", 00070 bool refreshCookie = true, 00071 std::string* userWithLock = 0); 00072 00073 bool getUserInfoForCookie( 00074 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* supervisorDescriptor, 00075 std::string& cookieCode, 00076 std::string* userName, 00077 std::string* displayName = 0, 00078 uint64_t* activeSessionIndex = 0); 00079 00080 //"Active User List" associations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00081 std::string ActiveUserList_; 00082 time_t ActiveUserLastUpdateTime_; 00083 enum 00084 { 00085 ACTIVE_USERS_UPDATE_THRESHOLD = 00086 10, // 10 seconds, min amount of time between Supervisor requests 00087 }; 00088 00089 std::string tmpUserWithLock_, tmpUserGroups_, tmpUsername_; 00090 // uint8_t tmpUserPermissions_; 00091 }; 00092 00093 } // namespace ots 00094 00095 #endif