Cirreum.Providers 1.2.0

dotnet add package Cirreum.Providers --version 1.2.0
                    
NuGet\Install-Package Cirreum.Providers -Version 1.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Cirreum.Providers" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cirreum.Providers" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Cirreum.Providers" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Cirreum.Providers --version 1.2.0
                    
#r "nuget: Cirreum.Providers, 1.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Cirreum.Providers@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Cirreum.Providers&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Cirreum.Providers&version=1.2.0
                    
Install as a Cake Tool

Cirreum - Provider Model Library

NuGet Version NuGet Downloads GitHub Release

A shared library that defines the core abstractions and utilities for implementing a consistent provider pattern across the Cirreum platform. This library enables pluggable, configuration-driven service providers for various infrastructure concerns including messaging, storage, persistence, authorization, and more.

Overview

Cirreum.Providers establishes a standardized approach for integrating third-party services and cloud providers into applications built on the Cirreum foundation framework. It provides:

  • Common interfaces for provider registration and configuration
  • Type-safe settings management with support for multiple provider instances
  • Extensible provider categories through the ProviderType enumeration
  • Service collection utilities for tracking and managing provider registrations

Key Concepts

Provider Types

The library defines several core service categories through the ProviderType enum:

  • Invocation - Inbound invocation sources that deliver work into the framework's pipeline
  • Identity - Identity setup and configuring of user provisioning endpoints
  • Authorization - AuthZ and access management providers (Azure Entra, Okta, etc.)
  • Secrets - Remote configuration and secrets management (Azure KeyVault, AWS Secrets Manager, HashiCorp Vault)
  • Messaging - Distributed messaging systems (Azure Service Bus, AWS SQS, RabbitMQ)
  • Storage - Cloud storage services (Azure Blob Storage, AWS S3)
  • Persistence - Data persistence solutions (Azure Cosmos DB, AWS DocumentDB)
  • Communications - Message delivery channels (SendGrid, Twilio)

Provider Architecture

Each provider implementation consists of:

  1. Provider Registrar - Implements IProviderRegistrar<TSettings, TInstanceSettings> to register services with the DI container
  2. Provider Settings - Implements IProviderSettings<TInstanceSettings> to define configuration structure
  3. Instance Settings - Implements IProviderInstanceSettings for per-instance configuration
  4. Configuration Section - Named section in appsettings.json matching the ProviderName

Core Interfaces

IProviderRegistrar<TSettings, TInstanceSettings>

The primary interface that provider implementations must implement:

public interface IProviderRegistrar<TSettings, TInstanceSettings>
    where TSettings : IProviderSettings<TInstanceSettings>
    where TInstanceSettings : IProviderInstanceSettings
{
    ProviderType ProviderType { get; }
    string ProviderName { get; }
    void ValidateSettings(TInstanceSettings settings);
}

Properties:

  • ProviderType - Indicates which service category the provider supports
  • ProviderName - Configuration section name in appsettings.json

Methods:

  • ValidateSettings() - Performs validation before adding to the DI container

IProviderSettings<TInstanceSettings>

Defines the settings structure containing multiple provider instances:

public interface IProviderSettings<TInstanceSettings>
    where TInstanceSettings : IProviderInstanceSettings
{
    Dictionary<string, TInstanceSettings> Instances { get; set; }
}

IProviderInstanceSettings

Marker interface for provider-specific instance settings:

public interface IProviderInstanceSettings { }

Configuration Pattern

Provider configuration follows a consistent structure in appsettings.json:

{
  "ProviderName": {
    "Instances": {
      "InstanceName1": {
        // Instance-specific settings
      },
      "InstanceName2": {
        // Instance-specific settings
      }
    }
  }
}

Naming Conventions

The ProviderName follows established conventions:

  • Assembly-based: Uses the final segment of the assembly name
    • Example: Azure from Cirreum.Storage.Azure
  • Service-specific: Uses a descriptive name for the implementation
    • Example: AzureBlobs for Azure Blob Storage

Service Collection Extensions

The library provides extension methods for tracking provider registrations:

IsMarkerTypeRegistered<T>()

Checks if a specific type has been registered in the service collection:

if (!services.IsMarkerTypeRegistered<MyProvider>())
{
    // Register the provider
}

