From 8fa323b459bcd8f0123e4e84807ea8f121505460 Mon Sep 17 00:00:00 2001 From: Derek Nance Date: Tue, 27 Jan 2026 12:15:43 -0600 Subject: [PATCH] make config output conform to spec --- .../Models/Response/ConfigResponseModel.cs | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/Api/Models/Response/ConfigResponseModel.cs b/src/Api/Models/Response/ConfigResponseModel.cs index 868c9ab632..e6ac35bb39 100644 --- a/src/Api/Models/Response/ConfigResponseModel.cs +++ b/src/Api/Models/Response/ConfigResponseModel.cs @@ -91,24 +91,28 @@ public class PushSettings } public class CommunicationSettings +{ + public CommunicationBootstrapSettings Bootstrap { get; private init; } + + public static CommunicationSettings Build(IGlobalSettings globalSettings) + { + var bootstrap = CommunicationBootstrapSettings.Build(globalSettings); + return bootstrap == null ? null : new() { Bootstrap = bootstrap }; + } +} + +public class CommunicationBootstrapSettings { public string Type { get; private init; } public string IdpLoginUrl { get; private init; } public string CookieName { get; private init; } public string CookieDomain { get; private init; } - public static CommunicationSettings Build(IGlobalSettings globalSettings) + public static CommunicationBootstrapSettings Build(IGlobalSettings globalSettings) { - var bootstrap = globalSettings.Communication?.Bootstrap?.ToLowerInvariant(); - - if (string.IsNullOrEmpty(bootstrap) || bootstrap == "none") + return globalSettings.Communication?.Bootstrap?.ToLowerInvariant() switch { - return null; - } - - return bootstrap switch - { - "ssocookievendor" => new CommunicationSettings + "ssocookievendor" => new() { Type = "ssoCookieVendor", IdpLoginUrl = globalSettings.Communication?.SsoCookieVendor?.IdpLoginUrl,