Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
62 lines (53 sloc) 1.86 KB
using System;
using System.ComponentModel;
using System.Security;
using Inedo.Documentation;
using Inedo.Extensibility;
using Inedo.Extensibility.Configurations;
using Inedo.Extensibility.Credentials;
using Inedo.Serialization;
namespace Inedo.Extensions.Chocolatey.Configurations
{
[Serializable]
[DisplayName("Chocolatey Source")]
public sealed class ChocolateySourceConfiguration : PersistedConfiguration, IHasCredentials<UsernamePasswordCredentials>, IExistential
{
[ConfigurationKey]
[Required]
[Persistent]
[DisplayName("Source Name")]
[ScriptAlias("Name")]
public string Name { get; set; }
[Required]
[Persistent]
[DisplayName("Endpoint URL")]
[ScriptAlias("Url")]
public string Url { get; set; }
[Persistent]
[DisplayName("Credential")]
[ScriptAlias("Credential")]
public string CredentialName { get; set; }
[Persistent]
[DisplayName("User name")]
[ScriptAlias("UserName")]
[MappedCredential(nameof(UsernamePasswordCredentials.UserName))]
public string UserName { get; set; }
[Persistent(Encrypted = true)]
[DisplayName("Password")]
[ScriptAlias("Password")]
[MappedCredential(nameof(UsernamePasswordCredentials.Password))]
public SecureString Password { get; set; }
[Persistent]
[DisplayName("Priority")]
[ScriptAlias("Priority")]
[Description("Lower priority numbers are more important. As a special case, 0 (the default) is the lowest priority.")]
[DefaultValue(0)]
public int Priority { get; set; } = 0;
[Persistent]
[DisplayName("Exists")]
[ScriptAlias("Exists")]
[DefaultValue(true)]
public bool Exists { get; set; } = true;
public bool Disabled { get; set; }
}
}
You can’t perform that action at this time.