Skip to content

v4.2.0

Choose a tag to compare

@windischb windischb released this 03 Feb 11:51
· 44 commits to develop since this release
9723080

This release introduces Abstractions packages for decoupled architecture, plaintext secrets support for development scenarios, and enhanced testing capabilities.

Highlights

Abstractions Packages

New lightweight packages enable libraries to depend on configuration interfaces without taking a dependency on the full implementation:

  • Cocoar.Configuration.Abstractions - Core interfaces (IConfigurationAccessor, IReactiveConfig<T>)
  • Cocoar.Configuration.Secrets.Abstractions - Secrets interfaces (ISecret<T>, SecretLease<T>)
// Libraries can now depend only on abstractions
public class MyLibraryService(IConfigurationAccessor config) { }

Plaintext Secrets for Development

New AllowPlaintext() API enables plaintext secret values during development without requiring encrypted envelopes:

builder.Services.AddCocoarConfiguration(rule => [...], setup => [
    setup.Secrets().AllowPlaintext(builder.Environment.IsDevelopment())
]);

Security Note: Only enable in development/test environments.

Testing Setup Overrides

CocoarTestConfiguration now supports setup overrides, enabling test-time configuration like AllowPlaintext():

using var _ = CocoarTestConfiguration.ReplaceAllRules(
    rules => [rule.For<Config>().FromStatic(_ => testConfig)],
    setup => [setup.Secrets().AllowPlaintext()]
);

What's New

  • Abstractions packages for decoupled architecture and better testability
  • AllowPlaintext() fluent API for development/testing scenarios
  • Testing setup overrides via WithSetup(), ReplaceAllRules(), and AppendTestRules()
  • Deserialization failure logging - GetConfig<T>() now logs errors (EventId 5100) for diagnosis

Fixed

  • DI registration ordering - Service descriptors now emit in deterministic order (sorted by type name)
  • Provider rebuild callback ordering - Subscription reset now correctly occurs before provider disposal

Changed

  • Type relocation with forwarding - Core interfaces moved to abstractions packages with [TypeForwardedTo] attributes for full backward compatibility

Upgrade Notes

This is a non-breaking release. All changes are additive or use type forwarding for seamless compatibility.

New packages to consider:

dotnet add package Cocoar.Configuration.Abstractions
dotnet add package Cocoar.Configuration.Secrets.Abstractions

Full Changelog: 4.1.0...4.2.0