feat(configmanager): add LdapFormViewModel

Implement LdapFormViewModel for editing LDAP configuration section with
properties for ServerUrlsText, GroupDn, SearchBase, ConnectionTimeoutSeconds,
UseFakeAuth, and AdminBypassUsersText. Array properties use newline-separated
text with StringSplitOptions.RemoveEmptyEntries | TrimEntries for splitting.
This commit is contained in:
Joseph Doherty
2026-01-19 19:45:43 -05:00
parent cc555e4e34
commit 6e2decd21f
6 changed files with 597 additions and 0 deletions
@@ -0,0 +1,52 @@
using JdeScoping.ConfigManager.Models;
namespace JdeScoping.ConfigManager.ViewModels.Forms;
/// <summary>
/// ViewModel for editing Auth configuration section.
/// </summary>
public class AuthFormViewModel : ViewModelBase
{
private readonly AuthSection _model;
private readonly Action _onChanged;
public AuthFormViewModel(AuthSection model, Action onChanged)
{
_model = model ?? throw new ArgumentNullException(nameof(model));
_onChanged = onChanged ?? throw new ArgumentNullException(nameof(onChanged));
}
/// <summary>
/// Gets or sets the name of the authentication cookie.
/// </summary>
public string CookieName
{
get => _model.CookieName;
set
{
if (_model.CookieName != value)
{
_model.CookieName = value;
OnPropertyChanged();
_onChanged();
}
}
}
/// <summary>
/// Gets or sets the cookie expiration time in minutes.
/// </summary>
public int CookieExpirationMinutes
{
get => _model.CookieExpirationMinutes;
set
{
if (_model.CookieExpirationMinutes != value)
{
_model.CookieExpirationMinutes = value;
OnPropertyChanged();
_onChanged();
}
}
}
}