< Summary

Information
Class: Elsa.Extensions.ConfigureJwtBearerOptions
Assembly: Elsa.Identity
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Identity/OptionConfigurators/ConfigureJwtBearerOptions.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 6
Coverable lines: 6
Total lines: 31
Line coverage: 0%
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
.ctor(...)100%210%
Configure(...)100%210%
Configure(...)100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Identity/OptionConfigurators/ConfigureJwtBearerOptions.cs

#LineLine coverage
 1using Elsa.Identity.Options;
 2using Microsoft.AspNetCore.Authentication.JwtBearer;
 3using Microsoft.Extensions.Options;
 4
 5// ReSharper disable once CheckNamespace
 6namespace Elsa.Extensions;
 7
 8/// <summary>
 9/// Configures the <see cref="JwtBearerOptions"/>
 10/// </summary>
 11public class ConfigureJwtBearerOptions : IConfigureNamedOptions<JwtBearerOptions>
 12{
 13    private readonly IOptions<IdentityTokenOptions> _identityTokenOptions;
 14
 15    /// <summary>
 16    /// Initializes a new instance of <see cref="ConfigureJwtBearerOptions"/>.
 17    /// </summary>
 018    public ConfigureJwtBearerOptions(IOptions<IdentityTokenOptions> identityTokenOptions)
 19    {
 020        _identityTokenOptions = identityTokenOptions;
 021    }
 22
 23    /// <inheritdoc />
 024    public void Configure(JwtBearerOptions options) => Configure(null, options);
 25
 26    /// <inheritdoc />
 27    public void Configure(string? name, JwtBearerOptions options)
 28    {
 029        _identityTokenOptions.Value.ConfigureJwtBearerOptions(options);
 030    }
 31}