| | | 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 | | |
| | | 4 | | using System; |
| | | 5 | | using System.Threading.Tasks; |
| | | 6 | | using System.Xml; |
| | | 7 | | using CoreWCF.Channels; |
| | | 8 | | |
| | | 9 | | namespace CoreWCF.Security |
| | | 10 | | { |
| | | 11 | | internal abstract class SecurityHeaderElementInferenceEngine |
| | | 12 | | { |
| | | 13 | | public abstract ValueTask ExecuteProcessingPassesAsync(ReceiveSecurityHeader securityHeader, XmlDictionaryReader |
| | | 14 | | |
| | | 15 | | public abstract void MarkElements(ReceiveSecurityHeaderElementManager elementManager, bool messageSecurityMode); |
| | | 16 | | |
| | | 17 | | public static SecurityHeaderElementInferenceEngine GetInferenceEngine(SecurityHeaderLayout layout) |
| | | 18 | | { |
| | 94 | 19 | | SecurityHeaderLayoutHelper.Validate(layout); |
| | | 20 | | switch (layout) |
| | | 21 | | { |
| | | 22 | | case SecurityHeaderLayout.Strict: |
| | 88 | 23 | | return StrictModeSecurityHeaderElementInferenceEngine.Instance; |
| | | 24 | | case SecurityHeaderLayout.Lax: |
| | 6 | 25 | | return LaxModeSecurityHeaderElementInferenceEngine.Instance; |
| | | 26 | | case SecurityHeaderLayout.LaxTimestampFirst: |
| | 0 | 27 | | return LaxTimestampFirstModeSecurityHeaderElementInferenceEngine.Instance; |
| | | 28 | | case SecurityHeaderLayout.LaxTimestampLast: |
| | 0 | 29 | | return LaxTimestampLastModeSecurityHeaderElementInferenceEngine.Instance; |
| | | 30 | | default: |
| | 0 | 31 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(lay |
| | | 32 | | } |
| | | 33 | | } |
| | | 34 | | } |
| | | 35 | | } |