diff options
author | diva | 2009-03-30 19:35:55 +0000 |
---|---|---|
committer | diva | 2009-03-30 19:35:55 +0000 |
commit | b73ce1143a6d8000f682abed6bc516504cf8ab33 (patch) | |
tree | 5fca31957d89734f0240b5578d40507724140f78 | |
parent | HGInventoryService now uses the actual authority portion of the user's key to... (diff) | |
download | opensim-SC_OLD-b73ce1143a6d8000f682abed6bc516504cf8ab33.zip opensim-SC_OLD-b73ce1143a6d8000f682abed6bc516504cf8ab33.tar.gz opensim-SC_OLD-b73ce1143a6d8000f682abed6bc516504cf8ab33.tar.bz2 opensim-SC_OLD-b73ce1143a6d8000f682abed6bc516504cf8ab33.tar.xz |
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.
-rw-r--r-- | OpenSim/Framework/InventoryConfig.cs | 24 | ||||
-rw-r--r-- | OpenSim/Grid/InventoryServer/Main.cs | 9 |
2 files changed, 31 insertions, 2 deletions
diff --git a/OpenSim/Framework/InventoryConfig.cs b/OpenSim/Framework/InventoryConfig.cs index ef8a28a..90e4482 100644 --- a/OpenSim/Framework/InventoryConfig.cs +++ b/OpenSim/Framework/InventoryConfig.cs | |||
@@ -41,8 +41,11 @@ namespace OpenSim.Framework | |||
41 | public string DatabaseProvider = String.Empty; | 41 | public string DatabaseProvider = String.Empty; |
42 | public string DefaultStartupMsg = String.Empty; | 42 | public string DefaultStartupMsg = String.Empty; |
43 | public uint HttpPort = DefaultHttpPort; | 43 | public uint HttpPort = DefaultHttpPort; |
44 | public string InventoryServerURL = String.Empty; | ||
44 | public string UserServerURL = String.Empty; | 45 | public string UserServerURL = String.Empty; |
46 | public string AssetServerURL = String.Empty; | ||
45 | public bool SessionLookUp = true; | 47 | public bool SessionLookUp = true; |
48 | public bool RegionAccessToAgentsInventory = true; | ||
46 | 49 | ||
47 | public InventoryConfig(string description, string filename) | 50 | public InventoryConfig(string description, string filename) |
48 | { | 51 | { |
@@ -53,10 +56,18 @@ namespace OpenSim.Framework | |||
53 | 56 | ||
54 | public void loadConfigurationOptions() | 57 | public void loadConfigurationOptions() |
55 | { | 58 | { |
59 | configMember.addConfigurationOption("default_inventory_server", | ||
60 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
61 | "Default Inventory Server URI (this server's external name)", | ||
62 | "http://127.0.0.1:8004", false); | ||
56 | configMember.addConfigurationOption("default_user_server", | 63 | configMember.addConfigurationOption("default_user_server", |
57 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | 64 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, |
58 | "Default User Server URI", | 65 | "Default User Server URI", |
59 | "http://127.0.0.1:" + UserConfig.DefaultHttpPort.ToString(), false); | 66 | "http://127.0.0.1:8002", false); |
67 | configMember.addConfigurationOption("default_asset_server", | ||
68 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
69 | "Default Asset Server URI", | ||
70 | "http://127.0.0.1:8003", false); | ||
60 | configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | 71 | configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, |
61 | "DLL for database provider", "OpenSim.Data.MySQL.dll", false); | 72 | "DLL for database provider", "OpenSim.Data.MySQL.dll", false); |
62 | configMember.addConfigurationOption("database_connect", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | 73 | configMember.addConfigurationOption("database_connect", ConfigurationOption.ConfigurationTypes.TYPE_STRING, |
@@ -65,15 +76,23 @@ namespace OpenSim.Framework | |||
65 | "Http Listener port", DefaultHttpPort.ToString(), false); | 76 | "Http Listener port", DefaultHttpPort.ToString(), false); |
66 | configMember.addConfigurationOption("session_lookup", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, | 77 | configMember.addConfigurationOption("session_lookup", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, |
67 | "Enable session lookup security", "False", false); | 78 | "Enable session lookup security", "False", false); |
79 | configMember.addConfigurationOption("region_access", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, | ||
80 | "Allow direct region access to users inventories? (Keep True if you don't know what this is about)", "True", false); | ||
68 | } | 81 | } |
69 | 82 | ||
70 | public bool handleIncomingConfiguration(string configuration_key, object configuration_result) | 83 | public bool handleIncomingConfiguration(string configuration_key, object configuration_result) |
71 | { | 84 | { |
72 | switch (configuration_key) | 85 | switch (configuration_key) |
73 | { | 86 | { |
87 | case "default_inventory_server": | ||
88 | InventoryServerURL = (string)configuration_result; | ||
89 | break; | ||
74 | case "default_user_server": | 90 | case "default_user_server": |
75 | UserServerURL = (string) configuration_result; | 91 | UserServerURL = (string) configuration_result; |
76 | break; | 92 | break; |
93 | case "default_asset_server": | ||
94 | AssetServerURL = (string)configuration_result; | ||
95 | break; | ||
77 | case "database_provider": | 96 | case "database_provider": |
78 | DatabaseProvider = (string) configuration_result; | 97 | DatabaseProvider = (string) configuration_result; |
79 | break; | 98 | break; |
@@ -86,6 +105,9 @@ namespace OpenSim.Framework | |||
86 | case "session_lookup": | 105 | case "session_lookup": |
87 | SessionLookUp = (bool)configuration_result; | 106 | SessionLookUp = (bool)configuration_result; |
88 | break; | 107 | break; |
108 | case "region_access": | ||
109 | RegionAccessToAgentsInventory = (bool)configuration_result; | ||
110 | break; | ||
89 | } | 111 | } |
90 | 112 | ||
91 | return true; | 113 | return true; |
diff --git a/OpenSim/Grid/InventoryServer/Main.cs b/OpenSim/Grid/InventoryServer/Main.cs index e4cd446..07fb19c 100644 --- a/OpenSim/Grid/InventoryServer/Main.cs +++ b/OpenSim/Grid/InventoryServer/Main.cs | |||
@@ -33,6 +33,7 @@ using log4net; | |||
33 | using log4net.Config; | 33 | using log4net.Config; |
34 | using OpenMetaverse; | 34 | using OpenMetaverse; |
35 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
36 | using OpenSim.Framework.Communications.Services; | ||
36 | using OpenSim.Framework.Console; | 37 | using OpenSim.Framework.Console; |
37 | using OpenSim.Framework.Servers; | 38 | using OpenSim.Framework.Servers; |
38 | 39 | ||
@@ -43,6 +44,7 @@ namespace OpenSim.Grid.InventoryServer | |||
43 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
44 | 45 | ||
45 | private GridInventoryService m_inventoryService; | 46 | private GridInventoryService m_inventoryService; |
47 | private HGInventoryService m_directInventoryService; | ||
46 | 48 | ||
47 | public const string LogName = "INVENTORY"; | 49 | public const string LogName = "INVENTORY"; |
48 | 50 | ||
@@ -70,14 +72,19 @@ namespace OpenSim.Grid.InventoryServer | |||
70 | m_inventoryService.DoLookup = config.SessionLookUp; | 72 | m_inventoryService.DoLookup = config.SessionLookUp; |
71 | m_inventoryService.AddPlugin(config.DatabaseProvider, config.DatabaseConnect); | 73 | m_inventoryService.AddPlugin(config.DatabaseProvider, config.DatabaseConnect); |
72 | 74 | ||
75 | |||
73 | m_log.Info("[" + LogName + "]: Starting HTTP server ..."); | 76 | m_log.Info("[" + LogName + "]: Starting HTTP server ..."); |
74 | 77 | ||
75 | m_httpServer = new BaseHttpServer(config.HttpPort); | 78 | m_httpServer = new BaseHttpServer(config.HttpPort); |
76 | AddHttpHandlers(); | 79 | if (config.RegionAccessToAgentsInventory) |
80 | AddHttpHandlers(); | ||
81 | |||
77 | m_httpServer.Start(); | 82 | m_httpServer.Start(); |
78 | 83 | ||
79 | m_log.Info("[" + LogName + "]: Started HTTP server"); | 84 | m_log.Info("[" + LogName + "]: Started HTTP server"); |
80 | 85 | ||
86 | m_directInventoryService = new HGInventoryService(m_inventoryService, config.AssetServerURL, config.UserServerURL, m_httpServer, config.InventoryServerURL); | ||
87 | |||
81 | base.StartupSpecific(); | 88 | base.StartupSpecific(); |
82 | 89 | ||
83 | m_console.Commands.AddCommand("inventoryserver", false, "add user", | 90 | m_console.Commands.AddCommand("inventoryserver", false, "add user", |