aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server
diff options
context:
space:
mode:
authorDiva Canto2014-05-23 16:19:43 -0700
committerDiva Canto2014-05-23 16:19:43 -0700
commit20f20895cf1444071d5edc42e11a1fb94b1b1079 (patch)
tree0c7547590a89eec47886e0a8646f86ebbf449e63 /OpenSim/Server
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-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/Server')
-rw-r--r--OpenSim/Server/Handlers/Asset/AssetServerConnector.cs9
-rw-r--r--OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs7
-rw-r--r--OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs9
-rw-r--r--OpenSim/Server/Handlers/Asset/AssetServerPostHandler.cs7
-rw-r--r--OpenSim/Server/Handlers/Asset/AssetsExistHandler.cs7
-rw-r--r--OpenSim/Server/Handlers/Authentication/AuthenticationServerConnector.cs5
-rw-r--r--OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs8
-rw-r--r--OpenSim/Server/Handlers/Avatar/AvatarServerConnector.cs5
-rw-r--r--OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs5
-rw-r--r--OpenSim/Server/Handlers/BakedTextures/XBakesGetHandler.cs9
-rw-r--r--OpenSim/Server/Handlers/BakedTextures/XBakesHandler.cs7
-rw-r--r--OpenSim/Server/Handlers/BakedTextures/XBakesPostHandler.cs11
-rw-r--r--OpenSim/Server/Handlers/Friends/FriendServerConnector.cs4
-rw-r--r--OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs5
-rw-r--r--OpenSim/Server/Handlers/Grid/GridServerConnector.cs5
-rw-r--r--OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs5
-rw-r--r--OpenSim/Server/Handlers/GridUser/GridUserServerConnector.cs5
-rw-r--r--OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs5
-rw-r--r--OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs9
-rw-r--r--OpenSim/Server/Handlers/Map/MapAddServerConnector.cs8
-rw-r--r--OpenSim/Server/Handlers/Presence/PresenceServerConnector.cs5
-rw-r--r--OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs5
-rw-r--r--OpenSim/Server/Handlers/UserAccounts/UserAccountServerConnector.cs5
-rw-r--r--OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs7
24 files changed, 113 insertions, 44 deletions
diff --git a/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs b/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs
index 9b86986..df9a51b 100644
--- a/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs
+++ b/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs
@@ -30,6 +30,7 @@ using System.IO;
30using Nini.Config; 30using Nini.Config;
31using OpenMetaverse; 31using OpenMetaverse;
32using OpenSim.Framework; 32using OpenSim.Framework;
33using OpenSim.Framework.ServiceAuth;
33using OpenSim.Framework.Console; 34using OpenSim.Framework.Console;
34using OpenSim.Server.Base; 35using OpenSim.Server.Base;
35using OpenSim.Services.Interfaces; 36using OpenSim.Services.Interfaces;
@@ -83,9 +84,11 @@ namespace OpenSim.Server.Handlers.Asset
83 allowedRemoteDeleteTypes = AllowedRemoteDeleteTypes.MapTile; 84 allowedRemoteDeleteTypes = AllowedRemoteDeleteTypes.MapTile;
84 } 85 }
85 86
86 server.AddStreamHandler(new AssetServerGetHandler(m_AssetService)); 87 IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);
87 server.AddStreamHandler(new AssetServerPostHandler(m_AssetService)); 88
88 server.AddStreamHandler(new AssetServerDeleteHandler(m_AssetService, allowedRemoteDeleteTypes)); 89 server.AddStreamHandler(new AssetServerGetHandler(m_AssetService, auth));
90 server.AddStreamHandler(new AssetServerPostHandler(m_AssetService, auth));
91 server.AddStreamHandler(new AssetServerDeleteHandler(m_AssetService, allowedRemoteDeleteTypes, auth));
89 server.AddStreamHandler(new AssetsExistHandler(m_AssetService)); 92 server.AddStreamHandler(new AssetsExistHandler(m_AssetService));
90 93
91 MainConsole.Instance.Commands.AddCommand("Assets", false, 94 MainConsole.Instance.Commands.AddCommand("Assets", false,
diff --git a/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs
index 941b97d..d85d471 100644
--- a/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs
+++ b/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs
@@ -38,6 +38,7 @@ using System.Xml.Serialization;
38using OpenSim.Server.Base; 38using OpenSim.Server.Base;
39using OpenSim.Services.Interfaces; 39using OpenSim.Services.Interfaces;
40using OpenSim.Framework; 40using OpenSim.Framework;
41using OpenSim.Framework.ServiceAuth;
41using OpenSim.Framework.Servers.HttpServer; 42using OpenSim.Framework.Servers.HttpServer;
42 43
43namespace OpenSim.Server.Handlers.Asset 44namespace OpenSim.Server.Handlers.Asset
@@ -70,6 +71,12 @@ namespace OpenSim.Server.Handlers.Asset
70 m_allowedTypes = allowedTypes; 71 m_allowedTypes = allowedTypes;
71 } 72 }
72 73
74 public AssetServerDeleteHandler(IAssetService service, AllowedRemoteDeleteTypes allowedTypes, IServiceAuth auth) :
75 base("DELETE", "/assets", auth)
76 {
77 m_AssetService = service;
78 m_allowedTypes = allowedTypes;
79 }
73 protected override byte[] ProcessRequest(string path, Stream request, 80 protected override byte[] ProcessRequest(string path, Stream request,
74 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 81 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
75 { 82 {
diff --git a/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs
index ed3b4af..500ec50 100644
--- a/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs
+++ b/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs
@@ -38,19 +38,26 @@ using System.Xml.Serialization;
38using OpenSim.Server.Base; 38using OpenSim.Server.Base;
39using OpenSim.Services.Interfaces; 39using OpenSim.Services.Interfaces;
40using OpenSim.Framework; 40using OpenSim.Framework;
41using OpenSim.Framework.ServiceAuth;
41using OpenSim.Framework.Servers.HttpServer; 42using OpenSim.Framework.Servers.HttpServer;
42 43
43namespace OpenSim.Server.Handlers.Asset 44namespace OpenSim.Server.Handlers.Asset
44{ 45{
45 public class AssetServerGetHandler : BaseStreamHandler 46 public class AssetServerGetHandler : BaseStreamHandler
46 { 47 {
47 // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 49
49 private IAssetService m_AssetService; 50 private IAssetService m_AssetService;
50 51
51 public AssetServerGetHandler(IAssetService service) : 52 public AssetServerGetHandler(IAssetService service) :
52 base("GET", "/assets") 53 base("GET", "/assets")
53 { 54 {
55 m_AssetService = service;
56 }
57
58 public AssetServerGetHandler(IAssetService service, IServiceAuth auth) :
59 base("GET", "/assets", auth)
60 {
54 m_AssetService = service; 61 m_AssetService = service;
55 } 62 }
56 63
diff --git a/OpenSim/Server/Handlers/Asset/AssetServerPostHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerPostHandler.cs
index a77e67d..1c706a7 100644
--- a/OpenSim/Server/Handlers/Asset/AssetServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Asset/AssetServerPostHandler.cs
@@ -38,6 +38,7 @@ using System.Xml.Serialization;
38using OpenSim.Server.Base; 38using OpenSim.Server.Base;
39using OpenSim.Services.Interfaces; 39using OpenSim.Services.Interfaces;
40using OpenSim.Framework; 40using OpenSim.Framework;
41using OpenSim.Framework.ServiceAuth;
41using OpenSim.Framework.Servers.HttpServer; 42using OpenSim.Framework.Servers.HttpServer;
42 43
43namespace OpenSim.Server.Handlers.Asset 44namespace OpenSim.Server.Handlers.Asset
@@ -54,6 +55,12 @@ namespace OpenSim.Server.Handlers.Asset
54 m_AssetService = service; 55 m_AssetService = service;
55 } 56 }
56 57
58 public AssetServerPostHandler(IAssetService service, IServiceAuth auth) :
59 base("POST", "/assets", auth)
60 {
61 m_AssetService = service;
62 }
63
57 protected override byte[] ProcessRequest(string path, Stream request, 64 protected override byte[] ProcessRequest(string path, Stream request,
58 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 65 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
59 { 66 {
diff --git a/OpenSim/Server/Handlers/Asset/AssetsExistHandler.cs b/OpenSim/Server/Handlers/Asset/AssetsExistHandler.cs
index 6d01f86..32901b3 100644
--- a/OpenSim/Server/Handlers/Asset/AssetsExistHandler.cs
+++ b/OpenSim/Server/Handlers/Asset/AssetsExistHandler.cs
@@ -38,6 +38,7 @@ using System.Xml.Serialization;
38using OpenSim.Server.Base; 38using OpenSim.Server.Base;
39using OpenSim.Services.Interfaces; 39using OpenSim.Services.Interfaces;
40using OpenSim.Framework; 40using OpenSim.Framework;
41using OpenSim.Framework.ServiceAuth;
41using OpenSim.Framework.Servers.HttpServer; 42using OpenSim.Framework.Servers.HttpServer;
42using OpenMetaverse; 43using OpenMetaverse;
43 44
@@ -55,6 +56,12 @@ namespace OpenSim.Server.Handlers.Asset
55 m_AssetService = service; 56 m_AssetService = service;
56 } 57 }
57 58
59 public AssetsExistHandler(IAssetService service, IServiceAuth auth) :
60 base("POST", "/get_assets_exist", auth)
61 {
62 m_AssetService = service;
63 }
64
58 protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 65 protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
59 { 66 {
60 XmlSerializer xs; 67 XmlSerializer xs;
diff --git a/OpenSim/Server/Handlers/Authentication/AuthenticationServerConnector.cs b/OpenSim/Server/Handlers/Authentication/AuthenticationServerConnector.cs
index 848a037..c9a8dce 100644
--- a/OpenSim/Server/Handlers/Authentication/AuthenticationServerConnector.cs
+++ b/OpenSim/Server/Handlers/Authentication/AuthenticationServerConnector.cs
@@ -29,6 +29,7 @@ using System;
29using Nini.Config; 29using Nini.Config;
30using OpenSim.Server.Base; 30using OpenSim.Server.Base;
31using OpenSim.Services.Interfaces; 31using OpenSim.Services.Interfaces;
32using OpenSim.Framework.ServiceAuth;
32using OpenSim.Framework.Servers.HttpServer; 33using OpenSim.Framework.Servers.HttpServer;
33using OpenSim.Server.Handlers.Base; 34using OpenSim.Server.Handlers.Base;
34 35
@@ -58,7 +59,9 @@ namespace OpenSim.Server.Handlers.Authentication
58 Object[] args = new Object[] { config }; 59 Object[] args = new Object[] { config };
59 m_AuthenticationService = ServerUtils.LoadPlugin<IAuthenticationService>(authenticationService, args); 60 m_AuthenticationService = ServerUtils.LoadPlugin<IAuthenticationService>(authenticationService, args);
60 61
61 server.AddStreamHandler(new AuthenticationServerPostHandler(m_AuthenticationService, serverConfig)); 62 IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);
63
64 server.AddStreamHandler(new AuthenticationServerPostHandler(m_AuthenticationService, serverConfig, auth));
62 } 65 }
63 } 66 }
64} 67}
diff --git a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs
index 16e011a..e258dde 100644
--- a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs
@@ -39,6 +39,7 @@ using System.Collections.Generic;
39using OpenSim.Server.Base; 39using OpenSim.Server.Base;
40using OpenSim.Services.Interfaces; 40using OpenSim.Services.Interfaces;
41using OpenSim.Framework; 41using OpenSim.Framework;
42using OpenSim.Framework.ServiceAuth;
42using OpenSim.Framework.Servers.HttpServer; 43using OpenSim.Framework.Servers.HttpServer;
43using OpenMetaverse; 44using OpenMetaverse;
44 45
@@ -55,10 +56,10 @@ namespace OpenSim.Server.Handlers.Authentication
55 private bool m_AllowSetPassword = false; 56 private bool m_AllowSetPassword = false;
56 57
57 public AuthenticationServerPostHandler(IAuthenticationService service) : 58 public AuthenticationServerPostHandler(IAuthenticationService service) :
58 this(service, null) {} 59 this(service, null, null) {}
59 60
60 public AuthenticationServerPostHandler(IAuthenticationService service, IConfig config) : 61 public AuthenticationServerPostHandler(IAuthenticationService service, IConfig config, IServiceAuth auth) :
61 base("POST", "/auth") 62 base("POST", "/auth", auth)
62 { 63 {
63 m_AuthenticationService = service; 64 m_AuthenticationService = service;
64 65
@@ -73,6 +74,7 @@ namespace OpenSim.Server.Handlers.Authentication
73 protected override byte[] ProcessRequest(string path, Stream request, 74 protected override byte[] ProcessRequest(string path, Stream request,
74 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 75 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
75 { 76 {
77 m_log.Error("[XXX]: Authenticating...");
76 string[] p = SplitParams(path); 78 string[] p = SplitParams(path);
77 79
78 if (p.Length > 0) 80 if (p.Length > 0)
diff --git a/OpenSim/Server/Handlers/Avatar/AvatarServerConnector.cs b/OpenSim/Server/Handlers/Avatar/AvatarServerConnector.cs
index 9a57cd9..1831e84 100644
--- a/OpenSim/Server/Handlers/Avatar/AvatarServerConnector.cs
+++ b/OpenSim/Server/Handlers/Avatar/AvatarServerConnector.cs
@@ -29,6 +29,7 @@ using System;
29using Nini.Config; 29using Nini.Config;
30using OpenSim.Server.Base; 30using OpenSim.Server.Base;
31using OpenSim.Services.Interfaces; 31using OpenSim.Services.Interfaces;
32using OpenSim.Framework.ServiceAuth;
32using OpenSim.Framework.Servers.HttpServer; 33using OpenSim.Framework.Servers.HttpServer;
33using OpenSim.Server.Handlers.Base; 34using OpenSim.Server.Handlers.Base;
34 35
@@ -55,7 +56,9 @@ namespace OpenSim.Server.Handlers.Avatar
55 Object[] args = new Object[] { config }; 56 Object[] args = new Object[] { config };
56 m_AvatarService = ServerUtils.LoadPlugin<IAvatarService>(avatarService, args); 57 m_AvatarService = ServerUtils.LoadPlugin<IAvatarService>(avatarService, args);
57 58
58 server.AddStreamHandler(new AvatarServerPostHandler(m_AvatarService)); 59 IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);
60
61 server.AddStreamHandler(new AvatarServerPostHandler(m_AvatarService, auth));
59 } 62 }
60 } 63 }
61} 64}
diff --git a/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs b/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs
index d6bbb8f..59dbed4 100644
--- a/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs
@@ -39,6 +39,7 @@ using System.Collections.Generic;
39using OpenSim.Server.Base; 39using OpenSim.Server.Base;
40using OpenSim.Services.Interfaces; 40using OpenSim.Services.Interfaces;
41using OpenSim.Framework; 41using OpenSim.Framework;
42using OpenSim.Framework.ServiceAuth;
42using OpenSim.Framework.Servers.HttpServer; 43using OpenSim.Framework.Servers.HttpServer;
43using OpenMetaverse; 44using OpenMetaverse;
44 45
@@ -50,8 +51,8 @@ namespace OpenSim.Server.Handlers.Avatar
50 51
51 private IAvatarService m_AvatarService; 52 private IAvatarService m_AvatarService;
52 53
53 public AvatarServerPostHandler(IAvatarService service) : 54 public AvatarServerPostHandler(IAvatarService service, IServiceAuth auth) :
54 base("POST", "/avatar") 55 base("POST", "/avatar", auth)
55 { 56 {
56 m_AvatarService = service; 57 m_AvatarService = service;
57 } 58 }
diff --git a/OpenSim/Server/Handlers/BakedTextures/XBakesGetHandler.cs b/OpenSim/Server/Handlers/BakedTextures/XBakesGetHandler.cs
index fb4b794..9e703f1 100644
--- a/OpenSim/Server/Handlers/BakedTextures/XBakesGetHandler.cs
+++ b/OpenSim/Server/Handlers/BakedTextures/XBakesGetHandler.cs
@@ -38,6 +38,7 @@ using System.Xml.Serialization;
38using OpenSim.Server.Base; 38using OpenSim.Server.Base;
39using OpenSim.Services.Interfaces; 39using OpenSim.Services.Interfaces;
40using OpenSim.Framework; 40using OpenSim.Framework;
41using OpenSim.Framework.ServiceAuth;
41using OpenSim.Framework.Servers.HttpServer; 42using OpenSim.Framework.Servers.HttpServer;
42 43
43namespace OpenSim.Server.Handlers.BakedTextures 44namespace OpenSim.Server.Handlers.BakedTextures
@@ -50,14 +51,14 @@ namespace OpenSim.Server.Handlers.BakedTextures
50 private System.Text.UTF8Encoding utf8 = 51 private System.Text.UTF8Encoding utf8 =
51 new System.Text.UTF8Encoding(); 52 new System.Text.UTF8Encoding();
52 53
53 public BakesServerGetHandler(IBakedTextureService service) : 54 public BakesServerGetHandler(IBakedTextureService service, IServiceAuth auth) :
54 base("GET", "/bakes") 55 base("GET", "/bakes", auth)
55 { 56 {
56 m_BakesService = service; 57 m_BakesService = service;
57 } 58 }
58 59
59 public override byte[] Handle(string path, Stream request, 60 protected override byte[] ProcessRequest(
60 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 61 string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
61 { 62 {
62 string[] p = SplitParams(path); 63 string[] p = SplitParams(path);
63 64
diff --git a/OpenSim/Server/Handlers/BakedTextures/XBakesHandler.cs b/OpenSim/Server/Handlers/BakedTextures/XBakesHandler.cs
index 7bf7641..4c12967 100644
--- a/OpenSim/Server/Handlers/BakedTextures/XBakesHandler.cs
+++ b/OpenSim/Server/Handlers/BakedTextures/XBakesHandler.cs
@@ -29,6 +29,7 @@ using System;
29using Nini.Config; 29using Nini.Config;
30using OpenSim.Server.Base; 30using OpenSim.Server.Base;
31using OpenSim.Services.Interfaces; 31using OpenSim.Services.Interfaces;
32using OpenSim.Framework.ServiceAuth;
32using OpenSim.Framework.Servers.HttpServer; 33using OpenSim.Framework.Servers.HttpServer;
33using OpenSim.Server.Handlers.Base; 34using OpenSim.Server.Handlers.Base;
34 35
@@ -59,8 +60,10 @@ namespace OpenSim.Server.Handlers.BakedTextures
59 m_BakesService = 60 m_BakesService =
60 ServerUtils.LoadPlugin<IBakedTextureService>(assetService, args); 61 ServerUtils.LoadPlugin<IBakedTextureService>(assetService, args);
61 62
62 server.AddStreamHandler(new BakesServerGetHandler(m_BakesService)); 63 IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);
63 server.AddStreamHandler(new BakesServerPostHandler(m_BakesService)); 64
65 server.AddStreamHandler(new BakesServerGetHandler(m_BakesService, auth));
66 server.AddStreamHandler(new BakesServerPostHandler(m_BakesService, auth));
64 } 67 }
65 } 68 }
66} 69}
diff --git a/OpenSim/Server/Handlers/BakedTextures/XBakesPostHandler.cs b/OpenSim/Server/Handlers/BakedTextures/XBakesPostHandler.cs
index 69adb7f..1aacbc9 100644
--- a/OpenSim/Server/Handlers/BakedTextures/XBakesPostHandler.cs
+++ b/OpenSim/Server/Handlers/BakedTextures/XBakesPostHandler.cs
@@ -38,27 +38,28 @@ using System.Xml.Serialization;
38using OpenSim.Server.Base; 38using OpenSim.Server.Base;
39using OpenSim.Services.Interfaces; 39using OpenSim.Services.Interfaces;
40using OpenSim.Framework; 40using OpenSim.Framework;
41using OpenSim.Framework.ServiceAuth;
41using OpenSim.Framework.Servers.HttpServer; 42using OpenSim.Framework.Servers.HttpServer;
42 43
43namespace OpenSim.Server.Handlers.BakedTextures 44namespace OpenSim.Server.Handlers.BakedTextures
44{ 45{
45 public class BakesServerPostHandler : BaseStreamHandler 46 public class BakesServerPostHandler : BaseStreamHandler
46 { 47 {
47 // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 49
49 private IBakedTextureService m_BakesService; 50 private IBakedTextureService m_BakesService;
50 51
51 private System.Text.UTF8Encoding utf8 = 52 private System.Text.UTF8Encoding utf8 =
52 new System.Text.UTF8Encoding(); 53 new System.Text.UTF8Encoding();
53 54
54 public BakesServerPostHandler(IBakedTextureService service) : 55 public BakesServerPostHandler(IBakedTextureService service, IServiceAuth auth) :
55 base("POST", "/bakes") 56 base("POST", "/bakes", auth)
56 { 57 {
57 m_BakesService = service; 58 m_BakesService = service;
58 } 59 }
59 60
60 public override byte[] Handle(string path, Stream request, 61 protected override byte[] ProcessRequest(
61 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 62 string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
62 { 63 {
63 string[] p = SplitParams(path); 64 string[] p = SplitParams(path);
64 65
diff --git a/OpenSim/Server/Handlers/Friends/FriendServerConnector.cs b/OpenSim/Server/Handlers/Friends/FriendServerConnector.cs
index 5784bdf..b0e6c7d 100644
--- a/OpenSim/Server/Handlers/Friends/FriendServerConnector.cs
+++ b/OpenSim/Server/Handlers/Friends/FriendServerConnector.cs
@@ -29,6 +29,7 @@ using System;
29using Nini.Config; 29using Nini.Config;
30using OpenSim.Server.Base; 30using OpenSim.Server.Base;
31using OpenSim.Services.Interfaces; 31using OpenSim.Services.Interfaces;
32using OpenSim.Framework.ServiceAuth;
32using OpenSim.Framework.Servers.HttpServer; 33using OpenSim.Framework.Servers.HttpServer;
33using OpenSim.Server.Handlers.Base; 34using OpenSim.Server.Handlers.Base;
34 35
@@ -55,7 +56,8 @@ namespace OpenSim.Server.Handlers.Friends
55 Object[] args = new Object[] { config }; 56 Object[] args = new Object[] { config };
56 m_FriendsService = ServerUtils.LoadPlugin<IFriendsService>(theService, args); 57 m_FriendsService = ServerUtils.LoadPlugin<IFriendsService>(theService, args);
57 58
58 server.AddStreamHandler(new FriendsServerPostHandler(m_FriendsService)); 59 IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);
60 server.AddStreamHandler(new FriendsServerPostHandler(m_FriendsService, auth));
59 } 61 }
60 } 62 }
61} 63}
diff --git a/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs b/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs
index ca0a24c..d442443 100644
--- a/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs
@@ -40,6 +40,7 @@ using OpenSim.Server.Base;
40using OpenSim.Services.Interfaces; 40using OpenSim.Services.Interfaces;
41using FriendInfo = OpenSim.Services.Interfaces.FriendInfo; 41using FriendInfo = OpenSim.Services.Interfaces.FriendInfo;
42using OpenSim.Framework; 42using OpenSim.Framework;
43using OpenSim.Framework.ServiceAuth;
43using OpenSim.Framework.Servers.HttpServer; 44using OpenSim.Framework.Servers.HttpServer;
44using OpenMetaverse; 45using OpenMetaverse;
45 46
@@ -51,8 +52,8 @@ namespace OpenSim.Server.Handlers.Friends
51 52
52 private IFriendsService m_FriendsService; 53 private IFriendsService m_FriendsService;
53 54
54 public FriendsServerPostHandler(IFriendsService service) : 55 public FriendsServerPostHandler(IFriendsService service, IServiceAuth auth) :
55 base("POST", "/friends") 56 base("POST", "/friends", auth)
56 { 57 {
57 m_FriendsService = service; 58 m_FriendsService = service;
58 } 59 }
diff --git a/OpenSim/Server/Handlers/Grid/GridServerConnector.cs b/OpenSim/Server/Handlers/Grid/GridServerConnector.cs
index 14daf12..6eb6a79 100644
--- a/OpenSim/Server/Handlers/Grid/GridServerConnector.cs
+++ b/OpenSim/Server/Handlers/Grid/GridServerConnector.cs
@@ -29,6 +29,7 @@ using System;
29using Nini.Config; 29using Nini.Config;
30using OpenSim.Server.Base; 30using OpenSim.Server.Base;
31using OpenSim.Services.Interfaces; 31using OpenSim.Services.Interfaces;
32using OpenSim.Framework.ServiceAuth;
32using OpenSim.Framework.Servers.HttpServer; 33using OpenSim.Framework.Servers.HttpServer;
33using OpenSim.Server.Handlers.Base; 34using OpenSim.Server.Handlers.Base;
34 35
@@ -55,7 +56,9 @@ namespace OpenSim.Server.Handlers.Grid
55 Object[] args = new Object[] { config }; 56 Object[] args = new Object[] { config };
56 m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); 57 m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args);
57 58
58 server.AddStreamHandler(new GridServerPostHandler(m_GridService)); 59 IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);
60
61 server.AddStreamHandler(new GridServerPostHandler(m_GridService, auth));
59 } 62 }
60 } 63 }
61} 64}
diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
index 37ca5a4..dda4756 100644
--- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
@@ -40,6 +40,7 @@ using OpenSim.Server.Base;
40using OpenSim.Services.Interfaces; 40using OpenSim.Services.Interfaces;
41using GridRegion = OpenSim.Services.Interfaces.GridRegion; 41using GridRegion = OpenSim.Services.Interfaces.GridRegion;
42using OpenSim.Framework; 42using OpenSim.Framework;
43using OpenSim.Framework.ServiceAuth;
43using OpenSim.Framework.Servers.HttpServer; 44using OpenSim.Framework.Servers.HttpServer;
44using OpenMetaverse; 45using OpenMetaverse;
45 46
@@ -55,8 +56,8 @@ namespace OpenSim.Server.Handlers.Grid
55 56
56 private IGridService m_GridService; 57 private IGridService m_GridService;
57 58
58 public GridServerPostHandler(IGridService service) : 59 public GridServerPostHandler(IGridService service, IServiceAuth auth) :
59 base("POST", "/grid") 60 base("POST", "/grid", auth)
60 { 61 {
61 m_GridService = service; 62 m_GridService = service;
62 } 63 }
diff --git a/OpenSim/Server/Handlers/GridUser/GridUserServerConnector.cs b/OpenSim/Server/Handlers/GridUser/GridUserServerConnector.cs
index 66f35e3..1e29378 100644
--- a/OpenSim/Server/Handlers/GridUser/GridUserServerConnector.cs
+++ b/OpenSim/Server/Handlers/GridUser/GridUserServerConnector.cs
@@ -29,6 +29,7 @@ using System;
29using Nini.Config; 29using Nini.Config;
30using OpenSim.Server.Base; 30using OpenSim.Server.Base;
31using OpenSim.Services.Interfaces; 31using OpenSim.Services.Interfaces;
32using OpenSim.Framework.ServiceAuth;
32using OpenSim.Framework.Servers.HttpServer; 33using OpenSim.Framework.Servers.HttpServer;
33using OpenSim.Server.Handlers.Base; 34using OpenSim.Server.Handlers.Base;
34 35
@@ -55,7 +56,9 @@ namespace OpenSim.Server.Handlers.GridUser
55 Object[] args = new Object[] { config }; 56 Object[] args = new Object[] { config };
56 m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(service, args); 57 m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(service, args);
57 58
58 server.AddStreamHandler(new GridUserServerPostHandler(m_GridUserService)); 59 IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName); ;
60
61 server.AddStreamHandler(new GridUserServerPostHandler(m_GridUserService, auth));
59 } 62 }
60 } 63 }
61} 64}
diff --git a/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs b/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs
index 0b98e9a..006f6ab 100644
--- a/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs
@@ -39,6 +39,7 @@ using System.Collections.Generic;
39using OpenSim.Server.Base; 39using OpenSim.Server.Base;
40using OpenSim.Services.Interfaces; 40using OpenSim.Services.Interfaces;
41using OpenSim.Framework; 41using OpenSim.Framework;
42using OpenSim.Framework.ServiceAuth;
42using OpenSim.Framework.Servers.HttpServer; 43using OpenSim.Framework.Servers.HttpServer;
43using OpenMetaverse; 44using OpenMetaverse;
44 45
@@ -50,8 +51,8 @@ namespace OpenSim.Server.Handlers.GridUser
50 51
51 private IGridUserService m_GridUserService; 52 private IGridUserService m_GridUserService;
52 53
53 public GridUserServerPostHandler(IGridUserService service) : 54 public GridUserServerPostHandler(IGridUserService service, IServiceAuth auth) :
54 base("POST", "/griduser") 55 base("POST", "/griduser", auth)
55 { 56 {
56 m_GridUserService = service; 57 m_GridUserService = service;
57 } 58 }
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
index ce975a8..7283237 100644
--- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
+++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
@@ -33,6 +33,7 @@ using System.Collections.Generic;
33using System.IO; 33using System.IO;
34using Nini.Config; 34using Nini.Config;
35using OpenSim.Framework; 35using OpenSim.Framework;
36using OpenSim.Framework.ServiceAuth;
36using OpenSim.Server.Base; 37using OpenSim.Server.Base;
37using OpenSim.Services.Interfaces; 38using OpenSim.Services.Interfaces;
38using OpenSim.Framework.Servers.HttpServer; 39using OpenSim.Framework.Servers.HttpServer;
@@ -71,7 +72,9 @@ namespace OpenSim.Server.Handlers.Asset
71 m_InventoryService = 72 m_InventoryService =
72 ServerUtils.LoadPlugin<IInventoryService>(inventoryService, args); 73 ServerUtils.LoadPlugin<IInventoryService>(inventoryService, args);
73 74
74 server.AddStreamHandler(new XInventoryConnectorPostHandler(m_InventoryService)); 75 IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);
76
77 server.AddStreamHandler(new XInventoryConnectorPostHandler(m_InventoryService, auth));
75 } 78 }
76 } 79 }
77 80
@@ -81,8 +84,8 @@ namespace OpenSim.Server.Handlers.Asset
81 84
82 private IInventoryService m_InventoryService; 85 private IInventoryService m_InventoryService;
83 86
84 public XInventoryConnectorPostHandler(IInventoryService service) : 87 public XInventoryConnectorPostHandler(IInventoryService service, IServiceAuth auth) :
85 base("POST", "/xinventory") 88 base("POST", "/xinventory", auth)
86 { 89 {
87 m_InventoryService = service; 90 m_InventoryService = service;
88 } 91 }
diff --git a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs
index 4d1729e..a896fdb 100644
--- a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs
+++ b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs
@@ -38,6 +38,7 @@ using OpenMetaverse;
38using OpenSim.Framework; 38using OpenSim.Framework;
39using OpenSim.Server.Base; 39using OpenSim.Server.Base;
40using OpenSim.Services.Interfaces; 40using OpenSim.Services.Interfaces;
41using OpenSim.Framework.ServiceAuth;
41using OpenSim.Framework.Servers.HttpServer; 42using OpenSim.Framework.Servers.HttpServer;
42using OpenSim.Server.Handlers.Base; 43using OpenSim.Server.Handlers.Base;
43 44
@@ -79,7 +80,8 @@ namespace OpenSim.Server.Handlers.MapImage
79 m_log.InfoFormat("[MAP IMAGE HANDLER]: GridService check is OFF"); 80 m_log.InfoFormat("[MAP IMAGE HANDLER]: GridService check is OFF");
80 81
81 bool proxy = serverConfig.GetBoolean("HasProxy", false); 82 bool proxy = serverConfig.GetBoolean("HasProxy", false);
82 server.AddStreamHandler(new MapServerPostHandler(m_MapService, m_GridService, proxy)); 83 IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);
84 server.AddStreamHandler(new MapServerPostHandler(m_MapService, m_GridService, proxy, auth));
83 85
84 } 86 }
85 } 87 }
@@ -91,8 +93,8 @@ namespace OpenSim.Server.Handlers.MapImage
91 private IGridService m_GridService; 93 private IGridService m_GridService;
92 bool m_Proxy; 94 bool m_Proxy;
93 95
94 public MapServerPostHandler(IMapImageService service, IGridService grid, bool proxy) : 96 public MapServerPostHandler(IMapImageService service, IGridService grid, bool proxy, IServiceAuth auth) :
95 base("POST", "/map") 97 base("POST", "/map", auth)
96 { 98 {
97 m_MapService = service; 99 m_MapService = service;
98 m_GridService = grid; 100 m_GridService = grid;
diff --git a/OpenSim/Server/Handlers/Presence/PresenceServerConnector.cs b/OpenSim/Server/Handlers/Presence/PresenceServerConnector.cs
index 899cd8f..7a63c36 100644
--- a/OpenSim/Server/Handlers/Presence/PresenceServerConnector.cs
+++ b/OpenSim/Server/Handlers/Presence/PresenceServerConnector.cs
@@ -30,6 +30,7 @@ using Nini.Config;
30using OpenSim.Server.Base; 30using OpenSim.Server.Base;
31using OpenSim.Services.Interfaces; 31using OpenSim.Services.Interfaces;
32using OpenSim.Framework.Servers.HttpServer; 32using OpenSim.Framework.Servers.HttpServer;
33using OpenSim.Framework.ServiceAuth;
33using OpenSim.Server.Handlers.Base; 34using OpenSim.Server.Handlers.Base;
34 35
35namespace OpenSim.Server.Handlers.Presence 36namespace OpenSim.Server.Handlers.Presence
@@ -55,7 +56,9 @@ namespace OpenSim.Server.Handlers.Presence
55 Object[] args = new Object[] { config }; 56 Object[] args = new Object[] { config };
56 m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(gridService, args); 57 m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(gridService, args);
57 58
58 server.AddStreamHandler(new PresenceServerPostHandler(m_PresenceService)); 59 IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);
60
61 server.AddStreamHandler(new PresenceServerPostHandler(m_PresenceService, auth));
59 } 62 }
60 } 63 }
61} 64}
diff --git a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs
index abb4b19..0b3b961 100644
--- a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs
@@ -40,6 +40,7 @@ using OpenSim.Server.Base;
40using OpenSim.Services.Interfaces; 40using OpenSim.Services.Interfaces;
41using OpenSim.Framework; 41using OpenSim.Framework;
42using OpenSim.Framework.Servers.HttpServer; 42using OpenSim.Framework.Servers.HttpServer;
43using OpenSim.Framework.ServiceAuth;
43using OpenMetaverse; 44using OpenMetaverse;
44 45
45namespace OpenSim.Server.Handlers.Presence 46namespace OpenSim.Server.Handlers.Presence
@@ -50,8 +51,8 @@ namespace OpenSim.Server.Handlers.Presence
50 51
51 private IPresenceService m_PresenceService; 52 private IPresenceService m_PresenceService;
52 53
53 public PresenceServerPostHandler(IPresenceService service) : 54 public PresenceServerPostHandler(IPresenceService service, IServiceAuth auth) :
54 base("POST", "/presence") 55 base("POST", "/presence", auth)
55 { 56 {
56 m_PresenceService = service; 57 m_PresenceService = service;
57 } 58 }
diff --git a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerConnector.cs b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerConnector.cs
index 344b513..e95e3dc 100644
--- a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerConnector.cs
+++ b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerConnector.cs
@@ -30,6 +30,7 @@ using Nini.Config;
30using OpenSim.Server.Base; 30using OpenSim.Server.Base;
31using OpenSim.Services.Interfaces; 31using OpenSim.Services.Interfaces;
32using OpenSim.Framework.Servers.HttpServer; 32using OpenSim.Framework.Servers.HttpServer;
33using OpenSim.Framework.ServiceAuth;
33using OpenSim.Server.Handlers.Base; 34using OpenSim.Server.Handlers.Base;
34 35
35namespace OpenSim.Server.Handlers.UserAccounts 36namespace OpenSim.Server.Handlers.UserAccounts
@@ -55,7 +56,9 @@ namespace OpenSim.Server.Handlers.UserAccounts
55 Object[] args = new Object[] { config }; 56 Object[] args = new Object[] { config };
56 m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(service, args); 57 m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(service, args);
57 58
58 server.AddStreamHandler(new UserAccountServerPostHandler(m_UserAccountService, serverConfig)); 59 IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);
60
61 server.AddStreamHandler(new UserAccountServerPostHandler(m_UserAccountService, serverConfig, auth));
59 } 62 }
60 } 63 }
61} 64}
diff --git a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs
index 24c9de6..c87e022 100644
--- a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs
@@ -41,6 +41,7 @@ using OpenSim.Services.Interfaces;
41using OpenSim.Services.UserAccountService; 41using OpenSim.Services.UserAccountService;
42using OpenSim.Framework; 42using OpenSim.Framework;
43using OpenSim.Framework.Servers.HttpServer; 43using OpenSim.Framework.Servers.HttpServer;
44using OpenSim.Framework.ServiceAuth;
44using OpenMetaverse; 45using OpenMetaverse;
45 46
46namespace OpenSim.Server.Handlers.UserAccounts 47namespace OpenSim.Server.Handlers.UserAccounts
@@ -54,10 +55,10 @@ namespace OpenSim.Server.Handlers.UserAccounts
54 private bool m_AllowSetAccount = false; 55 private bool m_AllowSetAccount = false;
55 56
56 public UserAccountServerPostHandler(IUserAccountService service) 57 public UserAccountServerPostHandler(IUserAccountService service)
57 : this(service, null) {} 58 : this(service, null, null) {}
58 59
59 public UserAccountServerPostHandler(IUserAccountService service, IConfig config) : 60 public UserAccountServerPostHandler(IUserAccountService service, IConfig config, IServiceAuth auth) :
60 base("POST", "/accounts") 61 base("POST", "/accounts", auth)
61 { 62 {
62 m_UserAccountService = service; 63 m_UserAccountService = service;
63 64