diff options
author | Justin Clark-Casey (justincc) | 2015-03-04 17:51:11 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2015-03-04 18:27:51 +0000 |
commit | 3255335c42ff348465d235a3ccf9558d0d6d414b (patch) | |
tree | 5537a8bb51ef79f1b42a0a29e167da939630f434 /OpenSim/Framework/ServiceAuth/ServiceAuth.cs | |
parent | Add outbound URL filter to llHttpRequest() and osSetDynamicTextureURL*() scri... (diff) | |
download | opensim-SC-3255335c42ff348465d235a3ccf9558d0d6d414b.zip opensim-SC-3255335c42ff348465d235a3ccf9558d0d6d414b.tar.gz opensim-SC-3255335c42ff348465d235a3ccf9558d0d6d414b.tar.bz2 opensim-SC-3255335c42ff348465d235a3ccf9558d0d6d414b.tar.xz |
Make private services forbid llHTTPRequest() calls by rejecting those that have the X-SecondLife-Shard header.
If you need to enable this, set AllowHttpRequestIn = true in [Network] for all private services or individual [*Service] sections.
Diffstat (limited to 'OpenSim/Framework/ServiceAuth/ServiceAuth.cs')
-rw-r--r-- | OpenSim/Framework/ServiceAuth/ServiceAuth.cs | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/OpenSim/Framework/ServiceAuth/ServiceAuth.cs b/OpenSim/Framework/ServiceAuth/ServiceAuth.cs index 5ab613b..30f5bd6 100644 --- a/OpenSim/Framework/ServiceAuth/ServiceAuth.cs +++ b/OpenSim/Framework/ServiceAuth/ServiceAuth.cs | |||
@@ -36,15 +36,27 @@ namespace OpenSim.Framework.ServiceAuth | |||
36 | { | 36 | { |
37 | public static IServiceAuth Create(IConfigSource config, string section) | 37 | public static IServiceAuth Create(IConfigSource config, string section) |
38 | { | 38 | { |
39 | CompoundAuthentication compoundAuth = new CompoundAuthentication(); | ||
40 | |||
41 | bool allowLlHttpRequestIn | ||
42 | = Util.GetConfigVarFromSections<bool>(config, "AllowllHTTPRequestIn", new string[] { "Network", section }, false); | ||
43 | |||
44 | if (!allowLlHttpRequestIn) | ||
45 | compoundAuth.AddAuthenticator(new DisallowLlHttpRequest()); | ||
46 | |||
39 | string authType = Util.GetConfigVarFromSections<string>(config, "AuthType", new string[] { "Network", section }, "None"); | 47 | string authType = Util.GetConfigVarFromSections<string>(config, "AuthType", new string[] { "Network", section }, "None"); |
40 | 48 | ||
41 | switch (authType) | 49 | switch (authType) |
42 | { | 50 | { |
43 | case "BasicHttpAuthentication": | 51 | case "BasicHttpAuthentication": |
44 | return new BasicHttpAuthentication(config, section); | 52 | compoundAuth.AddAuthenticator(new BasicHttpAuthentication(config, section)); |
53 | break; | ||
45 | } | 54 | } |
46 | 55 | ||
47 | return null; | 56 | if (compoundAuth.Count > 0) |
57 | return compoundAuth; | ||
58 | else | ||
59 | return null; | ||
48 | } | 60 | } |
49 | } | 61 | } |
50 | } | 62 | } \ No newline at end of file |