< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Security.TrustDriver
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Security/TrustDriver.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 11
Coverable lines: 11
Total lines: 137
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 Cyclomatic complexity NPath complexity Sequence coverage
IsSignWithElement(...)100%110%
IsEncryptWithElement(...)100%110%
IsEncryptionAlgorithmElement(...)100%110%
IsCanonicalizationAlgorithmElement(...)100%110%
IsKeyWrapAlgorithmElement(...)100%110%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Security/TrustDriver.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;
 5using System.Collections.Generic;
 6using System.Collections.ObjectModel;
 7using System.Runtime.Serialization;
 8using System.Security.Cryptography;
 9using System.Xml;
 10using CoreWCF.IdentityModel.Policy;
 11using CoreWCF.IdentityModel.Selectors;
 12using CoreWCF.IdentityModel.Tokens;
 13
 14namespace CoreWCF.Security
 15{
 16    internal abstract class TrustDriver
 17    {
 18        // issued tokens control
 019        public virtual bool IsIssuedTokensSupported => false;
 20
 21        // issued tokens feature
 22        public virtual string IssuedTokensHeaderName =>
 023                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.Tru
 24
 25        // issued tokens feature
 26        public virtual string IssuedTokensHeaderNamespace =>
 027                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.Tru
 28
 29        // session control
 030        public virtual bool IsSessionSupported => false;
 31
 32        public abstract XmlDictionaryString RequestSecurityTokenAction { get; }
 33
 34        public abstract XmlDictionaryString RequestSecurityTokenResponseAction { get; }
 35
 36        public abstract XmlDictionaryString RequestSecurityTokenResponseFinalAction { get; }
 37
 38        // session feature
 39        public virtual string RequestTypeClose =>
 040                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.Tru
 41
 42        public abstract string RequestTypeIssue { get; }
 43
 44        // session feature
 45        public virtual string RequestTypeRenew =>
 046                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.Tru
 47
 48        public abstract string ComputedKeyAlgorithm { get; }
 49
 50        public abstract SecurityStandardsManager StandardsManager { get; }
 51
 52        public abstract XmlDictionaryString Namespace { get; }
 53
 54        // RST specific method
 55        public abstract RequestSecurityToken CreateRequestSecurityToken(XmlReader reader);
 56
 57        // RSTR specific method
 58        public abstract RequestSecurityTokenResponse CreateRequestSecurityTokenResponse(XmlReader reader);
 59
 60        // RSTRC specific method
 61        public abstract RequestSecurityTokenResponseCollection CreateRequestSecurityTokenResponseCollection(XmlReader xm
 62
 63        public abstract bool IsAtRequestSecurityTokenResponse(XmlReader reader);
 64
 65        public abstract bool IsAtRequestSecurityTokenResponseCollection(XmlReader reader);
 66
 67        public abstract bool IsRequestedSecurityTokenElement(string name, string nameSpace);
 68
 69        public abstract bool IsRequestedProofTokenElement(string name, string nameSpace);
 70
 71        public abstract T GetAppliesTo<T>(RequestSecurityToken rst, XmlObjectSerializer serializer);
 72
 73        public abstract T GetAppliesTo<T>(RequestSecurityTokenResponse rstr, XmlObjectSerializer serializer);
 74
 75        public abstract void GetAppliesToQName(RequestSecurityToken rst, out string localName, out string namespaceUri);
 76
 77        public abstract void GetAppliesToQName(RequestSecurityTokenResponse rstr, out string localName, out string names
 78
 79        public abstract bool IsAppliesTo(string localName, string namespaceUri);
 80
 81        // RSTR specific method
 82        public abstract byte[] GetAuthenticator(RequestSecurityTokenResponse rstr);
 83
 84        // RST specific method
 85        public abstract BinaryNegotiation GetBinaryNegotiation(RequestSecurityToken rst);
 86
 87        // RSTR specific method
 88        public abstract BinaryNegotiation GetBinaryNegotiation(RequestSecurityTokenResponse rstr);
 89
 90        // RST specific method
 91        public abstract SecurityToken GetEntropy(RequestSecurityToken rst, SecurityTokenResolver resolver);
 92
 93        // RSTR specific method
 94        public abstract SecurityToken GetEntropy(RequestSecurityTokenResponse rstr, SecurityTokenResolver resolver);
 95
 96        // RSTR specific method
 97        public abstract GenericXmlSecurityToken GetIssuedToken(RequestSecurityTokenResponse rstr, SecurityTokenResolver 
 98            string expectedTokenType, ReadOnlyCollection<IAuthorizationPolicy> authorizationPolicies, int defaultKeySize
 99
 100        public abstract GenericXmlSecurityToken GetIssuedToken(RequestSecurityTokenResponse rstr, string expectedTokenTy
 101
 102        public abstract void OnRSTRorRSTRCMissingException();
 103
 104        // RST specific method
 105        public abstract void WriteRequestSecurityToken(RequestSecurityToken rst, XmlWriter w);
 106
 107        // RSTR specific method
 108        public abstract void WriteRequestSecurityTokenResponse(RequestSecurityTokenResponse rstr, XmlWriter w);
 109
 110        // RSTR Collection method
 111        public abstract void WriteRequestSecurityTokenResponseCollection(RequestSecurityTokenResponseCollection rstrColl
 112
 113        // Federation proxy creation
 114        //  public abstract IChannelFactory<IRequestChannel> CreateFederationProxy(EndpointAddress address, Binding bind
 115        public abstract XmlElement CreateKeySizeElement(int keySize);
 116        public abstract XmlElement CreateKeyTypeElement(SecurityKeyType keyType);
 117        public abstract XmlElement CreateTokenTypeElement(string tokenTypeUri);
 118        public abstract XmlElement CreateRequiredClaimsElement(IEnumerable<XmlElement> claimsList);
 119        public abstract XmlElement CreateUseKeyElement(SecurityKeyIdentifier keyIdentifier, SecurityStandardsManager sta
 120        public abstract XmlElement CreateSignWithElement(string signatureAlgorithm);
 121        public abstract XmlElement CreateEncryptWithElement(string encryptionAlgorithm);
 122        public abstract XmlElement CreateEncryptionAlgorithmElement(string encryptionAlgorithm);
 123        public abstract XmlElement CreateCanonicalizationAlgorithmElement(string canonicalicationAlgorithm);
 124        public abstract XmlElement CreateComputedKeyAlgorithmElement(string computedKeyAlgorithm);
 125        public abstract Collection<XmlElement> ProcessUnknownRequestParameters(Collection<XmlElement> unknownRequestPara
 126        public abstract bool TryParseKeySizeElement(XmlElement element, out int keySize);
 127        public abstract bool TryParseKeyTypeElement(XmlElement element, out SecurityKeyType keyType);
 128        public abstract bool TryParseTokenTypeElement(XmlElement element, out string tokenType);
 129        public abstract bool TryParseRequiredClaimsElement(XmlElement element, out Collection<XmlElement> requiredClaims
 130        // helper methods for the parsing standard binding elements
 0131        internal virtual bool IsSignWithElement(XmlElement element, out string signatureAlgorithm) { signatureAlgorithm 
 0132        internal virtual bool IsEncryptWithElement(XmlElement element, out string encryptWithAlgorithm) { encryptWithAlg
 0133        internal virtual bool IsEncryptionAlgorithmElement(XmlElement element, out string encryptionAlgorithm) { encrypt
 0134        internal virtual bool IsCanonicalizationAlgorithmElement(XmlElement element, out string canonicalizationAlgorith
 0135        internal virtual bool IsKeyWrapAlgorithmElement(XmlElement element, out string keyWrapAlgorithm) { keyWrapAlgori
 136    }
 137}