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/Server/Handlers/BakedTextures | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-20f20895cf1444071d5edc42e11a1fb94b1b1079.zip opensim-SC-20f20895cf1444071d5edc42e11a1fb94b1b1079.tar.gz opensim-SC-20f20895cf1444071d5edc42e11a1fb94b1b1079.tar.bz2 opensim-SC-20f20895cf1444071d5edc42e11a1fb94b1b1079.tar.xz |
Adds optional HTTP Basic Authentication to Robust service connectors.
Diffstat (limited to '')
3 files changed, 16 insertions, 11 deletions
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; | |||
38 | using OpenSim.Server.Base; | 38 | using OpenSim.Server.Base; |
39 | using OpenSim.Services.Interfaces; | 39 | using OpenSim.Services.Interfaces; |
40 | using OpenSim.Framework; | 40 | using OpenSim.Framework; |
41 | using OpenSim.Framework.ServiceAuth; | ||
41 | using OpenSim.Framework.Servers.HttpServer; | 42 | using OpenSim.Framework.Servers.HttpServer; |
42 | 43 | ||
43 | namespace OpenSim.Server.Handlers.BakedTextures | 44 | namespace 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; | |||
29 | using Nini.Config; | 29 | using Nini.Config; |
30 | using OpenSim.Server.Base; | 30 | using OpenSim.Server.Base; |
31 | using OpenSim.Services.Interfaces; | 31 | using OpenSim.Services.Interfaces; |
32 | using OpenSim.Framework.ServiceAuth; | ||
32 | using OpenSim.Framework.Servers.HttpServer; | 33 | using OpenSim.Framework.Servers.HttpServer; |
33 | using OpenSim.Server.Handlers.Base; | 34 | using 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; | |||
38 | using OpenSim.Server.Base; | 38 | using OpenSim.Server.Base; |
39 | using OpenSim.Services.Interfaces; | 39 | using OpenSim.Services.Interfaces; |
40 | using OpenSim.Framework; | 40 | using OpenSim.Framework; |
41 | using OpenSim.Framework.ServiceAuth; | ||
41 | using OpenSim.Framework.Servers.HttpServer; | 42 | using OpenSim.Framework.Servers.HttpServer; |
42 | 43 | ||
43 | namespace OpenSim.Server.Handlers.BakedTextures | 44 | namespace 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 | ||