Fix LocalClientSecuritySettingsElement.Property, and other couple of API fixes.
authoratsushieno <atsushi@ximian.com>
Wed, 28 Jul 2010 16:06:53 +0000 (01:06 +0900)
committeratsushieno <atsushi@ximian.com>
Wed, 28 Jul 2010 16:06:53 +0000 (01:06 +0900)
mcs/class/System.ServiceModel/System.ServiceModel.Configuration/CallbackTimeoutsElement.cs
mcs/class/System.ServiceModel/System.ServiceModel.Configuration/ChangeLog
mcs/class/System.ServiceModel/System.ServiceModel.Configuration/ChannelPoolSettingsElement.cs
mcs/class/System.ServiceModel/System.ServiceModel.Configuration/ClaimTypeElement.cs
mcs/class/System.ServiceModel/System.ServiceModel.Configuration/ClientCredentialsElement.cs
mcs/class/System.ServiceModel/System.ServiceModel.Configuration/LocalClientSecuritySettingsElement.cs
mcs/class/System.ServiceModel/System.ServiceModel.Configuration/ServiceCredentialsElement.cs
mcs/class/System.ServiceModel/System.ServiceModel.Configuration/ServiceModelExtensionCollectionElement.cs
mcs/class/System.ServiceModel/System.ServiceModel.Configuration/StandardBindingOptionalReliableSessionElement.cs
mcs/class/System.ServiceModel/System.ServiceModel.Configuration/StandardBindingReliableSessionElement.cs

index 599ebf2f4579f7e209aa43462afefd53987f2d3f..1400cc518988279a5732d933ddb02bb73327909d 100644 (file)
@@ -73,6 +73,7 @@ namespace System.ServiceModel.Configuration
                [ConfigurationProperty ("transactionTimeout",
                         DefaultValue = "00:00:00",
                         Options = ConfigurationPropertyOptions.None)]
+               [TypeConverter (typeof (TimeSpanConverter))]
                public TimeSpan TransactionTimeout {
                        get { return (TimeSpan) base ["transactionTimeout"]; }
                        set { base ["transactionTimeout"] = value; }
index 6b50418b8d97ccdb2879fbfc36a1a741a801636b..0dec8c675d5a73ec42d8cf76cbf225d50c79f62f 100755 (executable)
@@ -1,3 +1,15 @@
+2010-07-28  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * CallbackTimeoutsElement.cs
+         ChannelPoolSettingsElement.cs
+         ClaimTypeElement.cs
+         ClientCredentialsElement.cs
+         ServiceCredentialsElement.cs
+         ServiceModelExtensionCollectionElement.cs
+         StandardBindingOptionalReliableSessionElement.cs
+         StandardBindingReliableSessionElement.cs : couple of API fixes.
+       * LocalClientSecuritySettingsElement.cs : fixed Properties.
+
 2010-07-27  Atsushi Enomoto  <atsushi@ximian.com>
 
        * ClaimTypeElement.cs
index 60666ee715d597bd91edf773cebe07e5617790d1..617e77fd966ba9fd2b8c91c2f53c6f490bf9039a 100644 (file)
@@ -66,6 +66,7 @@ namespace System.ServiceModel.Configuration
                [ConfigurationProperty ("idleTimeout",
                         DefaultValue = "00:02:00",
                         Options = ConfigurationPropertyOptions.None)]
+               [TypeConverter (typeof (TimeSpanConverter))]
                public TimeSpan IdleTimeout {
                        get { return (TimeSpan) base ["idleTimeout"]; }
                        set { base ["idleTimeout"] = value; }
@@ -74,6 +75,7 @@ namespace System.ServiceModel.Configuration
                [ConfigurationProperty ("leaseTimeout",
                         DefaultValue = "00:10:00",
                         Options = ConfigurationPropertyOptions.None)]
+               [TypeConverter (typeof (TimeSpanConverter))]
                public TimeSpan LeaseTimeout {
                        get { return (TimeSpan) base ["leaseTimeout"]; }
                        set { base ["leaseTimeout"] = value; }
index a71fe2883b432b4026c4dd1e8ce7072dc977b595..05ef12d39dcb53c795d0982e1683848f1c415d33 100644 (file)
@@ -82,6 +82,11 @@ namespace System.ServiceModel.Configuration
                {
                }
 
+               public ClaimTypeElement (string claimType, bool isOptional)
+               {
+                       ClaimType = claimType;
+                       IsOptional = isOptional;
+               }
 
                // Properties
 
index ce61e96975ac4575bf67d19c574339737399c41c..9b1300e425db27c1330018df3831cadf24c51cce 100644 (file)
@@ -143,6 +143,12 @@ namespace System.ServiceModel.Configuration
                protected internal override object CreateBehavior ()
                {
                        var cb = new ClientCredentials ();
+                       ApplyConfiguration (cb);
+                       return cb;
+               }
+
+               protected internal void ApplyConfiguration (ClientCredentials cb)
+               {
                        cb.SupportInteractive = SupportInteractive;
                        // how is "Type" used?
 
@@ -198,8 +204,6 @@ namespace System.ServiceModel.Configuration
                        // Windows
                        cb.Windows.AllowedImpersonationLevel = Windows.AllowedImpersonationLevel;
                        cb.Windows.AllowNtlm = Windows.AllowNtlm;
-
-                       return cb;
                }
 
                object CreateInstance (string typeName)
index 9055f054906b5d8caef822a8ae25628f926a36b1..ec8e80900453e4f582c156149da4a9494ef9fa09 100644 (file)
@@ -57,6 +57,58 @@ namespace System.ServiceModel.Configuration
        public sealed class LocalClientSecuritySettingsElement
                 : ConfigurationElement
        {
+               static ConfigurationPropertyCollection properties;
+               static ConfigurationProperty cache_cookies;
+               static ConfigurationProperty cookie_renewal_threshold_percentage;
+               static ConfigurationProperty detect_replays;
+               static ConfigurationProperty max_clock_skew;
+               static ConfigurationProperty max_cookie_caching_time;
+               static ConfigurationProperty reconnect_transport_on_failure;
+               static ConfigurationProperty replay_cache_size;
+               static ConfigurationProperty replay_window;
+               static ConfigurationProperty session_key_renewal_interval;
+               static ConfigurationProperty session_key_rollover_interval;
+               static ConfigurationProperty timestamp_validity_duration;
+
+               static LocalClientSecuritySettingsElement ()
+               {
+                       cache_cookies = new ConfigurationProperty ("cacheCookies", typeof (bool), true, null, null, ConfigurationPropertyOptions.None);
+
+                       cookie_renewal_threshold_percentage = new ConfigurationProperty ("cookieRenewalThresholdPercentage", typeof (int), 60, null, new IntegerValidator (0, 100, false), ConfigurationPropertyOptions.None);
+
+                       detect_replays = new ConfigurationProperty ("detectReplays", typeof (bool), true, null, null, ConfigurationPropertyOptions.None);
+
+                       max_clock_skew = new ConfigurationProperty ("maxClockSkew", typeof (TimeSpan), "00:05:00", new TimeSpanConverter (), null, ConfigurationPropertyOptions.None);
+
+                       max_cookie_caching_time = new ConfigurationProperty ("maxCookieCachingTime", typeof (TimeSpan), "10675199.02:48:05.4775807", new TimeSpanConverter (), null, ConfigurationPropertyOptions.None);
+
+                       reconnect_transport_on_failure = new ConfigurationProperty ("reconnectTransportOnFailure", typeof (bool), true, null, null, ConfigurationPropertyOptions.None);
+
+                       replay_cache_size = new ConfigurationProperty ("replayCacheSize", typeof (int), 900000, null, new IntegerValidator (1, int.MaxValue, false), ConfigurationPropertyOptions.None);
+
+                       replay_window = new ConfigurationProperty ("replayWindow", typeof (TimeSpan), "00:05:00", new TimeSpanConverter (), null, ConfigurationPropertyOptions.None);
+
+                       session_key_renewal_interval = new ConfigurationProperty ("sessionKeyRenewalInterval", typeof (TimeSpan), "10:00:00", new TimeSpanConverter (), null, ConfigurationPropertyOptions.None);
+
+                       session_key_rollover_interval = new ConfigurationProperty ("sessionKeyRolloverInterval", typeof (TimeSpan), "00:05:00", new TimeSpanConverter (), null, ConfigurationPropertyOptions.None);
+
+                       timestamp_validity_duration = new ConfigurationProperty ("timestampValidityDuration", typeof (TimeSpan), "00:05:00", new TimeSpanConverter (), null, ConfigurationPropertyOptions.None);
+
+                       properties = new ConfigurationPropertyCollection ();
+
+                       properties.Add (cache_cookies);
+                       properties.Add (cookie_renewal_threshold_percentage);
+                       properties.Add (detect_replays);
+                       properties.Add (max_clock_skew);
+                       properties.Add (max_cookie_caching_time);
+                       properties.Add (reconnect_transport_on_failure);
+                       properties.Add (replay_cache_size);
+                       properties.Add (replay_window);
+                       properties.Add (session_key_renewal_interval);
+                       properties.Add (session_key_rollover_interval);
+                       properties.Add (timestamp_validity_duration);
+               }
+
                public LocalClientSecuritySettingsElement ()
                {
                }
@@ -110,7 +162,7 @@ namespace System.ServiceModel.Configuration
                }
 
                protected override ConfigurationPropertyCollection Properties {
-                       get { return base.Properties; }
+                       get { return properties; }
                }
 
                [ConfigurationProperty ("reconnectTransportOnFailure",
@@ -153,6 +205,7 @@ namespace System.ServiceModel.Configuration
                [ConfigurationProperty ("sessionKeyRolloverInterval",
                         Options = ConfigurationPropertyOptions.None,
                         DefaultValue = "00:05:00")]
+               [TypeConverter (typeof (TimeSpanConverter))]
                public TimeSpan SessionKeyRolloverInterval {
                        get { return (TimeSpan) base ["sessionKeyRolloverInterval"]; }
                        set { base ["sessionKeyRolloverInterval"] = value; }
index 0370819d01aeb35b0446e9853c426fd68e0386d6..9830a57ce690035aa64e9ff8a25f38117ebc67e5 100644 (file)
@@ -56,8 +56,7 @@ using System.Xml;
 
 namespace System.ServiceModel.Configuration
 {
-       public sealed class ServiceCredentialsElement
-                : BehaviorExtensionElement
+       public class ServiceCredentialsElement : BehaviorExtensionElement
        {
                public ServiceCredentialsElement () {
                }
@@ -126,11 +125,15 @@ namespace System.ServiceModel.Configuration
                        get { return (WindowsServiceElement) base ["windowsAuthentication"]; }
                }
 
-               [MonoTODO]
                protected internal override object CreateBehavior ()
                {
                        var sb = new ServiceCredentials ();
+                       ApplyConfiguration (sb);
+                       return sb;
+               }
 
+               protected internal void ApplyConfiguration (ServiceCredentials sb)
+               {
                        // IssuedToken
                        foreach (AllowedAudienceUriElement ae in IssuedTokenAuthentication.AllowedAudienceUris)
                                sb.IssuedTokenAuthentication.AllowedAudienceUris.Add (ae.AllowedAudienceUri);
@@ -180,8 +183,6 @@ namespace System.ServiceModel.Configuration
                        // Windows
                        sb.WindowsAuthentication.AllowAnonymousLogons = WindowsAuthentication.AllowAnonymousLogons;
                        sb.WindowsAuthentication.IncludeWindowsGroups = WindowsAuthentication.IncludeWindowsGroups;
-
-                       return sb;
                }
 
                X509Certificate2 GetCertificate (StoreLocation storeLocation, StoreName storeName, X509FindType findType, object findValue)
index 44fd3a8d1615aa0c994142167c821c6dac69d5d0..0c462fca9bb21cbccccea610215ad63d365059fb 100644 (file)
@@ -33,14 +33,16 @@ using System.Xml;
 
 namespace System.ServiceModel.Configuration
 {
-       [MonoTODO]
-       public class ServiceModelExtensionCollectionElement<TServiceModelExtensionElement> 
-               : ConfigurationElement,
+       public abstract class ServiceModelExtensionCollectionElement<TServiceModelExtensionElement> : ConfigurationElement,
                ICollection<TServiceModelExtensionElement>,
-               IEnumerable<TServiceModelExtensionElement>, 
+               IEnumerable<TServiceModelExtensionElement>,
                IEnumerable
                where TServiceModelExtensionElement : ServiceModelExtensionElement
        {
+               internal ServiceModelExtensionCollectionElement ()
+               {
+               }
+
                ConfigurationPropertyCollection properties;
 
                KeyedByTypeCollection<TServiceModelExtensionElement> _list = new KeyedByTypeCollection<TServiceModelExtensionElement> ();
index f992325b7c62a47345e0c0edefc785d6e82eacc6..45b4b753ba6caa04d7c60b656f725116f9bdfe84 100644 (file)
@@ -92,7 +92,7 @@ namespace System.ServiceModel.Configuration
 
                // Methods
 
-               internal void ApplyConfiguration (OptionalReliableSession s)
+               public void ApplyConfiguration (OptionalReliableSession s)
                {
                        base.ApplyConfiguration (s);
                        s.Enabled = this.Enabled;
index e2cb0bb901e090608f2c9741889e0bd5efc334fb..08d4aaa59a562ac8232857031d454e69f4a10895 100644 (file)
@@ -115,7 +115,7 @@ namespace System.ServiceModel.Configuration
 
                // Methods
 
-               internal void ApplyConfiguration (ReliableSession s)
+               public void ApplyConfiguration (ReliableSession s)
                {
                        s.InactivityTimeout = InactivityTimeout;
                        s.Ordered = Ordered;