1
0
mirror of https://github.com/bitwarden/server synced 2025-12-18 09:13:19 +00:00
Files
server/src/Api/Models/Response/ConfigResponseModel.cs
Rui Tomé b151605c28 [PM-2594] Added new property "CloudRegion" to GlobalSettings and ConfigResponseModel to be able to override the cloud url value for selfhost instances (#3024)
* [PM-2594] Added new property "CloudVault" to GlobalSettings and ConfigResponseModel to be able to override this value for selfhost instances

* [PM-2594] Renamed EnvironmentConfigResponseModel.CloudVault to CloudWebVault

* [PM-2594] Added default value for globalSettings__baseServiceUri__cloudWebVault on EnvironmentFileBuilder

* [PM-2594] Erased CloudWebVault environment variable and added CloudVaultRegion

* [PM-2594] Changed var name on EnvironmentFileBuilder

* [PM-2594] Renamed the env. variable and also the output property to CloudRegion
2023-07-03 21:43:13 +01:00

57 lines
1.8 KiB
C#

using Bit.Core.Models.Api;
using Bit.Core.Settings;
using Bit.Core.Utilities;
namespace Bit.Api.Models.Response;
public class ConfigResponseModel : ResponseModel
{
public string Version { get; set; }
public string GitHash { get; set; }
public ServerConfigResponseModel Server { get; set; }
public EnvironmentConfigResponseModel Environment { get; set; }
public IDictionary<string, object> FeatureStates { get; set; }
public ConfigResponseModel() : base("config")
{
Version = AssemblyHelpers.GetVersion();
GitHash = AssemblyHelpers.GetGitHash();
Environment = new EnvironmentConfigResponseModel();
FeatureStates = new Dictionary<string, object>();
}
public ConfigResponseModel(
IGlobalSettings globalSettings,
IDictionary<string, object> featureStates) : base("config")
{
Version = AssemblyHelpers.GetVersion();
GitHash = AssemblyHelpers.GetGitHash();
Environment = new EnvironmentConfigResponseModel
{
CloudRegion = globalSettings.BaseServiceUri.CloudRegion,
Vault = globalSettings.BaseServiceUri.Vault,
Api = globalSettings.BaseServiceUri.Api,
Identity = globalSettings.BaseServiceUri.Identity,
Notifications = globalSettings.BaseServiceUri.Notifications,
Sso = globalSettings.BaseServiceUri.Sso
};
FeatureStates = featureStates;
}
}
public class ServerConfigResponseModel
{
public string Name { get; set; }
public string Url { get; set; }
}
public class EnvironmentConfigResponseModel
{
public string CloudRegion { get; set; }
public string Vault { get; set; }
public string Api { get; set; }
public string Identity { get; set; }
public string Notifications { get; set; }
public string Sso { get; set; }
}