MarkTypeAsRegistered<T>()

Marks a specific type as registered to prevent duplicate registrations:

services.MarkTypeAsRegistered<MyProvider>();

These utilities help prevent duplicate provider registrations and enable conditional registration logic.

Usage Example

1. Define Instance Settings

public class MyProviderInstanceSettings : IProviderInstanceSettings
{
    public string ConnectionString { get; set; }
    public int Timeout { get; set; }
}

2. Define Provider Settings

public class MyProviderSettings : IProviderSettings<MyProviderInstanceSettings>
{
    public Dictionary<string, MyProviderInstanceSettings> Instances { get; set; }
}

3. Implement Provider Registrar

public class MyProviderRegistrar : IProviderRegistrar<MyProviderSettings, MyProviderInstanceSettings>
{
    public ProviderType ProviderType => ProviderType.Storage;
    
    public string ProviderName => "MyProvider";
    
    public void ValidateSettings(MyProviderInstanceSettings settings)
    {
        if (string.IsNullOrEmpty(settings.ConnectionString))
            throw new ArgumentException("ConnectionString is required");
            
        if (settings.Timeout <= 0)
            throw new ArgumentException("Timeout must be positive");
    }
}

4. Configure in appsettings.json

{
  "MyProvider": {
    "Instances": {
      "Primary": {
        "ConnectionString": "...",
        "Timeout": 30
      },
      "Secondary": {
        "ConnectionString": "...",
        "Timeout": 60
      }
    }
  }
}

Design Benefits

Consistency

All providers follow the same registration and configuration patterns, making the codebase more maintainable and easier to understand.

Flexibility

Support for multiple instances of the same provider type enables scenarios like primary/backup configurations or multi-region deployments.

Type Safety

Generic constraints ensure compile-time validation of settings types and proper implementation contracts.

Validation

Built-in validation hooks allow providers to enforce configuration requirements before registration.

Discoverability

The ProviderType enumeration makes it easy to discover which provider categories are available in the framework.

Dependencies

  • Microsoft.Extensions.DependencyInjection.Abstractions

Integration

This library is part of the Cirreum foundation framework and is referenced by specific provider implementations such as:

  • Cirreum.Storage.Azure
  • Cirreum.Messaging.ServiceBus
  • Cirreum.Secrets.KeyVault
  • And other provider-specific libraries

Contributing

When implementing a new provider:

  1. Reference this library
  2. Implement the required interfaces (IProviderRegistrar, IProviderSettings, IProviderInstanceSettings)
  3. Follow the established naming conventions for ProviderName
  4. Implement thorough validation in ValidateSettings()
  5. Add appropriate XML documentation
  6. Ensure configuration follows the standard structure

Cirreum Foundation Framework
Layered simplicity for modern .NET

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on Cirreum.Providers:

Package Downloads
Cirreum.ServiceProvider

The Cirreum Services Provider contract Library.

Cirreum.AuthorizationProvider

The Cirreum Authorization Provider contract Library.

Cirreum.SecretsProvider

The Cirreum Secrets Provider contract Library.

Cirreum.InvocationProvider

The Cirreum Invocation Provider framework library — base registrar, configuration types, and the unified IInvocationContext seam shared by inbound invocation sources (HTTP, SignalR, raw WebSockets, gRPC) integrated into the Cirreum framework spine.

Cirreum.IdentityProvider

The Cirreum Identity Provider framework library — base registrar, configuration types, and user-provisioning contracts shared by identity-provider integrations (webhook callbacks, Entra External ID, etc.).

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 90 5/17/2026
1.1.1 1,168 5/7/2026
1.1.0 90 5/7/2026
1.0.113 493 5/1/2026
1.0.112 956 4/24/2026
1.0.111 394 4/14/2026
1.0.110 1,648 3/13/2026
1.0.109 289 3/12/2026
1.0.108 108 3/9/2026
1.0.107 574 3/6/2026
1.0.106 918 1/21/2026
1.0.105 1,218 12/20/2025
1.0.104 686 12/16/2025
1.0.103 672 11/24/2025
1.0.102 475 11/11/2025
1.0.101 272 11/11/2025
1.0.100 166 11/7/2025