< Summary

Information
Class: AsiBackbone.AspNetCore.DependencyInjection.AsiBackboneAspNetCoreBuilderExtensions
Assembly: AsiBackbone.AspNetCore
File(s): /home/runner/work/AsiBackbone/AsiBackbone/src/AsiBackbone.AspNetCore/DependencyInjection/AsiBackboneAspNetCoreBuilderExtensions.cs
Line coverage
58%
Covered lines: 10
Uncovered lines: 7
Coverable lines: 17
Total lines: 85
Line coverage: 58.8%
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

File(s)

/home/runner/work/AsiBackbone/AsiBackbone/src/AsiBackbone.AspNetCore/DependencyInjection/AsiBackboneAspNetCoreBuilderExtensions.cs

#LineLine coverage
 1using AsiBackbone.AspNetCore.Outbox;
 2using AsiBackbone.DependencyInjection;
 3
 4namespace AsiBackbone.AspNetCore.DependencyInjection;
 5
 6/// <summary>
 7/// Provides explicit builder facade extension methods for ASP.NET Core host integration.
 8/// </summary>
 9public static class AsiBackboneAspNetCoreBuilderExtensions
 10{
 11    /// <summary>
 12    /// Adds ASP.NET Core endpoint governance services through the AsiBackbone builder facade using default options.
 13    /// </summary>
 14    public static IAsiBackboneBuilder UseAspNetCoreEndpointGovernance(this IAsiBackboneBuilder builder)
 15    {
 216        return builder.UseAspNetCoreEndpointGovernance(_ => { });
 17    }
 18
 19    /// <summary>
 20    /// Adds ASP.NET Core endpoint governance services through the AsiBackbone builder facade using configured options.
 21    /// </summary>
 22    public static IAsiBackboneBuilder UseAspNetCoreEndpointGovernance(
 23        this IAsiBackboneBuilder builder,
 24        Action<AspNetCoreGovernanceOptions> configure)
 25    {
 426        ArgumentNullException.ThrowIfNull(builder);
 327        ArgumentNullException.ThrowIfNull(configure);
 28
 229        _ = builder.Services.AddAsiBackboneAspNetCore(configure);
 230        return builder;
 31    }
 32
 33    /// <summary>
 34    /// Opts in to signed capability grant endpoint validation through the AsiBackbone builder facade.
 35    /// </summary>
 36    /// <remarks>
 37    /// See <see cref="AsiBackboneSignedCapabilityGrantServiceCollectionExtensions.AddAsiBackboneSignedCapabilityGrants"
 38    /// for the services the host must also supply.
 39    /// </remarks>
 40    public static IAsiBackboneBuilder UseSignedCapabilityGrants(
 41        this IAsiBackboneBuilder builder,
 42        Action<CapabilityGrants.SignedCapabilityGrantOptions> configure)
 43    {
 044        ArgumentNullException.ThrowIfNull(builder);
 045        ArgumentNullException.ThrowIfNull(configure);
 46
 047        _ = builder.Services.AddAsiBackboneSignedCapabilityGrants(configure);
 048        return builder;
 49    }
 50
 51    /// <summary>
 52    /// Adds the form-field capability grant request-binding provider through the AsiBackbone builder facade.
 53    /// </summary>
 54    public static IAsiBackboneBuilder UseFormFieldCapabilityGrantBinding(
 55        this IAsiBackboneBuilder builder,
 56        Action<CapabilityGrants.FormFieldCapabilityGrantBindingOptions>? configure = null)
 57    {
 058        ArgumentNullException.ThrowIfNull(builder);
 59
 060        _ = builder.Services.AddAsiBackboneFormFieldCapabilityGrantBinding(configure);
 061        return builder;
 62    }
 63
 64    /// <summary>
 65    /// Adds the host-owned outbox drain worker through the AsiBackbone builder facade using default options.
 66    /// </summary>
 67    public static IAsiBackboneBuilder UseGovernanceOutboxDrain(this IAsiBackboneBuilder builder)
 68    {
 269        return builder.UseGovernanceOutboxDrain(_ => { });
 70    }
 71
 72    /// <summary>
 73    /// Adds the host-owned outbox drain worker through the AsiBackbone builder facade using configured options.
 74    /// </summary>
 75    public static IAsiBackboneBuilder UseGovernanceOutboxDrain(
 76        this IAsiBackboneBuilder builder,
 77        Action<GovernanceOutboxDrainWorkerOptions> configure)
 78    {
 479        ArgumentNullException.ThrowIfNull(builder);
 380        ArgumentNullException.ThrowIfNull(configure);
 81
 282        _ = builder.Services.AddAsiBackboneGovernanceOutboxDrainWorker(configure);
 283        return builder;
 84    }
 85}