Adds support at the inventory server for direct inventory manipulation from authorized clients using capabilities. Provided keys are verified with the designated authority. The added code is only executed for clients following HGLoginAuth procedure or similar. It does not remove any existing behavior.

0.6.5-rc1
diva 2009-03-30 19:35:55 +00:00
parent 4cbf963354
commit b73ce1143a
2 changed files with 31 additions and 2 deletions

View File

@ -41,8 +41,11 @@ namespace OpenSim.Framework
public string DatabaseProvider = String.Empty; public string DatabaseProvider = String.Empty;
public string DefaultStartupMsg = String.Empty; public string DefaultStartupMsg = String.Empty;
public uint HttpPort = DefaultHttpPort; public uint HttpPort = DefaultHttpPort;
public string InventoryServerURL = String.Empty;
public string UserServerURL = String.Empty; public string UserServerURL = String.Empty;
public string AssetServerURL = String.Empty;
public bool SessionLookUp = true; public bool SessionLookUp = true;
public bool RegionAccessToAgentsInventory = true;
public InventoryConfig(string description, string filename) public InventoryConfig(string description, string filename)
{ {
@ -53,10 +56,18 @@ namespace OpenSim.Framework
public void loadConfigurationOptions() public void loadConfigurationOptions()
{ {
configMember.addConfigurationOption("default_inventory_server",
ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
"Default Inventory Server URI (this server's external name)",
"http://127.0.0.1:8004", false);
configMember.addConfigurationOption("default_user_server", configMember.addConfigurationOption("default_user_server",
ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
"Default User Server URI", "Default User Server URI",
"http://127.0.0.1:" + UserConfig.DefaultHttpPort.ToString(), false); "http://127.0.0.1:8002", false);
configMember.addConfigurationOption("default_asset_server",
ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
"Default Asset Server URI",
"http://127.0.0.1:8003", false);
configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
"DLL for database provider", "OpenSim.Data.MySQL.dll", false); "DLL for database provider", "OpenSim.Data.MySQL.dll", false);
configMember.addConfigurationOption("database_connect", ConfigurationOption.ConfigurationTypes.TYPE_STRING, configMember.addConfigurationOption("database_connect", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
@ -65,15 +76,23 @@ namespace OpenSim.Framework
"Http Listener port", DefaultHttpPort.ToString(), false); "Http Listener port", DefaultHttpPort.ToString(), false);
configMember.addConfigurationOption("session_lookup", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, configMember.addConfigurationOption("session_lookup", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN,
"Enable session lookup security", "False", false); "Enable session lookup security", "False", false);
configMember.addConfigurationOption("region_access", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN,
"Allow direct region access to users inventories? (Keep True if you don't know what this is about)", "True", false);
} }
public bool handleIncomingConfiguration(string configuration_key, object configuration_result) public bool handleIncomingConfiguration(string configuration_key, object configuration_result)
{ {
switch (configuration_key) switch (configuration_key)
{ {
case "default_inventory_server":
InventoryServerURL = (string)configuration_result;
break;
case "default_user_server": case "default_user_server":
UserServerURL = (string) configuration_result; UserServerURL = (string) configuration_result;
break; break;
case "default_asset_server":
AssetServerURL = (string)configuration_result;
break;
case "database_provider": case "database_provider":
DatabaseProvider = (string) configuration_result; DatabaseProvider = (string) configuration_result;
break; break;
@ -86,6 +105,9 @@ namespace OpenSim.Framework
case "session_lookup": case "session_lookup":
SessionLookUp = (bool)configuration_result; SessionLookUp = (bool)configuration_result;
break; break;
case "region_access":
RegionAccessToAgentsInventory = (bool)configuration_result;
break;
} }
return true; return true;

View File

@ -33,6 +33,7 @@ using log4net;
using log4net.Config; using log4net.Config;
using OpenMetaverse; using OpenMetaverse;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Communications.Services;
using OpenSim.Framework.Console; using OpenSim.Framework.Console;
using OpenSim.Framework.Servers; using OpenSim.Framework.Servers;
@ -43,6 +44,7 @@ namespace OpenSim.Grid.InventoryServer
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private GridInventoryService m_inventoryService; private GridInventoryService m_inventoryService;
private HGInventoryService m_directInventoryService;
public const string LogName = "INVENTORY"; public const string LogName = "INVENTORY";
@ -70,14 +72,19 @@ namespace OpenSim.Grid.InventoryServer
m_inventoryService.DoLookup = config.SessionLookUp; m_inventoryService.DoLookup = config.SessionLookUp;
m_inventoryService.AddPlugin(config.DatabaseProvider, config.DatabaseConnect); m_inventoryService.AddPlugin(config.DatabaseProvider, config.DatabaseConnect);
m_log.Info("[" + LogName + "]: Starting HTTP server ..."); m_log.Info("[" + LogName + "]: Starting HTTP server ...");
m_httpServer = new BaseHttpServer(config.HttpPort); m_httpServer = new BaseHttpServer(config.HttpPort);
if (config.RegionAccessToAgentsInventory)
AddHttpHandlers(); AddHttpHandlers();
m_httpServer.Start(); m_httpServer.Start();
m_log.Info("[" + LogName + "]: Started HTTP server"); m_log.Info("[" + LogName + "]: Started HTTP server");
m_directInventoryService = new HGInventoryService(m_inventoryService, config.AssetServerURL, config.UserServerURL, m_httpServer, config.InventoryServerURL);
base.StartupSpecific(); base.StartupSpecific();
m_console.Commands.AddCommand("inventoryserver", false, "add user", m_console.Commands.AddCommand("inventoryserver", false, "add user",