< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Security.Tokens.SecurityContextSecurityTokenParameters
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Security/Tokens/SecurityContextSecurityTokenParameters.cs
Line coverage
46%
Covered lines: 7
Uncovered lines: 8
Coverable lines: 15
Total lines: 48
Line coverage: 46.6%
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
.ctor(...)100%110%
.ctor()100%11100%
CloneCore()100%110%
CreateKeyIdentifierClause(...)100%110%
InitializeSecurityTokenRequirement(...)100%11100%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Security/Tokens/SecurityContextSecurityTokenParameters.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
 4namespace CoreWCF.Security.Tokens
 5{
 6    using CoreWCF.IdentityModel;
 7    using CoreWCF.IdentityModel.Selectors;
 8    using CoreWCF.IdentityModel.Tokens;
 9    using CoreWCF.Security;
 10
 11    internal class SecurityContextSecurityTokenParameters : SecurityTokenParameters
 12    {
 13        protected SecurityContextSecurityTokenParameters(SecurityContextSecurityTokenParameters other)
 014            : base(other)
 15        {
 16            // empty
 017        }
 18
 19        public SecurityContextSecurityTokenParameters()
 2220            : base()
 21        {
 2222            InclusionMode = SecurityTokenInclusionMode.AlwaysToRecipient;
 2223        }
 24
 025        protected internal override bool SupportsClientAuthentication { get { return true; } }
 026        protected internal override bool SupportsServerAuthentication { get { return true; } }
 027        protected internal override bool SupportsClientWindowsIdentity { get { return true; } }
 28
 029        protected internal override bool HasAsymmetricKey { get { return false; } }
 30
 31        protected override SecurityTokenParameters CloneCore()
 32        {
 033            return new SecurityContextSecurityTokenParameters(this);
 34        }
 35
 36        protected internal override SecurityKeyIdentifierClause CreateKeyIdentifierClause(SecurityToken token, SecurityT
 37        {
 038            return CreateKeyIdentifierClause<SecurityContextKeyIdentifierClause, LocalIdKeyIdentifierClause>(token, refe
 39        }
 40
 41        protected internal override void InitializeSecurityTokenRequirement(SecurityTokenRequirement requirement)
 42        {
 2243            requirement.TokenType = ServiceModelSecurityTokenTypes.SecurityContext;
 2244            requirement.KeyType = SecurityKeyType.SymmetricKey;
 2245            requirement.RequireCryptographicToken = true;
 2246        }
 47    }
 48}