Fixing #1754.
This commit is contained in:
parent
22ea77fb51
commit
b48f7c380c
3 changed files with 47 additions and 48 deletions
|
@ -65,31 +65,34 @@ using namespace LiveSupport::Authentication;
|
||||||
const std::string TestAuthenticationClient::configElementNameStr
|
const std::string TestAuthenticationClient::configElementNameStr
|
||||||
= "testAuthentication";
|
= "testAuthentication";
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of the config child element for the login and password
|
* The name of the config child element for the login and password
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string userConfigElementName = "user";
|
const std::string userConfigElementName = "user";
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of the config element attribute for the login
|
* The name of the config element attribute for the login
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string userLoginAttrName = "login";
|
const std::string userLoginAttrName = "login";
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of the config element attribute for the password
|
* The name of the config element attribute for the password
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string userPasswordAttrName = "password";
|
const std::string userPasswordAttrName = "password";
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The dummy sessionId string returned by this authentication client
|
* The dummy sessionId string returned by this authentication client
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string dummySessionIdString = "dummySessionId";
|
const std::string dummySessionIdString = "dummySessionId";
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The version string, returned by getVersion
|
* The version string, returned by getVersion
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string versionStr = "TestAuthentication";
|
const std::string versionStr = "TestAuthentication";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/* =============================================== local function prototypes */
|
/* =============================================== local function prototypes */
|
||||||
|
|
||||||
|
|
|
@ -65,25 +65,27 @@ using namespace LiveSupport::Authentication;
|
||||||
const std::string WebAuthenticationClient::configElementNameStr
|
const std::string WebAuthenticationClient::configElementNameStr
|
||||||
= "webAuthentication";
|
= "webAuthentication";
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of the config child element for the authentication server location
|
* The name of the config child element for the authentication server location
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string locationConfigElementName = "location";
|
const std::string locationConfigElementName = "location";
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of the config element attribute for the server name
|
* The name of the config element attribute for the server name
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string locationServerAttrName = "server";
|
const std::string locationServerAttrName = "server";
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of the config element attribute for the server port
|
* The name of the config element attribute for the server port
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string locationPortAttrName = "port";
|
const std::string locationPortAttrName = "port";
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of the config element attribute for the server php page
|
* The name of the config element attribute for the server php page
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string locationPathAttrName = "path";
|
const std::string locationPathAttrName = "path";
|
||||||
|
|
||||||
|
|
||||||
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ authentication server constants: login */
|
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ authentication server constants: login */
|
||||||
|
@ -91,32 +93,32 @@ static const std::string locationPathAttrName = "path";
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of the get version method on the storage server
|
* The name of the get version method on the storage server
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string getVersionMethodName = "locstor.getVersion";
|
const std::string getVersionMethodName = "locstor.getVersion";
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of version return parameter for getVersion
|
* The name of version return parameter for getVersion
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string getVersionResultParamName = "version";
|
const std::string getVersionResultParamName = "version";
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of the login method on the server
|
* The name of the login method on the server
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string loginMethodName = "locstor.login";
|
const std::string loginMethodName = "locstor.login";
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of the login parameter in the input structure
|
* The name of the login parameter in the input structure
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string loginParamName = "login";
|
const std::string loginParamName = "login";
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of the password parameter in the input structure
|
* The name of the password parameter in the input structure
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string passwordParamName = "pass";
|
const std::string passwordParamName = "pass";
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of the session ID parameter in the output structure
|
* The name of the session ID parameter in the output structure
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string outputSessionIdParamName = "sessid";
|
const std::string outputSessionIdParamName = "sessid";
|
||||||
|
|
||||||
|
|
||||||
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ authentication server constants: logout */
|
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ authentication server constants: logout */
|
||||||
|
@ -124,17 +126,17 @@ static const std::string outputSessionIdParamName = "sessid";
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of the logout method on the server
|
* The name of the logout method on the server
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string logoutMethodName = "locstor.logout";
|
const std::string logoutMethodName = "locstor.logout";
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of the session ID parameter in the input structure
|
* The name of the session ID parameter in the input structure
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string inputSessionIdParamName = "sessid";
|
const std::string inputSessionIdParamName = "sessid";
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of the status parameter in the output structure
|
* The name of the status parameter in the output structure
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string statusParamName = "status";
|
const std::string statusParamName = "status";
|
||||||
|
|
||||||
|
|
||||||
/* ~~~~~~~~~~~~~~~~~~ authentication server constants: load/save preferences */
|
/* ~~~~~~~~~~~~~~~~~~ authentication server constants: load/save preferences */
|
||||||
|
@ -142,47 +144,47 @@ static const std::string statusParamName = "status";
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of the load preferences method on the server
|
* The name of the load preferences method on the server
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string loadPreferencesMethodName = "locstor.loadPref";
|
const std::string loadPreferencesMethodName = "locstor.loadPref";
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of the save preferences method on the server
|
* The name of the save preferences method on the server
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string savePreferencesMethodName = "locstor.savePref";
|
const std::string savePreferencesMethodName = "locstor.savePref";
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of the delete preferences method on the server
|
* The name of the delete preferences method on the server
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string deletePreferencesMethodName = "locstor.delPref";
|
const std::string deletePreferencesMethodName = "locstor.delPref";
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of the session ID parameter in the input structure
|
* The name of the session ID parameter in the input structure
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string preferencesSessionIdParamName = "sessid";
|
const std::string preferencesSessionIdParamName = "sessid";
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of the key parameter in the input structure
|
* The name of the key parameter in the input structure
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string preferencesKeyParamName = "key";
|
const std::string preferencesKeyParamName = "key";
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of the value parameter for both save and load methods
|
* The name of the value parameter for both save and load methods
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string preferencesValueParamName = "value";
|
const std::string preferencesValueParamName = "value";
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of the return parameter for the save method
|
* The name of the return parameter for the save method
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string preferencesStatusParamName = "status";
|
const std::string preferencesStatusParamName = "status";
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of the fault code parameter
|
* The name of the fault code parameter
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string faultCodeParamName = "faultCode";
|
const std::string faultCodeParamName = "faultCode";
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The fault code for the "invalid preference key" error
|
* The fault code for the "invalid preference key" error
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const int invalidPreferenceKeyFaultCode = 849;
|
const int invalidPreferenceKeyFaultCode = 849;
|
||||||
|
|
||||||
|
|
||||||
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~ authentication server constants: resetStorage */
|
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~ authentication server constants: resetStorage */
|
||||||
|
@ -190,18 +192,19 @@ static const int invalidPreferenceKeyFaultCode = 849;
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of the reset storage method on the server
|
* The name of the reset storage method on the server
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string resetStorageMethodName = "locstor.resetStorage";
|
const std::string resetStorageMethodName = "locstor.resetStorage";
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of the list of audio clips parameter returned (ignored here)
|
* The name of the result parameter returned by the method (ignored here)
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string resetStorageAudioClipResultParamName = "audioclips";
|
const std::string resetStorageResultParamName = "results";
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of the list of playlists parameter returned (ignored here)
|
* The name of the count parameter returned by the method (ignored here)
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
static const std::string resetStoragePlaylistResultParamName = "playlists";
|
const std::string resetStorageCountParamName = "cnt";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/* =============================================== local function prototypes */
|
/* =============================================== local function prototypes */
|
||||||
|
|
||||||
|
@ -643,12 +646,12 @@ WebAuthenticationClient :: reset(void)
|
||||||
throw Core::XmlRpcMethodFaultException(eMsg.str());
|
throw Core::XmlRpcMethodFaultException(eMsg.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! result.hasMember(resetStorageAudioClipResultParamName)
|
if (! result.hasMember(resetStorageResultParamName)
|
||||||
|| result[resetStorageAudioClipResultParamName].getType()
|
|| result[resetStorageResultParamName].getType()
|
||||||
!= XmlRpcValue::TypeArray
|
!= XmlRpcValue::TypeArray
|
||||||
|| ! result.hasMember(resetStoragePlaylistResultParamName)
|
|| ! result.hasMember(resetStorageCountParamName)
|
||||||
|| result[resetStoragePlaylistResultParamName].getType()
|
|| result[resetStorageCountParamName].getType()
|
||||||
!= XmlRpcValue::TypeArray) {
|
!= XmlRpcValue::TypeInt) {
|
||||||
std::stringstream eMsg;
|
std::stringstream eMsg;
|
||||||
eMsg << "XML-RPC method '"
|
eMsg << "XML-RPC method '"
|
||||||
<< resetStorageMethodName
|
<< resetStorageMethodName
|
||||||
|
|
|
@ -220,7 +220,7 @@ const std::string errorCodeParamName = "faultCode";
|
||||||
const std::string errorMessageParamName = "faultString";
|
const std::string errorMessageParamName = "faultString";
|
||||||
|
|
||||||
|
|
||||||
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ storage server constants: resetStorage */
|
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ storage server constants: getVersion */
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of the get version method on the storage server
|
* The name of the get version method on the storage server
|
||||||
|
@ -232,22 +232,15 @@ const std::string getVersionMethodName = "locstor.getVersion";
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
const std::string getVersionResultParamName = "version";
|
const std::string getVersionResultParamName = "version";
|
||||||
|
|
||||||
|
|
||||||
|
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ storage server constants: resetStorage */
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* The name of the reset storage method on the storage server
|
* The name of the reset storage method on the storage server
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
const std::string resetStorageMethodName
|
const std::string resetStorageMethodName
|
||||||
= "locstor.resetStorage";
|
= "locstor.resetStorage";
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* The name of the audio clips result parameter returned by the method
|
|
||||||
*----------------------------------------------------------------------------*/
|
|
||||||
const std::string resetStorageAudioClipResultParamName = "audioclips";
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* The name of the playlists result parameter returned by the method
|
|
||||||
*----------------------------------------------------------------------------*/
|
|
||||||
const std::string resetStoragePlaylistResultParamName = "playlists";
|
|
||||||
|
|
||||||
|
|
||||||
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ storage server constants: search */
|
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ storage server constants: search */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue