| | | 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.Configuration; |
| | | 5 | | using CoreWCF.Channels; |
| | | 6 | | |
| | | 7 | | namespace CoreWCF.Configuration |
| | | 8 | | { |
| | | 9 | | public class BasicHttpSecurityElement : ServiceModelConfigurationElement |
| | | 10 | | { |
| | | 11 | | [ConfigurationProperty(ConfigurationStrings.Mode, DefaultValue = BasicHttpSecurityMode.None)] |
| | | 12 | | public BasicHttpSecurityMode Mode |
| | | 13 | | { |
| | 14 | 14 | | get { return (BasicHttpSecurityMode)base[ConfigurationStrings.Mode]; } |
| | 0 | 15 | | set { base[ConfigurationStrings.Mode] = value; } |
| | | 16 | | } |
| | | 17 | | |
| | | 18 | | [ConfigurationProperty(ConfigurationStrings.Transport)] |
| | | 19 | | public HttpTransportSecurityElement Transport |
| | | 20 | | { |
| | 6 | 21 | | get { return (HttpTransportSecurityElement)base[ConfigurationStrings.Transport]; } |
| | | 22 | | } |
| | | 23 | | |
| | | 24 | | [ConfigurationProperty(ConfigurationStrings.Message)] |
| | | 25 | | public BasicHttpMessageSecurityElement Message |
| | | 26 | | { |
| | 6 | 27 | | get { return (BasicHttpMessageSecurityElement)base[ConfigurationStrings.Message]; } |
| | | 28 | | } |
| | | 29 | | |
| | | 30 | | internal void ApplyConfiguration(BasicHttpSecurity security) |
| | | 31 | | { |
| | 6 | 32 | | if (security == null) |
| | | 33 | | { |
| | 0 | 34 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(security)); |
| | | 35 | | } |
| | | 36 | | |
| | 6 | 37 | | security.Mode = Mode; |
| | 6 | 38 | | Transport.ApplyConfiguration(security.Transport); |
| | 6 | 39 | | Message.ApplyConfiguration(security.Message); |
| | 6 | 40 | | } |
| | | 41 | | } |
| | | 42 | | } |