Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="LaunchDarkly.ServerSdk" Version="[8.0,9.0)" />
<PackageReference Include="LaunchDarkly.ServerSdk" Version="[8.1.0,9.0)" />
<PackageReference Include="OpenFeature" Version="[1.4.0, 2.0.0)" />
</ItemGroup>

Expand Down
16 changes: 12 additions & 4 deletions src/LaunchDarkly.OpenFeature.ServerProvider/Provider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ internal Provider(ILdClient client)
/// Construct a new instance of the provider with the given configuration.
/// </summary>
/// <param name="config">A client configuration object</param>
public Provider(Configuration config) : this(new LdClient(config))
public Provider(Configuration config) : this(new LdClient(WrapConfig(config)))
{
}

/// <summary>
/// Construct a new instance of the provider with the given SDK key.
/// </summary>
/// <param name="sdkKey">The SDK key</param>
public Provider(string sdkKey) : this(new LdClient(sdkKey))
public Provider(string sdkKey) : this(new LdClient(WrapConfig(Configuration.Builder(sdkKey).Build())))
{
}

Expand All @@ -83,6 +83,14 @@ public ILdClient GetClient()
return _client;
}

private static Configuration WrapConfig(Configuration config)
{
return Configuration.Builder(config)
.WrapperInfo(Components.WrapperInfo().Name("open-feature-dotnet-server")
.Version(typeof(Provider).Assembly.GetName().Version.ToString()))
.Build();
}

#region FeatureProvider Implementation

/// <inheritdoc />
Expand Down Expand Up @@ -180,10 +188,10 @@ await EventChannel.Writer.WriteAsync(new ProviderEventPayload
{
ProviderName = _metadata.Name,
Type = ProviderEventTypes.ProviderConfigurationChanged,
FlagsChanged = new List<string>{changeEvent.Key},
FlagsChanged = new List<string> {changeEvent.Key},
}).ConfigureAwait(false);
}
catch(Exception e)
catch (Exception e)
{
_logger.Warn($"Encountered an error sending configuration changed events: {e.Message}");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="LaunchDarkly.ServerSdk" Version="8.0.0" />
<PackageReference Include="LaunchDarkly.ServerSdk" Version="8.1.0" />
<PackageReference Include="LaunchDarkly.TestHelpers" Version="2.0.0" />
<PackageReference Include="Moq" Version="4.8.1" />
<PackageReference Include="OpenFeature" Version="1.*" />
Expand Down