ProMilesV5.SharedOps 1.2.3

Shared service library for ProMiles V5 Shared Operations providing company validation, claims processing, and common utilities

There is a newer version of this package available.
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" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ProMilesV5.SharedOps --version 1.2.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ProMilesV5.SharedOps, 1.2.3"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// 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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

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 claims
  • IClaimsService: Service interface for dependency injection
  • ClaimsService: Service implementation
  • IdentityInformation: Convenience container for parsed claims data

Models

  • FeatureAccessDto: Represents feature access claims
  • FeatureValueDto: Represents feature value claims
  • ResolvedFeature: Represents resolved features with precedence
  • IdentityInformation: 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, and companyId properties
Feature Value Claims
  • Type: "FeatureValue"
  • Value: JSON object with role, value, companyId, and scope properties

Assignment Precedence

Features are resolved with the following precedence order:

  1. User - User-specific assignments
  2. Company - Company-specific assignments (exact company ID match)
  3. All Users - Global user assignments
  4. App - Application-level assignments

Configuration

  • Place your settings in appsettings.json, appsettings.Development.json, or appsettings.Beta.json as 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 claims
  • IClaimsService: Service interface for dependency injection
  • ClaimsService: Service implementation
  • IdentityInformation: Convenience container for parsed claims data

Models

  • FeatureAccessDto: Represents feature access claims
  • FeatureValueDto: Represents feature value claims
  • ResolvedFeature: Represents resolved features with precedence
  • IdentityInformation: 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, and companyId properties
Feature Value Claims
  • Type: "FeatureValue"
  • Value: JSON object with role, value, companyId, and scope properties

Assignment Precedence

Features are resolved with the following precedence order:

  1. User - User-specific assignments
  2. Company - Company-specific assignments (exact company ID match)
  3. All Users - Global user assignments
  4. App - Application-level assignments

Configuration

  • Place your settings in appsettings.json, appsettings.Development.json, or appsettings.Beta.json as 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

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
Show less