From 52955d1860b4dfb905f67bbe39d9b10bbd61ded0 Mon Sep 17 00:00:00 2001 From: Derek Nance Date: Wed, 4 Feb 2026 08:15:27 -0600 Subject: [PATCH] [PM-29144] Add server communication config to `/api/config` (#6892) --- .../Models/Response/ConfigResponseModel.cs | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/Api/Models/Response/ConfigResponseModel.cs b/src/Api/Models/Response/ConfigResponseModel.cs index d748254206..e6ac35bb39 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,40 @@ 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 CommunicationBootstrapSettings Build(IGlobalSettings globalSettings) + { + return globalSettings.Communication?.Bootstrap?.ToLowerInvariant() switch + { + "ssocookievendor" => new() + { + 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; }