aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/Null/NullAuthenticationData.cs
diff options
context:
space:
mode:
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
28using System; 28using System;
29using System.Collections;
29using System.Collections.Generic; 30using System.Collections.Generic;
30using System.IO;
31using System.Reflection;
32using log4net;
33using log4net.Config;
34using OpenMetaverse; 31using OpenMetaverse;
35using OpenSim.Framework; 32using OpenSim.Framework;
36using OpenSim.Framework.Communications; 33using OpenSim.Data;
37using OpenSim.Framework.Communications.Services;
38using OpenSim.Framework.Communications.Cache;
39using OpenSim.Framework.Servers;
40using OpenSim.Framework.Servers.HttpServer;
41using OpenSim.Grid.Communications.OGS1;
42using OpenSim.Grid.Framework;
43 34
44namespace OpenSim.Grid.UserServer.Modules 35namespace 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}