diff options
Diffstat (limited to 'src/DotNetOpenAuth.OpenId/Configuration')
7 files changed, 4 insertions, 21 deletions
diff --git a/src/DotNetOpenAuth.OpenId/Configuration/AssociationTypeCollection.cs b/src/DotNetOpenAuth.OpenId/Configuration/AssociationTypeCollection.cs index 419a76a..384497c 100644 --- a/src/DotNetOpenAuth.OpenId/Configuration/AssociationTypeCollection.cs +++ b/src/DotNetOpenAuth.OpenId/Configuration/AssociationTypeCollection.cs @@ -7,12 +7,10 @@ namespace DotNetOpenAuth.Configuration { using System.Collections.Generic; using System.Configuration; - using System.Diagnostics.Contracts; /// <summary> /// Describes a collection of association type sub-elements in a .config file. /// </summary> - [ContractVerification(true)] internal class AssociationTypeCollection : ConfigurationElementCollection, IEnumerable<AssociationTypeElement> { /// <summary> /// Initializes a new instance of the <see cref="AssociationTypeCollection"/> class. diff --git a/src/DotNetOpenAuth.OpenId/Configuration/AssociationTypeElement.cs b/src/DotNetOpenAuth.OpenId/Configuration/AssociationTypeElement.cs index 32c1cc9..c64913d 100644 --- a/src/DotNetOpenAuth.OpenId/Configuration/AssociationTypeElement.cs +++ b/src/DotNetOpenAuth.OpenId/Configuration/AssociationTypeElement.cs @@ -8,7 +8,6 @@ namespace DotNetOpenAuth.Configuration { using System; using System.Collections.Generic; using System.Configuration; - using System.Diagnostics.Contracts; using System.Linq; using System.Text; @@ -16,7 +15,6 @@ namespace DotNetOpenAuth.Configuration { /// Describes an association type and its maximum lifetime as an element /// in a .config file. /// </summary> - [ContractVerification(true)] internal class AssociationTypeElement : ConfigurationElement { /// <summary> /// The name of the attribute that stores the association type. diff --git a/src/DotNetOpenAuth.OpenId/Configuration/OpenIdElement.cs b/src/DotNetOpenAuth.OpenId/Configuration/OpenIdElement.cs index c43a3ad..6c6ad10 100644 --- a/src/DotNetOpenAuth.OpenId/Configuration/OpenIdElement.cs +++ b/src/DotNetOpenAuth.OpenId/Configuration/OpenIdElement.cs @@ -8,14 +8,13 @@ namespace DotNetOpenAuth.Configuration { using System; using System.Collections.Generic; using System.Configuration; - using System.Diagnostics.Contracts; using DotNetOpenAuth.OpenId.ChannelElements; using DotNetOpenAuth.OpenId.Messages; + using Validation; /// <summary> /// Represents the <openid> element in the host's .config file. /// </summary> - [ContractVerification(true)] internal class OpenIdElement : ConfigurationSection { /// <summary> /// The name of the section under which this library's settings must be found. @@ -63,7 +62,6 @@ namespace DotNetOpenAuth.Configuration { /// </summary> public static OpenIdElement Configuration { get { - Contract.Ensures(Contract.Result<OpenIdElement>() != null); return (OpenIdElement)ConfigurationManager.GetSection(SectionName) ?? new OpenIdElement(); } } @@ -80,14 +78,13 @@ namespace DotNetOpenAuth.Configuration { [PositiveTimeSpanValidator] internal TimeSpan MaxAuthenticationTime { get { - Contract.Ensures(Contract.Result<TimeSpan>() > TimeSpan.Zero); TimeSpan result = (TimeSpan)this[MaxAuthenticationTimePropertyName]; - Contract.Assume(result > TimeSpan.Zero); // our PositiveTimeSpanValidator should take care of this + Assumes.True(result > TimeSpan.Zero); // our PositiveTimeSpanValidator should take care of this return result; } set { - Requires.InRange(value > TimeSpan.Zero, "value"); + Requires.Range(value > TimeSpan.Zero, "value"); this[MaxAuthenticationTimePropertyName] = value; } } diff --git a/src/DotNetOpenAuth.OpenId/Configuration/OpenIdProviderElement.cs b/src/DotNetOpenAuth.OpenId/Configuration/OpenIdProviderElement.cs index df93d3b..dfa5a86 100644 --- a/src/DotNetOpenAuth.OpenId/Configuration/OpenIdProviderElement.cs +++ b/src/DotNetOpenAuth.OpenId/Configuration/OpenIdProviderElement.cs @@ -6,14 +6,12 @@ namespace DotNetOpenAuth.Configuration { using System.Configuration; - using System.Diagnostics.Contracts; using DotNetOpenAuth.OpenId; using DotNetOpenAuth.OpenId.Provider; /// <summary> /// The section in the .config file that allows customization of OpenID Provider behaviors. /// </summary> - [ContractVerification(true)] internal class OpenIdProviderElement : ConfigurationElement { /// <summary> /// The name of the <provider> sub-element. diff --git a/src/DotNetOpenAuth.OpenId/Configuration/OpenIdProviderSecuritySettingsElement.cs b/src/DotNetOpenAuth.OpenId/Configuration/OpenIdProviderSecuritySettingsElement.cs index f003900..3579faa 100644 --- a/src/DotNetOpenAuth.OpenId/Configuration/OpenIdProviderSecuritySettingsElement.cs +++ b/src/DotNetOpenAuth.OpenId/Configuration/OpenIdProviderSecuritySettingsElement.cs @@ -6,14 +6,12 @@ namespace DotNetOpenAuth.Configuration { using System.Configuration; - using System.Diagnostics.Contracts; using DotNetOpenAuth.OpenId; using DotNetOpenAuth.OpenId.Provider; /// <summary> /// Represents the .config file element that allows for setting the security policies of the Provider. /// </summary> - [ContractVerification(true)] internal class OpenIdProviderSecuritySettingsElement : ConfigurationElement { /// <summary> /// Gets the name of the @protectDownlevelReplayAttacks attribute. @@ -111,7 +109,6 @@ namespace DotNetOpenAuth.Configuration { [ConfigurationCollection(typeof(AssociationTypeCollection))] public AssociationTypeCollection AssociationLifetimes { get { - Contract.Ensures(Contract.Result<AssociationTypeCollection>() != null); return (AssociationTypeCollection)this[AssociationsConfigName] ?? new AssociationTypeCollection(); } @@ -144,7 +141,7 @@ namespace DotNetOpenAuth.Configuration { settings.UnsolicitedAssertionVerification = this.UnsolicitedAssertionVerification; settings.EncodeAssociationSecretsInHandles = this.EncodeAssociationSecretsInHandles; foreach (AssociationTypeElement element in this.AssociationLifetimes) { - Contract.Assume(element != null); + Assumes.True(element != null); settings.AssociationLifetimes.Add(element.AssociationType, element.MaximumLifetime); } diff --git a/src/DotNetOpenAuth.OpenId/Configuration/OpenIdRelyingPartyElement.cs b/src/DotNetOpenAuth.OpenId/Configuration/OpenIdRelyingPartyElement.cs index 8af1129..681ba38 100644 --- a/src/DotNetOpenAuth.OpenId/Configuration/OpenIdRelyingPartyElement.cs +++ b/src/DotNetOpenAuth.OpenId/Configuration/OpenIdRelyingPartyElement.cs @@ -7,14 +7,12 @@ namespace DotNetOpenAuth.Configuration { using System; using System.Configuration; - using System.Diagnostics.Contracts; using DotNetOpenAuth.OpenId; using DotNetOpenAuth.OpenId.RelyingParty; /// <summary> /// The section in the .config file that allows customization of OpenID Relying Party behaviors. /// </summary> - [ContractVerification(true)] internal class OpenIdRelyingPartyElement : ConfigurationElement { /// <summary> /// The name of the custom store sub-element. diff --git a/src/DotNetOpenAuth.OpenId/Configuration/OpenIdRelyingPartySecuritySettingsElement.cs b/src/DotNetOpenAuth.OpenId/Configuration/OpenIdRelyingPartySecuritySettingsElement.cs index f0d8942..a2e2c34 100644 --- a/src/DotNetOpenAuth.OpenId/Configuration/OpenIdRelyingPartySecuritySettingsElement.cs +++ b/src/DotNetOpenAuth.OpenId/Configuration/OpenIdRelyingPartySecuritySettingsElement.cs @@ -7,7 +7,6 @@ namespace DotNetOpenAuth.Configuration { using System; using System.Configuration; - using System.Diagnostics.Contracts; using DotNetOpenAuth.OpenId; using DotNetOpenAuth.OpenId.RelyingParty; @@ -238,8 +237,6 @@ namespace DotNetOpenAuth.Configuration { /// </summary> /// <returns>The newly created security settings object.</returns> public RelyingPartySecuritySettings CreateSecuritySettings() { - Contract.Ensures(Contract.Result<RelyingPartySecuritySettings>() != null); - RelyingPartySecuritySettings settings = new RelyingPartySecuritySettings(); settings.RequireSsl = this.RequireSsl; settings.RequireDirectedIdentity = this.RequireDirectedIdentity; |