diff options
author | Diva Canto | 2014-05-23 16:19:43 -0700 |
---|---|---|
committer | Diva Canto | 2014-05-23 16:19:43 -0700 |
commit | 20f20895cf1444071d5edc42e11a1fb94b1b1079 (patch) | |
tree | 0c7547590a89eec47886e0a8646f86ebbf449e63 /OpenSim/Services/Connectors/Grid | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-20f20895cf1444071d5edc42e11a1fb94b1b1079.zip opensim-SC_OLD-20f20895cf1444071d5edc42e11a1fb94b1b1079.tar.gz opensim-SC_OLD-20f20895cf1444071d5edc42e11a1fb94b1b1079.tar.bz2 opensim-SC_OLD-20f20895cf1444071d5edc42e11a1fb94b1b1079.tar.xz |
Adds optional HTTP Basic Authentication to Robust service connectors.
Diffstat (limited to 'OpenSim/Services/Connectors/Grid')
-rw-r--r-- | OpenSim/Services/Connectors/Grid/GridServicesConnector.cs | 31 |
1 files changed, 17 insertions, 14 deletions
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; | |||
33 | using Nini.Config; | 33 | using Nini.Config; |
34 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Communications; | 35 | using OpenSim.Framework.Communications; |
36 | using OpenSim.Framework.ServiceAuth; | ||
36 | using OpenSim.Services.Interfaces; | 37 | using OpenSim.Services.Interfaces; |
37 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | 38 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; |
38 | using OpenSim.Server.Base; | 39 | using OpenSim.Server.Base; |
@@ -40,7 +41,7 @@ using OpenMetaverse; | |||
40 | 41 | ||
41 | namespace OpenSim.Services.Connectors | 42 | namespace OpenSim.Services.Connectors |
42 | { | 43 | { |
43 | public class GridServicesConnector : IGridService | 44 | public class GridServicesConnector : BaseServiceConnector, IGridService |
44 | { | 45 | { |
45 | private static readonly ILog m_log = | 46 | private static readonly ILog m_log = |
46 | LogManager.GetLogger( | 47 | LogManager.GetLogger( |
@@ -80,6 +81,8 @@ namespace OpenSim.Services.Connectors | |||
80 | throw new Exception("Grid connector init error"); | 81 | throw new Exception("Grid connector init error"); |
81 | } | 82 | } |
82 | m_ServerURI = serviceURI; | 83 | m_ServerURI = serviceURI; |
84 | |||
85 | base.Initialise(source, "GridService"); | ||
83 | } | 86 | } |
84 | 87 | ||
85 | 88 | ||
@@ -102,7 +105,7 @@ namespace OpenSim.Services.Connectors | |||
102 | // m_log.DebugFormat("[GRID CONNECTOR]: queryString = {0}", reqString); | 105 | // m_log.DebugFormat("[GRID CONNECTOR]: queryString = {0}", reqString); |
103 | try | 106 | try |
104 | { | 107 | { |
105 | string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString); | 108 | string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString, m_Auth); |
106 | if (reply != string.Empty) | 109 | if (reply != string.Empty) |
107 | { | 110 | { |
108 | Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); | 111 | Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); |
@@ -158,7 +161,7 @@ namespace OpenSim.Services.Connectors | |||
158 | try | 161 | try |
159 | { | 162 | { |
160 | string reply | 163 | string reply |
161 | = SynchronousRestFormsRequester.MakeRequest("POST", uri, ServerUtils.BuildQueryString(sendData)); | 164 | = SynchronousRestFormsRequester.MakeRequest("POST", uri, ServerUtils.BuildQueryString(sendData), m_Auth); |
162 | 165 | ||
163 | if (reply != string.Empty) | 166 | if (reply != string.Empty) |
164 | { | 167 | { |
@@ -195,7 +198,7 @@ namespace OpenSim.Services.Connectors | |||
195 | 198 | ||
196 | try | 199 | try |
197 | { | 200 | { |
198 | reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString); | 201 | reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString, m_Auth); |
199 | } | 202 | } |
200 | catch (Exception e) | 203 | catch (Exception e) |
201 | { | 204 | { |
@@ -238,7 +241,7 @@ namespace OpenSim.Services.Connectors | |||
238 | string uri = m_ServerURI + "/grid"; | 241 | string uri = m_ServerURI + "/grid"; |
239 | try | 242 | try |
240 | { | 243 | { |
241 | reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, ServerUtils.BuildQueryString(sendData)); | 244 | reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, ServerUtils.BuildQueryString(sendData), m_Auth); |
242 | } | 245 | } |
243 | catch (Exception e) | 246 | catch (Exception e) |
244 | { | 247 | { |
@@ -285,7 +288,7 @@ namespace OpenSim.Services.Connectors | |||
285 | { | 288 | { |
286 | reply = SynchronousRestFormsRequester.MakeRequest("POST", | 289 | reply = SynchronousRestFormsRequester.MakeRequest("POST", |
287 | uri, | 290 | uri, |
288 | ServerUtils.BuildQueryString(sendData)); | 291 | ServerUtils.BuildQueryString(sendData), m_Auth); |
289 | } | 292 | } |
290 | catch (Exception e) | 293 | catch (Exception e) |
291 | { | 294 | { |
@@ -330,7 +333,7 @@ namespace OpenSim.Services.Connectors | |||
330 | { | 333 | { |
331 | reply = SynchronousRestFormsRequester.MakeRequest("POST", | 334 | reply = SynchronousRestFormsRequester.MakeRequest("POST", |
332 | uri, | 335 | uri, |
333 | ServerUtils.BuildQueryString(sendData)); | 336 | ServerUtils.BuildQueryString(sendData), m_Auth); |
334 | } | 337 | } |
335 | catch (Exception e) | 338 | catch (Exception e) |
336 | { | 339 | { |
@@ -374,7 +377,7 @@ namespace OpenSim.Services.Connectors | |||
374 | { | 377 | { |
375 | reply = SynchronousRestFormsRequester.MakeRequest("POST", | 378 | reply = SynchronousRestFormsRequester.MakeRequest("POST", |
376 | uri, | 379 | uri, |
377 | ServerUtils.BuildQueryString(sendData)); | 380 | ServerUtils.BuildQueryString(sendData), m_Auth); |
378 | } | 381 | } |
379 | catch (Exception e) | 382 | catch (Exception e) |
380 | { | 383 | { |
@@ -428,7 +431,7 @@ namespace OpenSim.Services.Connectors | |||
428 | { | 431 | { |
429 | reply = SynchronousRestFormsRequester.MakeRequest("POST", | 432 | reply = SynchronousRestFormsRequester.MakeRequest("POST", |
430 | uri, | 433 | uri, |
431 | ServerUtils.BuildQueryString(sendData)); | 434 | ServerUtils.BuildQueryString(sendData), m_Auth); |
432 | 435 | ||
433 | //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply); | 436 | //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply); |
434 | } | 437 | } |
@@ -479,7 +482,7 @@ namespace OpenSim.Services.Connectors | |||
479 | { | 482 | { |
480 | reply = SynchronousRestFormsRequester.MakeRequest("POST", | 483 | reply = SynchronousRestFormsRequester.MakeRequest("POST", |
481 | uri, | 484 | uri, |
482 | ServerUtils.BuildQueryString(sendData)); | 485 | ServerUtils.BuildQueryString(sendData), m_Auth); |
483 | 486 | ||
484 | //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply); | 487 | //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply); |
485 | } | 488 | } |
@@ -530,7 +533,7 @@ namespace OpenSim.Services.Connectors | |||
530 | { | 533 | { |
531 | reply = SynchronousRestFormsRequester.MakeRequest("POST", | 534 | reply = SynchronousRestFormsRequester.MakeRequest("POST", |
532 | uri, | 535 | uri, |
533 | ServerUtils.BuildQueryString(sendData)); | 536 | ServerUtils.BuildQueryString(sendData), m_Auth); |
534 | 537 | ||
535 | //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply); | 538 | //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply); |
536 | } | 539 | } |
@@ -583,7 +586,7 @@ namespace OpenSim.Services.Connectors | |||
583 | { | 586 | { |
584 | reply = SynchronousRestFormsRequester.MakeRequest("POST", | 587 | reply = SynchronousRestFormsRequester.MakeRequest("POST", |
585 | uri, | 588 | uri, |
586 | ServerUtils.BuildQueryString(sendData)); | 589 | ServerUtils.BuildQueryString(sendData), m_Auth); |
587 | 590 | ||
588 | //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply); | 591 | //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply); |
589 | } | 592 | } |
@@ -634,7 +637,7 @@ namespace OpenSim.Services.Connectors | |||
634 | { | 637 | { |
635 | reply = SynchronousRestFormsRequester.MakeRequest("POST", | 638 | reply = SynchronousRestFormsRequester.MakeRequest("POST", |
636 | uri, | 639 | uri, |
637 | ServerUtils.BuildQueryString(sendData)); | 640 | ServerUtils.BuildQueryString(sendData), m_Auth); |
638 | 641 | ||
639 | //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply); | 642 | //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply); |
640 | } | 643 | } |
@@ -685,7 +688,7 @@ namespace OpenSim.Services.Connectors | |||
685 | { | 688 | { |
686 | reply = SynchronousRestFormsRequester.MakeRequest("POST", | 689 | reply = SynchronousRestFormsRequester.MakeRequest("POST", |
687 | uri, | 690 | uri, |
688 | ServerUtils.BuildQueryString(sendData)); | 691 | ServerUtils.BuildQueryString(sendData), m_Auth); |
689 | } | 692 | } |
690 | catch (Exception e) | 693 | catch (Exception e) |
691 | { | 694 | { |