HGInventoryService now uses the actual authority portion of the user's key to verify the key.

0.6.5-rc1
diva 2009-03-30 19:26:25 +00:00
parent 2914bfe7b0
commit 4cbf963354
3 changed files with 1160 additions and 1159 deletions

View File

@ -78,6 +78,8 @@ namespace OpenSim.Framework.Communications.Clients
SendParams.Add(userID.ToString()); SendParams.Add(userID.ToString());
SendParams.Add(authKey); SendParams.Add(authKey);
System.Console.WriteLine("[HGrid]: Verifying user key with authority " + authurl);
XmlRpcRequest request = new XmlRpcRequest("hg_verify_auth_key", SendParams); XmlRpcRequest request = new XmlRpcRequest("hg_verify_auth_key", SendParams);
XmlRpcResponse reply; XmlRpcResponse reply;
try try

View File

@ -464,7 +464,7 @@ namespace OpenSim.Framework.Communications.Services
string method = (string)request["http-method"]; string method = (string)request["http-method"];
if (method.Equals("GET")) if (method.Equals("GET"))
{ {
DoInvCapPost(request, responsedata, userID, authToken); DoInvCapPost(request, responsedata, userID, authority, authToken);
return responsedata; return responsedata;
} }
//else if (method.Equals("DELETE")) //else if (method.Equals("DELETE"))
@ -484,7 +484,7 @@ namespace OpenSim.Framework.Communications.Services
} }
public virtual void DoInvCapPost(Hashtable request, Hashtable responsedata, UUID userID, string authToken) public virtual void DoInvCapPost(Hashtable request, Hashtable responsedata, UUID userID, string authority, string authToken)
{ {
// This is the meaning of POST agent // This is the meaning of POST agent
@ -498,8 +498,7 @@ namespace OpenSim.Framework.Communications.Services
return; return;
} }
bool success = VerifyKey(userID, authToken); bool success = VerifyKey(userID, authority, authToken);
m_log.Debug("[HGStandaloneInvService]: Key verification returned " + success);
if (success) if (success)
{ {
@ -663,11 +662,11 @@ namespace OpenSim.Framework.Communications.Services
#region Local vs Remote #region Local vs Remote
bool VerifyKey(UUID userID, string key) bool VerifyKey(UUID userID, string authority, string key)
{ {
// Remote call to the Authorization server // Remote call to the Authorization server
if (m_userService == null) if (m_userService == null)
return AuthClient.VerifyKey(m_UserServerURL, userID, key); return AuthClient.VerifyKey("http://" + authority, userID, key);
// local call // local call
else else
return ((IAuthentication)m_userService).VerifyKey(userID, key); return ((IAuthentication)m_userService).VerifyKey(userID, key);