< Summary

Information
Class: AsiBackbone.Signing.LocalDevelopment.LocalDevelopmentSigningBuilderExtensions
Assembly: AsiBackbone.Signing.LocalDevelopment
File(s): /home/runner/work/AsiBackbone/AsiBackbone/src/AsiBackbone.Signing.LocalDevelopment/LocalDevelopmentSigningBuilderExtensions.cs
Line coverage
100%
Covered lines: 11
Uncovered lines: 0
Coverable lines: 11
Total lines: 43
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
UseLocalDevelopmentSigning(...)100%11100%
UseLocalDevelopmentSigning(...)100%11100%

File(s)

/home/runner/work/AsiBackbone/AsiBackbone/src/AsiBackbone.Signing.LocalDevelopment/LocalDevelopmentSigningBuilderExtensions.cs

#LineLine coverage
 1using AsiBackbone.Core.Signing;
 2using AsiBackbone.DependencyInjection;
 3using Microsoft.Extensions.DependencyInjection;
 4
 5namespace AsiBackbone.Signing.LocalDevelopment;
 6
 7/// <summary>
 8/// Provides explicit builder facade extension methods for local-development signing.
 9/// </summary>
 10public static class LocalDevelopmentSigningBuilderExtensions
 11{
 12    /// <summary>
 13    /// Adds local-development signing and verification through the AsiBackbone builder facade using default options.
 14    /// </summary>
 15    public static IAsiBackboneBuilder UseLocalDevelopmentSigning(this IAsiBackboneBuilder builder)
 16    {
 417        return builder.UseLocalDevelopmentSigning(LocalDevelopmentSigningOptions.Create());
 18    }
 19
 20    /// <summary>
 21    /// Adds local-development signing and verification through the AsiBackbone builder facade using configured options.
 22    /// </summary>
 23    /// <exception cref="InvalidOperationException">
 24    /// Thrown when the configured local-development signing options are invalid.
 25    /// </exception>
 26    public static IAsiBackboneBuilder UseLocalDevelopmentSigning(
 27        this IAsiBackboneBuilder builder,
 28        LocalDevelopmentSigningOptions options)
 29    {
 1230        ArgumentNullException.ThrowIfNull(builder);
 831        ArgumentNullException.ThrowIfNull(options);
 632        options.Validate();
 33
 434        _ = builder.Services.AddSingleton(options);
 435        _ = builder.Services.AddSingleton<LocalDevelopmentSigningService>();
 436        _ = builder.Services.AddSingleton<IAsiBackboneSigningService>(serviceProvider =>
 837            serviceProvider.GetRequiredService<LocalDevelopmentSigningService>());
 438        _ = builder.Services.AddSingleton<IAsiBackboneSignatureVerificationService>(serviceProvider =>
 839            serviceProvider.GetRequiredService<LocalDevelopmentSigningService>());
 40
 441        return builder;
 42    }
 43}