ProMilesV5.SharedOps
1.2.3
Shared service library for ProMiles V5 Shared Operations providing company validation, claims processing, and common utilities
See the version list below for details.
Install-Package ProMilesV5.SharedOps -Version 1.2.3
dotnet add package ProMilesV5.SharedOps --version 1.2.3
<PackageReference Include="ProMilesV5.SharedOps" Version="1.2.3" />
paket add ProMilesV5.SharedOps --version 1.2.3
#r "nuget: ProMilesV5.SharedOps, 1.2.3"
// Install ProMilesV5.SharedOps as a Cake Addin
#addin nuget:?package=ProMilesV5.SharedOps&version=1.2.3
// Install ProMilesV5.SharedOps as a Cake Tool
#tool nuget:?package=ProMilesV5.SharedOps&version=1.2.3
ProMilesV5.SharedOps
Shared .NET 8.0 class library for ProMiles projects.
Features
- Company Services: Shared company validation and fuel tax ID operations
- Claims Processing: Authentication claims parsing for application access and feature management
- Common Operations: Utilities and shared functionality across ProMiles applications
- Configurable: Via
appsettings.json(and environment-specific variants) - Docker Ready: Optimized for containerized workflows
Getting Started
Build
dotnet build
Usage
Reference this library in your .NET projects:
<ItemGroup>
<PackageReference Include="ProMilesV5.SharedOps" Version="1.2.3" />
</ItemGroup>
Dependency Injection Setup
using ProMilesV5.SharedOps.Extensions;
// In your Program.cs or Startup.cs
builder.Services.AddSharedOpsServices(new Uri("https://your-api-base-url.com"));
Claims Processing
The library provides comprehensive claims processing functionality for client applications to parse authentication claims and extract application access and feature information.
Key Components
AuthClaimsUtility: Static utility class for parsing claimsIClaimsService: Service interface for dependency injectionClaimsService: Service implementationIdentityInformation: Convenience container for parsed claims data
Models
FeatureAccessDto: Represents feature access claimsFeatureValueDto: Represents feature value claimsResolvedFeature: Represents resolved features with precedenceIdentityInformation: Complete parsed claims container
Usage Examples
Basic Claims Processing
using ProMilesV5.SharedOps.Services;
using ProMilesV5.SharedOps.Utilities;
// Using the service (recommended for DI)
var claimsService = serviceProvider.GetRequiredService<IClaimsService>();
var identityInfo = claimsService.CreateIdentityInformation(user, companyId);
// Using the utility directly
var apps = AuthClaimsUtility.GetApps(user);
var features = AuthClaimsUtility.GetRelevantFeatureValuesForCompany(user, companyId);
Working with IdentityInformation
var identityInfo = claimsService.CreateIdentityInformation(user, companyId);
// Access application list
foreach (var app in identityInfo.ApplicationAccess)
{
Console.WriteLine($"User has access to: {app}");
}
// Check specific features
if (identityInfo.HasFeature("AdvancedReporting", "Enabled"))
{
// Enable advanced reporting features
}
// Access all resolved features
foreach (var feature in identityInfo.FeaturesForCompany)
{
Console.WriteLine($"Feature: {feature.Role}, Value: {feature.Value}");
}
Claims Structure
The library expects claims in the following format:
Role Claims
- Type:
ClaimTypes.Role - Value: Application name (e.g., "App1", "App2")
Feature Access Claims
- Type:
"FeatureAccess" - Value: JSON object with
role,assigned, andcompanyIdproperties
Feature Value Claims
- Type:
"FeatureValue" - Value: JSON object with
role,value,companyId, andscopeproperties
Assignment Precedence
Features are resolved with the following precedence order:
- User - User-specific assignments
- Company - Company-specific assignments (exact company ID match)
- All Users - Global user assignments
- App - Application-level assignments
Configuration
- Place your settings in
appsettings.json,appsettings.Development.json, orappsettings.Beta.jsonas needed. - Files are copied to output automatically.
Docker
Build the Docker image:
docker build -t promilesv5-sharedops .
Development
- Target Framework: .NET 8.0
- Nullable enabled, implicit usings enabled
Authors
ProMiles
License
[Specify your license here]
ProMilesV5.SharedOps
Shared .NET 8.0 class library for ProMiles projects.
Features
- Company Services: Shared company validation and fuel tax ID operations
- Claims Processing: Authentication claims parsing for application access and feature management
- Common Operations: Utilities and shared functionality across ProMiles applications
- Configurable: Via
appsettings.json(and environment-specific variants) - Docker Ready: Optimized for containerized workflows
Getting Started
Build
dotnet build
Usage
Reference this library in your .NET projects:
<ItemGroup>
<PackageReference Include="ProMilesV5.SharedOps" Version="1.2.3" />
</ItemGroup>
Dependency Injection Setup
using ProMilesV5.SharedOps.Extensions;
// In your Program.cs or Startup.cs
builder.Services.AddSharedOpsServices(new Uri("https://your-api-base-url.com"));
Claims Processing
The library provides comprehensive claims processing functionality for client applications to parse authentication claims and extract application access and feature information.
Key Components
AuthClaimsUtility: Static utility class for parsing claimsIClaimsService: Service interface for dependency injectionClaimsService: Service implementationIdentityInformation: Convenience container for parsed claims data
Models
FeatureAccessDto: Represents feature access claimsFeatureValueDto: Represents feature value claimsResolvedFeature: Represents resolved features with precedenceIdentityInformation: Complete parsed claims container
Usage Examples
Basic Claims Processing
using ProMilesV5.SharedOps.Services;
using ProMilesV5.SharedOps.Utilities;
// Using the service (recommended for DI)
var claimsService = serviceProvider.GetRequiredService<IClaimsService>();
var identityInfo = claimsService.CreateIdentityInformation(user, companyId);
// Using the utility directly
var apps = AuthClaimsUtility.GetApps(user);
var features = AuthClaimsUtility.GetRelevantFeatureValuesForCompany(user, companyId);
Working with IdentityInformation
var identityInfo = claimsService.CreateIdentityInformation(user, companyId);
// Access application list
foreach (var app in identityInfo.ApplicationAccess)
{
Console.WriteLine($"User has access to: {app}");
}
// Check specific features
if (identityInfo.HasFeature("AdvancedReporting", "Enabled"))
{
// Enable advanced reporting features
}
// Access all resolved features
foreach (var feature in identityInfo.FeaturesForCompany)
{
Console.WriteLine($"Feature: {feature.Role}, Value: {feature.Value}");
}
Claims Structure
The library expects claims in the following format:
Role Claims
- Type:
ClaimTypes.Role - Value: Application name (e.g., "App1", "App2")
Feature Access Claims
- Type:
"FeatureAccess" - Value: JSON object with
role,assigned, andcompanyIdproperties
Feature Value Claims
- Type:
"FeatureValue" - Value: JSON object with
role,value,companyId, andscopeproperties
Assignment Precedence
Features are resolved with the following precedence order:
- User - User-specific assignments
- Company - Company-specific assignments (exact company ID match)
- All Users - Global user assignments
- App - Application-level assignments
Configuration
- Place your settings in
appsettings.json,appsettings.Development.json, orappsettings.Beta.jsonas needed. - Files are copied to output automatically.
Docker
Build the Docker image:
docker build -t promilesv5-sharedops .
Development
- Target Framework: .NET 8.0
- Nullable enabled, implicit usings enabled
Authors
ProMiles
License
[Specify your license here]
Release Notes
See CHANGELOG.md for detailed release notes
Dependencies
-
net8.0
- Microsoft.EntityFrameworkCore.SqlServer (>= 8.0.18)
- Microsoft.Extensions.Http (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
- System.Text.Json (>= 8.0.6)
Used By
NuGet packages
This package is not used by any NuGet packages.
Version History
| Version | Downloads | Last updated |
|---|---|---|
| 1.4.23 | 0 | 10/22/2025 |
| 1.4.22 | 0 | 10/17/2025 |
| 1.4.21 | 0 | 10/17/2025 |
| 1.4.20 | 0 | 10/17/2025 |
| 1.4.19 | 0 | 10/16/2025 |
| 1.4.18 | 0 | 10/16/2025 |
| 1.4.17 | 0 | 10/16/2025 |
| 1.4.16 | 0 | 10/16/2025 |
| 1.4.14 | 0 | 10/16/2025 |
| 1.4.12 | 0 | 10/16/2025 |
| 1.4.11 | 0 | 10/15/2025 |
| 1.4.10 | 0 | 10/15/2025 |
| 1.4.8 | 0 | 10/15/2025 |
| 1.4.7 | 0 | 10/15/2025 |
| 1.4.6 | 0 | 10/15/2025 |
| 1.4.5 | 0 | 10/15/2025 |
| 1.4.4 | 0 | 10/15/2025 |
| 1.4.3 | 0 | 10/15/2025 |
| 1.4.2 | 0 | 10/15/2025 |
| 1.4.1 | 0 | 10/10/2025 |
| 1.4.0 | 0 | 10/10/2025 |
| 1.3.8 | 0 | 10/3/2025 |
| 1.3.7 | 0 | 10/3/2025 |
| 1.3.6 | 0 | 10/3/2025 |
| 1.3.5 | 0 | 10/2/2025 |
| 1.3.4 | 0 | 10/2/2025 |
| 1.3.3 | 0 | 10/2/2025 |
| 1.3.2 | 0 | 10/2/2025 |
| 1.3.0 | 0 | 9/18/2025 |
| 1.2.7 | 0 | 9/18/2025 |
| 1.2.6 | 0 | 9/18/2025 |
| 1.2.5 | 0 | 9/18/2025 |
| 1.2.3 | 0 | 9/17/2025 |