From d0398e4f59ce4d6546e4b5a841ed9df2cc937bf7 Mon Sep 17 00:00:00 2001 From: Derek Nance Date: Fri, 23 Jan 2026 15:40:56 -0600 Subject: [PATCH] add settings to ConfigResponseModel --- .../Models/Response/ConfigResponseModel.cs | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/Api/Models/Response/ConfigResponseModel.cs b/src/Api/Models/Response/ConfigResponseModel.cs index d748254206..868c9ab632 100644 --- a/src/Api/Models/Response/ConfigResponseModel.cs +++ b/src/Api/Models/Response/ConfigResponseModel.cs @@ -18,6 +18,7 @@ public class ConfigResponseModel : ResponseModel public EnvironmentConfigResponseModel Environment { get; set; } public IDictionary FeatureStates { get; set; } public PushSettings Push { get; set; } + public CommunicationSettings Communication { get; set; } public ServerSettingsResponseModel Settings { get; set; } public ConfigResponseModel() : base("config") @@ -48,6 +49,7 @@ public class ConfigResponseModel : ResponseModel FeatureStates = featureService.GetAll(); var webPushEnabled = FeatureStates.TryGetValue(FeatureFlagKeys.WebPush, out var webPushEnabledValue) ? (bool)webPushEnabledValue : false; Push = PushSettings.Build(webPushEnabled, globalSettings); + Communication = CommunicationSettings.Build(globalSettings); Settings = new ServerSettingsResponseModel { DisableUserRegistration = globalSettings.DisableUserRegistration @@ -88,6 +90,36 @@ public class PushSettings } } +public class CommunicationSettings +{ + 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) + { + var bootstrap = globalSettings.Communication?.Bootstrap?.ToLowerInvariant(); + + if (string.IsNullOrEmpty(bootstrap) || bootstrap == "none") + { + return null; + } + + return bootstrap switch + { + "ssocookievendor" => new CommunicationSettings + { + Type = "ssoCookieVendor", + IdpLoginUrl = globalSettings.Communication?.SsoCookieVendor?.IdpLoginUrl, + CookieName = globalSettings.Communication?.SsoCookieVendor?.CookieName, + CookieDomain = globalSettings.Communication?.SsoCookieVendor?.CookieDomain + }, + _ => null + }; + } +} + public class ServerSettingsResponseModel { public bool DisableUserRegistration { get; set; }