< Summary

Information
Class: ArturRios.Util.WebApi.Security.Configuration.AuthenticationOptions
Assembly: ArturRios.Util.WebApi
File(s): /home/ci/agent/workspace/dotnet-webapi-util-docs_main/app/src/Security/Configuration/AuthenticationOptions.cs
Line coverage
100%
Covered lines: 8
Uncovered lines: 0
Coverable lines: 8
Total lines: 41
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage
100%
Covered methods: 8
Fully covered methods: 8
Total methods: 8
Method coverage: 100%
Full method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Source()100%11100%
get_CookieName()100%11100%
get_EnableJwt()100%11100%
get_EnableGoogle()100%11100%
get_JwtMode()100%11100%
get_ValidateIssuer()100%11100%
get_ValidateAudience()100%11100%
get_GoogleClientIds()100%11100%

File(s)

/home/ci/agent/workspace/dotnet-webapi-util-docs_main/app/src/Security/Configuration/AuthenticationOptions.cs

#LineLine coverage
 1using ArturRios.Util.WebApi.Security.Enums;
 2
 3namespace ArturRios.Util.WebApi.Security.Configuration;
 4
 5/// <summary>Consolidated options controlling how <c>AuthenticationMiddleware</c> reads and validates the request token.
 6public class AuthenticationOptions
 7{
 8    /// <summary>Where the token is read from. Defaults to <see cref="TokenSource.Header"/>.</summary>
 259    public TokenSource Source { get; set; } = TokenSource.Header;
 10
 11    /// <summary>The cookie name used when <see cref="Source"/> is <see cref="TokenSource.Cookie"/> or <see cref="TokenS
 8912    public string CookieName { get; set; } = "access_token";
 13
 14    /// <summary>Whether the app's own HMAC JWT is accepted. Defaults to <see langword="true"/>.</summary>
 10415    public bool EnableJwt { get; set; } = true;
 16
 17    /// <summary>Whether Google ID tokens are accepted. Defaults to <see langword="false"/>. Requires <see cref="GoogleC
 4118    public bool EnableGoogle { get; set; }
 19
 20    /// <summary>How the user is resolved for a valid app JWT. Defaults to <see cref="JwtValidationMode.ClaimsOnly"/>.</
 5021    public JwtValidationMode JwtMode { get; set; } = JwtValidationMode.ClaimsOnly;
 22
 23    /// <summary>
 24    /// Whether an app JWT must carry an <c>iss</c> claim equal (ordinal) to <c>JwtConfiguration.Issuer</c>.
 25    /// Defaults to <see langword="false"/>: only the signature is checked, as before 5.2.0. Turn it on when the
 26    /// signing key is shared with another issuer, so its tokens are not accepted here. When on, a blank
 27    /// <c>JwtConfiguration.Issuer</c> fails the application's startup.
 28    /// </summary>
 12529    public bool ValidateIssuer { get; set; }
 30
 31    /// <summary>
 32    /// Whether an app JWT must list <c>JwtConfiguration.Audience</c> (ordinal) among its <c>aud</c> claims.
 33    /// Defaults to <see langword="false"/>: only the signature is checked, as before 5.2.0. Turn it on when the
 34    /// signing key is shared by several audiences, so a token minted for one is not accepted by another. When on,
 35    /// a blank <c>JwtConfiguration.Audience</c> fails the application's startup.
 36    /// </summary>
 10837    public bool ValidateAudience { get; set; }
 38
 39    /// <summary>The accepted Google OAuth client IDs (token audiences). Required when <see cref="EnableGoogle"/> is <se
 8540    public IList<string> GoogleClientIds { get; set; } = new List<string>();
 41}