1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 08:02:49 -05:00

Provide LaunchDarkly application info (#3435)

* Upgrade to SDK v8

* Provide application properties

* Test adjustments

* Clean up tests

* Ensure project name is set

* Add a 'v' for Git tagging support
This commit is contained in:
Matt Bishop
2023-11-13 14:46:39 -05:00
committed by GitHub
parent 627f4ffa39
commit fb89e07df7
42 changed files with 600 additions and 548 deletions

View File

@ -1,5 +1,6 @@
using Bit.Core.Context;
using Bit.Core.Settings;
using Bit.Core.Utilities;
using LaunchDarkly.Logging;
using LaunchDarkly.Sdk.Server;
using LaunchDarkly.Sdk.Server.Integrations;
@ -17,6 +18,16 @@ public class LaunchDarklyFeatureService : IFeatureService, IDisposable
var ldConfig = Configuration.Builder(globalSettings.LaunchDarkly?.SdkKey);
ldConfig.Logging(Components.Logging().Level(LogLevel.Error));
if (!string.IsNullOrEmpty(globalSettings.ProjectName))
{
ldConfig.ApplicationInfo(Components.ApplicationInfo()
.ApplicationId(globalSettings.ProjectName)
.ApplicationName(globalSettings.ProjectName)
.ApplicationVersion(AssemblyHelpers.GetGitHash() ?? $"v{AssemblyHelpers.GetVersion()}")
.ApplicationVersionName(AssemblyHelpers.GetVersion())
);
}
if (string.IsNullOrEmpty(globalSettings.LaunchDarkly?.SdkKey))
{
// support a file to load flag values