diff options
Diffstat (limited to '')
5 files changed, 35 insertions, 4 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; | |||
30 | using Nini.Config; | 30 | using Nini.Config; |
31 | using OpenMetaverse; | 31 | using OpenMetaverse; |
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenSim.Framework.ServiceAuth; | ||
33 | using OpenSim.Framework.Console; | 34 | using OpenSim.Framework.Console; |
34 | using OpenSim.Server.Base; | 35 | using OpenSim.Server.Base; |
35 | using OpenSim.Services.Interfaces; | 36 | using 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; | |||
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.Asset | 44 | namespace 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; | |||
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.Asset | 44 | namespace 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; | |||
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.Asset | 44 | namespace 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; | |||
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 | using OpenMetaverse; | 43 | using 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; |