|
|
@ -61,6 +61,7 @@ namespace NzbDrone.Common.Test.InstrumentationTests
|
|
|
|
[TestCase("https://notifiarr.com/notifier.php: api=1234530f-422f-4aac-b6b3-01233210aaaa&radarr_health_issue_message=Download")]
|
|
|
|
[TestCase("https://notifiarr.com/notifier.php: api=1234530f-422f-4aac-b6b3-01233210aaaa&radarr_health_issue_message=Download")]
|
|
|
|
[TestCase("/readarr/signalr/messages/negotiate?access_token=1234530f422f4aacb6b301233210aaaa&negotiateVersion=1")]
|
|
|
|
[TestCase("/readarr/signalr/messages/negotiate?access_token=1234530f422f4aacb6b301233210aaaa&negotiateVersion=1")]
|
|
|
|
[TestCase(@"[Info] MigrationController: *** Migrating Database=readarr-main;Host=postgres14;Username=mySecret;Password=mySecret;Port=5432;Enlist=False ***")]
|
|
|
|
[TestCase(@"[Info] MigrationController: *** Migrating Database=readarr-main;Host=postgres14;Username=mySecret;Password=mySecret;Port=5432;Enlist=False ***")]
|
|
|
|
|
|
|
|
[TestCase(@"[Info] MigrationController: *** Migrating Database=readarr-main;Host=postgres14;Username=mySecret;Password=mySecret;Port=5432;token=mySecret;Enlist=False&username=mySecret;mypassword=mySecret;mypass=shouldkeep1;test_token=mySecret;password=123%@%_@!#^#@;use_password=mySecret;get_token=shouldkeep2;usetoken=shouldkeep3;passwrd=mySecret;")]
|
|
|
|
|
|
|
|
|
|
|
|
// Announce URLs (passkeys) Magnet & Tracker
|
|
|
|
// Announce URLs (passkeys) Magnet & Tracker
|
|
|
|
[TestCase(@"magnet_uri"":""magnet:?xt=urn:btih:9pr04sgkillroyimaveql2tyu8xyui&dn=&tr=https%3a%2f%2fxxx.yyy%2f9pr04sg601233210imaveql2tyu8xyui%2fannounce""}")]
|
|
|
|
[TestCase(@"magnet_uri"":""magnet:?xt=urn:btih:9pr04sgkillroyimaveql2tyu8xyui&dn=&tr=https%3a%2f%2fxxx.yyy%2f9pr04sg601233210imaveql2tyu8xyui%2fannounce""}")]
|
|
|
@ -73,17 +74,36 @@ namespace NzbDrone.Common.Test.InstrumentationTests
|
|
|
|
[TestCase(@"tracker"":""https://xxx.yyy/announce.php?passkey=9pr04sg601233210imaveql2tyu8xyui""}")]
|
|
|
|
[TestCase(@"tracker"":""https://xxx.yyy/announce.php?passkey=9pr04sg601233210imaveql2tyu8xyui""}")]
|
|
|
|
[TestCase(@"tracker"":""http://xxx.yyy/announce.php?passkey=9pr04sg601233210imaveql2tyu8xyui"",""info"":""http://xxx.yyy/info?a=b""")]
|
|
|
|
[TestCase(@"tracker"":""http://xxx.yyy/announce.php?passkey=9pr04sg601233210imaveql2tyu8xyui"",""info"":""http://xxx.yyy/info?a=b""")]
|
|
|
|
|
|
|
|
|
|
|
|
// Webhooks - Notifiarr
|
|
|
|
// Notifiarr
|
|
|
|
[TestCase(@"https://xxx.yyy/api/v1/notification/readarr/9pr04sg6-0123-3210-imav-eql2tyu8xyui")]
|
|
|
|
[TestCase(@"https://xxx.yyy/api/v1/notification/readarr/9pr04sg6-0123-3210-imav-eql2tyu8xyui")]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Discord
|
|
|
|
|
|
|
|
[TestCase(@"https://discord.com/api/webhooks/mySecret")]
|
|
|
|
|
|
|
|
[TestCase(@"https://discord.com/api/webhooks/mySecret/01233210")]
|
|
|
|
|
|
|
|
|
|
|
|
public void should_clean_message(string message)
|
|
|
|
public void should_clean_message(string message)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var cleansedMessage = CleanseLogMessage.Cleanse(message);
|
|
|
|
var cleansedMessage = CleanseLogMessage.Cleanse(message);
|
|
|
|
|
|
|
|
|
|
|
|
cleansedMessage.Should().NotContain("mySecret");
|
|
|
|
cleansedMessage.Should().NotContain("mySecret");
|
|
|
|
|
|
|
|
cleansedMessage.Should().NotContain("123%@%_@!#^#@");
|
|
|
|
cleansedMessage.Should().NotContain("01233210");
|
|
|
|
cleansedMessage.Should().NotContain("01233210");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[TestCase(@"[Info] MigrationController: *** Migrating Database=radarr-main;Host=postgres14;Username=mySecret;Password=mySecret;Port=5432;token=mySecret;Enlist=False&username=mySecret;mypassword=mySecret;mypass=shouldkeep1;test_token=mySecret;password=123%@%_@!#^#@;use_password=mySecret;get_token=shouldkeep2;usetoken=shouldkeep3;passwrd=mySecret;")]
|
|
|
|
|
|
|
|
public void should_keep_message(string message)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var cleansedMessage = CleanseLogMessage.Cleanse(message);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cleansedMessage.Should().NotContain("mySecret");
|
|
|
|
|
|
|
|
cleansedMessage.Should().NotContain("123%@%_@!#^#@");
|
|
|
|
|
|
|
|
cleansedMessage.Should().NotContain("01233210");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cleansedMessage.Should().Contain("shouldkeep1");
|
|
|
|
|
|
|
|
cleansedMessage.Should().Contain("shouldkeep2");
|
|
|
|
|
|
|
|
cleansedMessage.Should().Contain("shouldkeep3");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//GoodReads
|
|
|
|
//GoodReads
|
|
|
|
[TestCase(@"{""signatureMethod"": ""hmacSha1"",""signatureTreatment"": ""escaped"",""type"": ""protectedResource"",""method"": ""GET"",""token"": ""mytoken"",""tokenSecret"": ""mytokensecret"",""requestUrl"": ""https://www.goodreads.com/review/list.xml"",""parameters"": { ""_nc"": ""1"", ""v"": ""2"", ""id"": ""999999999"", ""shelf"": ""currently-reading"", ""per_page"": ""200"", ""page"": ""1""}")]
|
|
|
|
[TestCase(@"{""signatureMethod"": ""hmacSha1"",""signatureTreatment"": ""escaped"",""type"": ""protectedResource"",""method"": ""GET"",""token"": ""mytoken"",""tokenSecret"": ""mytokensecret"",""requestUrl"": ""https://www.goodreads.com/review/list.xml"",""parameters"": { ""_nc"": ""1"", ""v"": ""2"", ""id"": ""999999999"", ""shelf"": ""currently-reading"", ""per_page"": ""200"", ""page"": ""1""}")]
|
|
|
|
[TestCase(@"https://www.goodreads.com/series/311911?key=1234530f422f4aacb6b301233210aaaa&_nc=1&format=xml")]
|
|
|
|
[TestCase(@"https://www.goodreads.com/series/311911?key=1234530f422f4aacb6b301233210aaaa&_nc=1&format=xml")]
|
|
|
|