< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.IdentityModel.Tokens.IssuerNameRegistry
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/IdentityModel/Tokens/IssuerNameRegistry.cs
Line coverage
50%
Covered lines: 1
Uncovered lines: 1
Coverable lines: 2
Total lines: 47
Line coverage: 50%
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 Cyclomatic complexity NPath complexity Sequence coverage
GetIssuerName(...)100%11100%
GetWindowsIssuerName()100%110%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/IdentityModel/Tokens/IssuerNameRegistry.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System.Security.Claims;
 5
 6namespace CoreWCF.IdentityModel.Tokens
 7{
 8    /// <summary>
 9    /// Interface that defines the name service that returns that issuer name
 10    /// of a given token as string.
 11    /// </summary>
 12    public abstract class IssuerNameRegistry //: ICustomIdentityConfiguration
 13    {
 14        /// <summary>
 15        /// When implemented in the derived class, the method returns the issuer name of the given
 16        /// SecurityToken's issuer.  Implementations must return a non-null and non-empty string to
 17        /// identify a recognized issuer, or a null string to identify an unrecognized issuer.
 18        /// </summary>
 19        /// <param name="securityToken">The SecurityToken whose name is requested.</param>
 20        /// <returns>Issuer name as a string.</returns>
 21        public abstract string GetIssuerName( SecurityToken securityToken );
 22
 23        /// <summary>
 24        /// When implemented in the derived class the method returns the issuer name
 25        /// of the given SecurityToken's issuer. The requested issuer name may be considered
 26        /// in determining the issuer's name.
 27        /// </summary>
 28        /// <param name="securityToken">The SecurityToken whose name is requested.</param>
 29        /// <param name="requestedIssuerName">Input to determine the issuer name</param>
 30        /// <remarks>The default implementation ignores the requestedIsserName parameter and simply calls the
 31        /// GetIssuerName( SecurityToken securityToken ) method</remarks>
 32        /// <returns>Issuer name as a string.</returns>
 33        public virtual string GetIssuerName( SecurityToken securityToken, string requestedIssuerName )
 34        {
 3235            return GetIssuerName( securityToken );
 36        }
 37
 38        /// <summary>
 39        /// This function returns the default issuer name to be used for Windows claims.
 40        /// </summary>
 41        /// <returns>Issuer name as a string.</returns>
 42        public virtual string GetWindowsIssuerName()
 43        {
 044            return ClaimsIdentity.DefaultIssuer;
 45        }
 46    }
 47}