1
0
mirror of https://github.com/bitwarden/server synced 2026-01-29 07:43:22 +00:00

make config output conform to spec

This commit is contained in:
Derek Nance
2026-01-27 12:15:43 -06:00
parent d0398e4f59
commit 8fa323b459

View File

@@ -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,