Cirreum.Providers
1.2.0
dotnet add package Cirreum.Providers --version 1.2.0
NuGet\Install-Package Cirreum.Providers -Version 1.2.0
<PackageReference Include="Cirreum.Providers" Version="1.2.0" />
<PackageVersion Include="Cirreum.Providers" Version="1.2.0" />
<PackageReference Include="Cirreum.Providers" />
paket add Cirreum.Providers --version 1.2.0
#r "nuget: Cirreum.Providers, 1.2.0"
#:package Cirreum.Providers@1.2.0
#addin nuget:?package=Cirreum.Providers&version=1.2.0
#tool nuget:?package=Cirreum.Providers&version=1.2.0
Cirreum - Provider Model Library
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
ProviderTypeenumeration - 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:
- Provider Registrar - Implements
IProviderRegistrar<TSettings, TInstanceSettings>to register services with the DI container - Provider Settings - Implements
IProviderSettings<TInstanceSettings>to define configuration structure - Instance Settings - Implements
IProviderInstanceSettingsfor per-instance configuration - 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 supportsProviderName- 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:
AzurefromCirreum.Storage.Azure
- Example:
- Service-specific: Uses a descriptive name for the implementation
- Example:
AzureBlobsfor Azure Blob Storage
- Example:
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.AzureCirreum.Messaging.ServiceBusCirreum.Secrets.KeyVault- And other provider-specific libraries
Contributing
When implementing a new provider:
- Reference this library
- Implement the required interfaces (
IProviderRegistrar,IProviderSettings,IProviderInstanceSettings) - Follow the established naming conventions for
ProviderName - Implement thorough validation in
ValidateSettings() - Add appropriate XML documentation
- Ensure configuration follows the standard structure
Cirreum Foundation Framework
Layered simplicity for modern .NET
| Product | Versions 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. |
-
net10.0
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 |