40 lines
1.3 KiB
C#
40 lines
1.3 KiB
C#
|
using System;
|
|||
|
using System.Linq;
|
|||
|
using Alkami.Ops.SecretServer.Enum;
|
|||
|
using Alkami.Ops.SecretServer.SSWebService;
|
|||
|
|
|||
|
namespace Alkami.Ops.SecretServer.Model
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// Represents a Windows Account secret
|
|||
|
/// </summary>
|
|||
|
public class User : SecretBase
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// The secret type
|
|||
|
/// </summary>
|
|||
|
/// <remarks>
|
|||
|
/// Returns <seealso cref="SecretType"/>.Certificate
|
|||
|
/// </remarks>
|
|||
|
public new SecretType SecretType => SecretType.User;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// The user name from the "Username" field on the secret
|
|||
|
/// </summary>
|
|||
|
public string UserName => SecretItems.FirstOrDefault(p => string.Equals(p.FieldName, "Username", StringComparison.OrdinalIgnoreCase))?.Value;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// The password from the "Password" field on the secret
|
|||
|
/// </summary>
|
|||
|
public string Password => SecretItems.FirstOrDefault(p => string.Equals(p.FieldName, "Password", StringComparison.OrdinalIgnoreCase) && p.IsPassword)?.Value;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Instantiates a new instance of the Secret class
|
|||
|
/// </summary>
|
|||
|
/// <param name="secret"></param>
|
|||
|
public User(Secret secret) : base(secret)
|
|||
|
{
|
|||
|
}
|
|||
|
}
|
|||
|
}
|