diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/Null/NullAuthenticationData.cs (renamed from OpenSim/Grid/UserServer.Modules/GridInfoServiceModule.cs) | 58 |
1 files changed, 30 insertions, 28 deletions
diff --git a/OpenSim/Grid/UserServer.Modules/GridInfoServiceModule.cs b/OpenSim/Data/Null/NullAuthenticationData.cs index 0c84348..3fb3105 100644 --- a/OpenSim/Grid/UserServer.Modules/GridInfoServiceModule.cs +++ b/OpenSim/Data/Null/NullAuthenticationData.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -26,54 +26,56 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections; | ||
29 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
30 | using System.IO; | ||
31 | using System.Reflection; | ||
32 | using log4net; | ||
33 | using log4net.Config; | ||
34 | using OpenMetaverse; | 31 | using OpenMetaverse; |
35 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
36 | using OpenSim.Framework.Communications; | 33 | using OpenSim.Data; |
37 | using OpenSim.Framework.Communications.Services; | ||
38 | using OpenSim.Framework.Communications.Cache; | ||
39 | using OpenSim.Framework.Servers; | ||
40 | using OpenSim.Framework.Servers.HttpServer; | ||
41 | using OpenSim.Grid.Communications.OGS1; | ||
42 | using OpenSim.Grid.Framework; | ||
43 | 34 | ||
44 | namespace OpenSim.Grid.UserServer.Modules | 35 | namespace OpenSim.Data.Null |
45 | { | 36 | { |
46 | public class GridInfoServiceModule | 37 | public class NullAuthenticationData : IAuthenticationData |
47 | { | 38 | { |
48 | protected IGridServiceCore m_core; | 39 | private static Dictionary<UUID, AuthenticationData> m_DataByUUID = new Dictionary<UUID, AuthenticationData>(); |
49 | protected GridInfoService m_gridInfoService; | 40 | private static Dictionary<UUID, string> m_Tokens = new Dictionary<UUID, string>(); |
50 | protected BaseHttpServer m_httpServer; | ||
51 | 41 | ||
52 | public GridInfoServiceModule() | 42 | public NullAuthenticationData(string connectionString, string realm) |
53 | { | 43 | { |
54 | } | 44 | } |
55 | 45 | ||
56 | public void Initialise(IGridServiceCore core) | 46 | public AuthenticationData Get(UUID principalID) |
57 | { | 47 | { |
58 | m_core = core; | 48 | if (m_DataByUUID.ContainsKey(principalID)) |
59 | m_gridInfoService = new GridInfoService(); | 49 | return m_DataByUUID[principalID]; |
50 | |||
51 | return null; | ||
60 | } | 52 | } |
61 | 53 | ||
62 | public void PostInitialise() | 54 | public bool Store(AuthenticationData data) |
63 | { | 55 | { |
56 | m_DataByUUID[data.PrincipalID] = data; | ||
57 | return true; | ||
58 | } | ||
64 | 59 | ||
60 | public bool SetDataItem(UUID principalID, string item, string value) | ||
61 | { | ||
62 | // Not implemented | ||
63 | return false; | ||
65 | } | 64 | } |
66 | 65 | ||
67 | public void RegisterHandlers(BaseHttpServer httpServer) | 66 | public bool SetToken(UUID principalID, string token, int lifetime) |
68 | { | 67 | { |
69 | m_httpServer = httpServer; | 68 | m_Tokens[principalID] = token; |
70 | m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", | 69 | return true; |
71 | m_gridInfoService.RestGetGridInfoMethod)); | ||
72 | m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod); | ||
73 | } | 70 | } |
74 | 71 | ||
75 | public void Close() | 72 | public bool CheckToken(UUID principalID, string token, int lifetime) |
76 | { | 73 | { |
74 | if (m_Tokens.ContainsKey(principalID)) | ||
75 | return m_Tokens[principalID] == token; | ||
76 | |||
77 | return false; | ||
77 | } | 78 | } |
79 | |||
78 | } | 80 | } |
79 | } | 81 | } |