Fixed: Cleanse Notifiarr APIKey from logs Fixes #2130 Fixes #2221pull/2235/head
parent
44bd224125
commit
bd0e1899ae
@ -0,0 +1,15 @@
|
||||
using FluentMigrator;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(47)]
|
||||
public class update_notifiarr : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Execute.Sql("UPDATE Notifications SET Implementation = Replace(Implementation, 'DiscordNotifier', 'Notifiarr'),ConfigContract = Replace(ConfigContract, 'DiscordNotifierSettings', 'NotifiarrSettings') WHERE Implementation = 'DiscordNotifier';");
|
||||
}
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
using FluentValidation;
|
||||
using NzbDrone.Core.Annotations;
|
||||
using NzbDrone.Core.ThingiProvider;
|
||||
using NzbDrone.Core.Validation;
|
||||
|
||||
namespace NzbDrone.Core.Notifications.DiscordNotifier
|
||||
{
|
||||
public class DiscordNotifierSettingsValidator : AbstractValidator<DiscordNotifierSettings>
|
||||
{
|
||||
public DiscordNotifierSettingsValidator()
|
||||
{
|
||||
RuleFor(c => c.APIKey).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class DiscordNotifierSettings : IProviderConfig
|
||||
{
|
||||
private static readonly DiscordNotifierSettingsValidator Validator = new DiscordNotifierSettingsValidator();
|
||||
|
||||
[FieldDefinition(0, Label = "API Key", HelpText = "Your API key from your profile", HelpLink = "https://discordnotifier.com")]
|
||||
public string APIKey { get; set; }
|
||||
|
||||
public NzbDroneValidationResult Validate()
|
||||
{
|
||||
return new NzbDroneValidationResult(Validator.Validate(this));
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
using FluentValidation;
|
||||
using NzbDrone.Core.Annotations;
|
||||
using NzbDrone.Core.ThingiProvider;
|
||||
using NzbDrone.Core.Validation;
|
||||
|
||||
namespace NzbDrone.Core.Notifications.Notifiarr
|
||||
{
|
||||
public class NotifiarrSettingsValidator : AbstractValidator<NotifiarrSettings>
|
||||
{
|
||||
public NotifiarrSettingsValidator()
|
||||
{
|
||||
RuleFor(c => c.APIKey).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class NotifiarrSettings : IProviderConfig
|
||||
{
|
||||
private static readonly NotifiarrSettingsValidator Validator = new NotifiarrSettingsValidator();
|
||||
|
||||
[FieldDefinition(0, Label = "API Key", Privacy = PrivacyLevel.ApiKey, HelpText = "Your API key from your profile", HelpLink = "https://notifiarr.com")]
|
||||
public string APIKey { get; set; }
|
||||
|
||||
public NzbDroneValidationResult Validate()
|
||||
{
|
||||
return new NzbDroneValidationResult(Validator.Validate(this));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue