diff options
author | Diva Canto | 2014-05-23 16:19:43 -0700 |
---|---|---|
committer | Diva Canto | 2014-05-23 16:19:43 -0700 |
commit | 20f20895cf1444071d5edc42e11a1fb94b1b1079 (patch) | |
tree | 0c7547590a89eec47886e0a8646f86ebbf449e63 /OpenSim/Services/Connectors/BaseServiceConnector.cs | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-20f20895cf1444071d5edc42e11a1fb94b1b1079.zip opensim-SC-20f20895cf1444071d5edc42e11a1fb94b1b1079.tar.gz opensim-SC-20f20895cf1444071d5edc42e11a1fb94b1b1079.tar.bz2 opensim-SC-20f20895cf1444071d5edc42e11a1fb94b1b1079.tar.xz |
Adds optional HTTP Basic Authentication to Robust service connectors.
Diffstat (limited to 'OpenSim/Services/Connectors/BaseServiceConnector.cs')
-rw-r--r-- | OpenSim/Services/Connectors/BaseServiceConnector.cs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/OpenSim/Services/Connectors/BaseServiceConnector.cs b/OpenSim/Services/Connectors/BaseServiceConnector.cs new file mode 100644 index 0000000..98cd489 --- /dev/null +++ b/OpenSim/Services/Connectors/BaseServiceConnector.cs | |||
@@ -0,0 +1,33 @@ | |||
1 | using System; | ||
2 | using OpenSim.Framework; | ||
3 | using OpenSim.Framework.ServiceAuth; | ||
4 | |||
5 | using Nini.Config; | ||
6 | |||
7 | namespace OpenSim.Services.Connectors | ||
8 | { | ||
9 | public class BaseServiceConnector | ||
10 | { | ||
11 | protected IServiceAuth m_Auth; | ||
12 | |||
13 | public BaseServiceConnector() { } | ||
14 | |||
15 | public BaseServiceConnector(IConfigSource config, string section) | ||
16 | { | ||
17 | Initialise(config, section); | ||
18 | } | ||
19 | |||
20 | public void Initialise(IConfigSource config, string section) | ||
21 | { | ||
22 | string authType = Util.GetConfigVarFromSections<string>(config, "AuthType", new string[] { "Network", section }, "None"); | ||
23 | |||
24 | switch (authType) | ||
25 | { | ||
26 | case "BasicHttpAuthentication": | ||
27 | m_Auth = new BasicHttpAuthentication(config, section); | ||
28 | break; | ||
29 | } | ||
30 | |||
31 | } | ||
32 | } | ||
33 | } | ||