From 20f20895cf1444071d5edc42e11a1fb94b1b1079 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 23 May 2014 16:19:43 -0700 Subject: Adds optional HTTP Basic Authentication to Robust service connectors. --- .../Connectors/Grid/GridServicesConnector.cs | 31 ++++++++++++---------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'OpenSim/Services/Connectors/Grid/GridServicesConnector.cs') diff --git a/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs b/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs index 0f5a613..7f86cff 100644 --- a/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs +++ b/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs @@ -33,6 +33,7 @@ using System.Reflection; using Nini.Config; using OpenSim.Framework; using OpenSim.Framework.Communications; +using OpenSim.Framework.ServiceAuth; using OpenSim.Services.Interfaces; using GridRegion = OpenSim.Services.Interfaces.GridRegion; using OpenSim.Server.Base; @@ -40,7 +41,7 @@ using OpenMetaverse; namespace OpenSim.Services.Connectors { - public class GridServicesConnector : IGridService + public class GridServicesConnector : BaseServiceConnector, IGridService { private static readonly ILog m_log = LogManager.GetLogger( @@ -80,6 +81,8 @@ namespace OpenSim.Services.Connectors throw new Exception("Grid connector init error"); } m_ServerURI = serviceURI; + + base.Initialise(source, "GridService"); } @@ -102,7 +105,7 @@ namespace OpenSim.Services.Connectors // m_log.DebugFormat("[GRID CONNECTOR]: queryString = {0}", reqString); try { - string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString); + string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString, m_Auth); if (reply != string.Empty) { Dictionary replyData = ServerUtils.ParseXmlResponse(reply); @@ -158,7 +161,7 @@ namespace OpenSim.Services.Connectors try { string reply - = SynchronousRestFormsRequester.MakeRequest("POST", uri, ServerUtils.BuildQueryString(sendData)); + = SynchronousRestFormsRequester.MakeRequest("POST", uri, ServerUtils.BuildQueryString(sendData), m_Auth); if (reply != string.Empty) { @@ -195,7 +198,7 @@ namespace OpenSim.Services.Connectors try { - reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString); + reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString, m_Auth); } catch (Exception e) { @@ -238,7 +241,7 @@ namespace OpenSim.Services.Connectors string uri = m_ServerURI + "/grid"; try { - reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, ServerUtils.BuildQueryString(sendData)); + reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, ServerUtils.BuildQueryString(sendData), m_Auth); } catch (Exception e) { @@ -285,7 +288,7 @@ namespace OpenSim.Services.Connectors { reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, - ServerUtils.BuildQueryString(sendData)); + ServerUtils.BuildQueryString(sendData), m_Auth); } catch (Exception e) { @@ -330,7 +333,7 @@ namespace OpenSim.Services.Connectors { reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, - ServerUtils.BuildQueryString(sendData)); + ServerUtils.BuildQueryString(sendData), m_Auth); } catch (Exception e) { @@ -374,7 +377,7 @@ namespace OpenSim.Services.Connectors { reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, - ServerUtils.BuildQueryString(sendData)); + ServerUtils.BuildQueryString(sendData), m_Auth); } catch (Exception e) { @@ -428,7 +431,7 @@ namespace OpenSim.Services.Connectors { reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, - ServerUtils.BuildQueryString(sendData)); + ServerUtils.BuildQueryString(sendData), m_Auth); //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply); } @@ -479,7 +482,7 @@ namespace OpenSim.Services.Connectors { reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, - ServerUtils.BuildQueryString(sendData)); + ServerUtils.BuildQueryString(sendData), m_Auth); //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply); } @@ -530,7 +533,7 @@ namespace OpenSim.Services.Connectors { reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, - ServerUtils.BuildQueryString(sendData)); + ServerUtils.BuildQueryString(sendData), m_Auth); //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply); } @@ -583,7 +586,7 @@ namespace OpenSim.Services.Connectors { reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, - ServerUtils.BuildQueryString(sendData)); + ServerUtils.BuildQueryString(sendData), m_Auth); //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply); } @@ -634,7 +637,7 @@ namespace OpenSim.Services.Connectors { reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, - ServerUtils.BuildQueryString(sendData)); + ServerUtils.BuildQueryString(sendData), m_Auth); //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply); } @@ -685,7 +688,7 @@ namespace OpenSim.Services.Connectors { reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, - ServerUtils.BuildQueryString(sendData)); + ServerUtils.BuildQueryString(sendData), m_Auth); } catch (Exception e) { -- cgit v1.1