Fixed Deluge and BTN cleanse password logic.
This commit is contained in:
parent
c7d445d1c1
commit
90b5947a19
|
@ -39,8 +39,10 @@ namespace NzbDrone.Common.Test.InstrumentationTests
|
||||||
// Deluge
|
// Deluge
|
||||||
[TestCase(@",{""download_location"": ""C:\Users\\mySecret mySecret\\Downloads""}")]
|
[TestCase(@",{""download_location"": ""C:\Users\\mySecret mySecret\\Downloads""}")]
|
||||||
[TestCase(@",{""download_location"": ""/home/mySecret/Downloads""}")]
|
[TestCase(@",{""download_location"": ""/home/mySecret/Downloads""}")]
|
||||||
|
[TestCase(@"auth.login(""mySecret"")")]
|
||||||
// BroadcastheNet
|
// BroadcastheNet
|
||||||
[TestCase(@"method: ""getTorrents"", ""params"": [ ""mySecret"",")]
|
[TestCase(@"method: ""getTorrents"", ""params"": [ ""mySecret"",")]
|
||||||
|
[TestCase(@"getTorrents(""mySecret"", [asdfasdf], 100, 0)")]
|
||||||
[TestCase(@"""DownloadURL"":""https:\/\/broadcasthe.net\/torrents.php?action=download&id=123&authkey=mySecret&torrent_pass=mySecret""")]
|
[TestCase(@"""DownloadURL"":""https:\/\/broadcasthe.net\/torrents.php?action=download&id=123&authkey=mySecret&torrent_pass=mySecret""")]
|
||||||
public void should_clean_message(string message)
|
public void should_clean_message(string message)
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,8 +31,12 @@ namespace NzbDrone.Common.Instrumentation
|
||||||
new Regex(@"\[""[a-z._]*(username|password)"",\d,""(?<secret>[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
new Regex(@"\[""[a-z._]*(username|password)"",\d,""(?<secret>[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||||
new Regex(@"\[""(boss_key|boss_key_salt|proxy\.proxy)"",\d,""(?<secret>[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
new Regex(@"\[""(boss_key|boss_key_salt|proxy\.proxy)"",\d,""(?<secret>[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||||
|
|
||||||
|
// Deluge
|
||||||
|
new Regex(@"auth.login\(""(?<secret>[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||||
|
|
||||||
// BroadcastheNet
|
// BroadcastheNet
|
||||||
new Regex(@"""?method""?\s*:\s*""(getTorrents)"",\s*""?params""?\s*:\s*\[\s*""(?<secret>[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
new Regex(@"""?method""?\s*:\s*""(getTorrents)"",\s*""?params""?\s*:\s*\[\s*""(?<secret>[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||||
|
new Regex(@"getTorrents\(""(?<secret>[^""]+?)""", RegexOptions.Compiled | RegexOptions.IgnoreCase),
|
||||||
new Regex(@"(?<=\?|&)(authkey|torrent_pass)=(?<secret>[^&=]+?)(?=""|&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase)
|
new Regex(@"(?<=\?|&)(authkey|torrent_pass)=(?<secret>[^&=]+?)(?=""|&|$)", RegexOptions.Compiled | RegexOptions.IgnoreCase)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ namespace NzbDrone.Core.Download.Clients.Deluge
|
||||||
|
|
||||||
public string AddTorrentFromFile(string filename, byte[] fileContent, DelugeSettings settings)
|
public string AddTorrentFromFile(string filename, byte[] fileContent, DelugeSettings settings)
|
||||||
{
|
{
|
||||||
var response = ProcessRequest<string>(settings, "core.add_torrent_file", filename, Convert.ToBase64String(fileContent), new JObject());
|
var response = ProcessRequest<string>(settings, "core.add_torrent_file", filename, fileContent, new JObject());
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
@ -256,7 +256,6 @@ namespace NzbDrone.Core.Download.Clients.Deluge
|
||||||
_authCookieCache.Remove(authKey);
|
_authCookieCache.Remove(authKey);
|
||||||
|
|
||||||
var authLoginRequest = requestBuilder.Call("auth.login", settings.Password).Build();
|
var authLoginRequest = requestBuilder.Call("auth.login", settings.Password).Build();
|
||||||
authLoginRequest.ContentSummary = "auth.login(\"(removed)\")";
|
|
||||||
var response = _httpClient.Execute(authLoginRequest);
|
var response = _httpClient.Execute(authLoginRequest);
|
||||||
var result = Json.Deserialize<JsonRpcResponse<bool>>(response.Content);
|
var result = Json.Deserialize<JsonRpcResponse<bool>>(response.Content);
|
||||||
if (!result.Result)
|
if (!result.Result)
|
||||||
|
|
Loading…
Reference in New Issue