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. --- OpenSim/Server/Handlers/UserAccounts/UserAccountServerConnector.cs | 5 ++++- .../Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'OpenSim/Server/Handlers/UserAccounts') 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; using OpenSim.Server.Base; using OpenSim.Services.Interfaces; using OpenSim.Framework.Servers.HttpServer; +using OpenSim.Framework.ServiceAuth; using OpenSim.Server.Handlers.Base; namespace OpenSim.Server.Handlers.UserAccounts @@ -55,7 +56,9 @@ namespace OpenSim.Server.Handlers.UserAccounts Object[] args = new Object[] { config }; m_UserAccountService = ServerUtils.LoadPlugin(service, args); - server.AddStreamHandler(new UserAccountServerPostHandler(m_UserAccountService, serverConfig)); + IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName); + + server.AddStreamHandler(new UserAccountServerPostHandler(m_UserAccountService, serverConfig, auth)); } } } 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; using OpenSim.Services.UserAccountService; using OpenSim.Framework; using OpenSim.Framework.Servers.HttpServer; +using OpenSim.Framework.ServiceAuth; using OpenMetaverse; namespace OpenSim.Server.Handlers.UserAccounts @@ -54,10 +55,10 @@ namespace OpenSim.Server.Handlers.UserAccounts private bool m_AllowSetAccount = false; public UserAccountServerPostHandler(IUserAccountService service) - : this(service, null) {} + : this(service, null, null) {} - public UserAccountServerPostHandler(IUserAccountService service, IConfig config) : - base("POST", "/accounts") + public UserAccountServerPostHandler(IUserAccountService service, IConfig config, IServiceAuth auth) : + base("POST", "/accounts", auth) { m_UserAccountService = service; -- cgit v1.1