diff options
17 files changed, 45 insertions, 75 deletions
diff --git a/projecttemplates/RelyingPartyLogic/RelyingPartyApplicationDbStore.cs b/projecttemplates/RelyingPartyLogic/RelyingPartyApplicationDbStore.cs index 910d6b2..670f1d5 100644 --- a/projecttemplates/RelyingPartyLogic/RelyingPartyApplicationDbStore.cs +++ b/projecttemplates/RelyingPartyLogic/RelyingPartyApplicationDbStore.cs @@ -9,15 +9,13 @@ namespace RelyingPartyLogic { using System.Collections.Generic; using System.Data; using System.Linq; - using System.Text; using DotNetOpenAuth; using DotNetOpenAuth.OpenId; - using DotNetOpenAuth.OpenId.RelyingParty; /// <summary> /// A database-backed state store for OpenID relying parties. /// </summary> - public class RelyingPartyApplicationDbStore : NonceDbStore, IRelyingPartyApplicationStore { + public class RelyingPartyApplicationDbStore : NonceDbStore, IOpenIdApplicationStore { /// <summary> /// Initializes a new instance of the <see cref="RelyingPartyApplicationDbStore"/> class. /// </summary> diff --git a/samples/OpenIdProviderWebForms/Code/CustomStore.cs b/samples/OpenIdProviderWebForms/Code/CustomStore.cs index 0b2aed7..dc7f568 100644 --- a/samples/OpenIdProviderWebForms/Code/CustomStore.cs +++ b/samples/OpenIdProviderWebForms/Code/CustomStore.cs @@ -11,9 +11,7 @@ namespace OpenIdProviderWebForms.Code { using System.Globalization; using DotNetOpenAuth; using DotNetOpenAuth.Configuration; - using DotNetOpenAuth.Messaging; using DotNetOpenAuth.OpenId; - using DotNetOpenAuth.OpenId.Provider; /// <summary> /// This custom store serializes all elements to demonstrate peristent and/or shared storage. @@ -25,7 +23,7 @@ namespace OpenIdProviderWebForms.Code { /// But we "persist" all associations and nonces into a DataTable to demonstrate /// that using a database is possible. /// </remarks> - public class CustomStore : IProviderApplicationStore { + public class CustomStore : IOpenIdApplicationStore { private static CustomStoreDataSet dataSet = new CustomStoreDataSet(); #region INonceStore Members diff --git a/samples/OpenIdRelyingPartyWebForms/Code/CustomStore.cs b/samples/OpenIdRelyingPartyWebForms/Code/CustomStore.cs index d113c8b..b0e5d35 100644 --- a/samples/OpenIdRelyingPartyWebForms/Code/CustomStore.cs +++ b/samples/OpenIdRelyingPartyWebForms/Code/CustomStore.cs @@ -3,11 +3,9 @@ using System.Collections.Generic; using System.Data; using System.Globalization; - using System.Security.Cryptography; using DotNetOpenAuth; using DotNetOpenAuth.Configuration; using DotNetOpenAuth.OpenId; - using DotNetOpenAuth.OpenId.RelyingParty; /// <summary> /// This custom store serializes all elements to demonstrate peristent and/or shared storage. @@ -19,7 +17,7 @@ /// But we "persist" all associations and nonces into a DataTable to demonstrate /// that using a database is possible. /// </remarks> - public class CustomStore : IRelyingPartyApplicationStore { + public class CustomStore : IOpenIdApplicationStore { private static CustomStoreDataSet dataSet = new CustomStoreDataSet(); #region INonceStore Members diff --git a/src/DotNetOpenAuth/Configuration/OpenIdProviderElement.cs b/src/DotNetOpenAuth/Configuration/OpenIdProviderElement.cs index b51ccfb..a594e86 100644 --- a/src/DotNetOpenAuth/Configuration/OpenIdProviderElement.cs +++ b/src/DotNetOpenAuth/Configuration/OpenIdProviderElement.cs @@ -7,6 +7,7 @@ namespace DotNetOpenAuth.Configuration { using System.Configuration; using System.Diagnostics.Contracts; + using DotNetOpenAuth.OpenId; using DotNetOpenAuth.OpenId.Provider; /// <summary> @@ -58,8 +59,8 @@ namespace DotNetOpenAuth.Configuration { /// Gets or sets the type to use for storing application state. /// </summary> [ConfigurationProperty(StoreConfigName)] - public TypeConfigurationElement<IProviderApplicationStore> ApplicationStore { - get { return (TypeConfigurationElement<IProviderApplicationStore>)this[StoreConfigName] ?? new TypeConfigurationElement<IProviderApplicationStore>(); } + public TypeConfigurationElement<IOpenIdApplicationStore> ApplicationStore { + get { return (TypeConfigurationElement<IOpenIdApplicationStore>)this[StoreConfigName] ?? new TypeConfigurationElement<IOpenIdApplicationStore>(); } set { this[StoreConfigName] = value; } } } diff --git a/src/DotNetOpenAuth/Configuration/OpenIdRelyingPartyElement.cs b/src/DotNetOpenAuth/Configuration/OpenIdRelyingPartyElement.cs index 915776c..17b890f 100644 --- a/src/DotNetOpenAuth/Configuration/OpenIdRelyingPartyElement.cs +++ b/src/DotNetOpenAuth/Configuration/OpenIdRelyingPartyElement.cs @@ -87,8 +87,8 @@ namespace DotNetOpenAuth.Configuration { /// Gets or sets the type to use for storing application state. /// </summary> [ConfigurationProperty(StoreConfigName)] - public TypeConfigurationElement<IRelyingPartyApplicationStore> ApplicationStore { - get { return (TypeConfigurationElement<IRelyingPartyApplicationStore>)this[StoreConfigName] ?? new TypeConfigurationElement<IRelyingPartyApplicationStore>(); } + public TypeConfigurationElement<IOpenIdApplicationStore> ApplicationStore { + get { return (TypeConfigurationElement<IOpenIdApplicationStore>)this[StoreConfigName] ?? new TypeConfigurationElement<IOpenIdApplicationStore>(); } set { this[StoreConfigName] = value; } } diff --git a/src/DotNetOpenAuth/DotNetOpenAuth.csproj b/src/DotNetOpenAuth/DotNetOpenAuth.csproj index 8ba8b0c..5241845 100644 --- a/src/DotNetOpenAuth/DotNetOpenAuth.csproj +++ b/src/DotNetOpenAuth/DotNetOpenAuth.csproj @@ -599,7 +599,6 @@ http://opensource.org/licenses/ms-pl.html <Compile Include="OpenId\Provider\IDirectedIdentityIdentifierProvider.cs" /> <Compile Include="OpenId\Provider\IHostProcessedRequest.cs" /> <Compile Include="OpenId\Provider\IErrorReporting.cs" /> - <Compile Include="OpenId\Provider\IProviderApplicationStore.cs" /> <Compile Include="OpenId\Provider\IProviderBehavior.cs" /> <Compile Include="OpenId\Provider\IRequest.cs" /> <Compile Include="OpenId\Provider\ProviderEndpoint.cs" /> @@ -660,7 +659,7 @@ http://opensource.org/licenses/ms-pl.html <Compile Include="OpenId\Protocol.cs" /> <Compile Include="OpenId\ProviderEndpointDescription.cs" /> <Compile Include="OpenId\Provider\ProviderSecuritySettings.cs" /> - <Compile Include="OpenId\RelyingParty\IRelyingPartyApplicationStore.cs" /> + <Compile Include="OpenId\IOpenIdApplicationStore.cs" /> <Compile Include="OpenId\RelyingParty\PositiveAuthenticationResponseSnapshot.cs" /> <Compile Include="OpenId\RelyingParty\RelyingPartySecuritySettings.cs" /> <Compile Include="OpenId\IdentifierDiscoveryResult.cs" /> diff --git a/src/DotNetOpenAuth/OpenId/IOpenIdApplicationStore.cs b/src/DotNetOpenAuth/OpenId/IOpenIdApplicationStore.cs new file mode 100644 index 0000000..6c04a81 --- /dev/null +++ b/src/DotNetOpenAuth/OpenId/IOpenIdApplicationStore.cs @@ -0,0 +1,16 @@ +//----------------------------------------------------------------------- +// <copyright file="IOpenIdApplicationStore.cs" company="Andrew Arnott"> +// Copyright (c) Andrew Arnott. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +namespace DotNetOpenAuth.OpenId { + using DotNetOpenAuth.Messaging.Bindings; + + /// <summary> + /// A hybrid of the store interfaces that an OpenID Provider must implement, and + /// an OpenID Relying Party may implement to operate in stateful (smart) mode. + /// </summary> + public interface IOpenIdApplicationStore : ICryptoKeyStore, INonceStore { + } +} diff --git a/src/DotNetOpenAuth/OpenId/Provider/IProviderApplicationStore.cs b/src/DotNetOpenAuth/OpenId/Provider/IProviderApplicationStore.cs deleted file mode 100644 index 1bdbe43..0000000 --- a/src/DotNetOpenAuth/OpenId/Provider/IProviderApplicationStore.cs +++ /dev/null @@ -1,19 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="IProviderApplicationStore.cs" company="Andrew Arnott"> -// Copyright (c) Andrew Arnott. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace DotNetOpenAuth.OpenId.Provider { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Text; - using DotNetOpenAuth.Messaging.Bindings; - - /// <summary> - /// A hybrid of all the store interfaces that an OpenID Provider must implement. - /// </summary> - public interface IProviderApplicationStore : ICryptoKeyStore, INonceStore { - } -} diff --git a/src/DotNetOpenAuth/OpenId/Provider/OpenIdProvider.cs b/src/DotNetOpenAuth/OpenId/Provider/OpenIdProvider.cs index 8be9a0b..24bb8b0 100644 --- a/src/DotNetOpenAuth/OpenId/Provider/OpenIdProvider.cs +++ b/src/DotNetOpenAuth/OpenId/Provider/OpenIdProvider.cs @@ -63,7 +63,7 @@ namespace DotNetOpenAuth.OpenId.Provider { /// Initializes a new instance of the <see cref="OpenIdProvider"/> class. /// </summary> /// <param name="applicationStore">The application store to use. Cannot be null.</param> - public OpenIdProvider(IProviderApplicationStore applicationStore) + public OpenIdProvider(IOpenIdApplicationStore applicationStore) : this((INonceStore)applicationStore, (ICryptoKeyStore)applicationStore) { Contract.Requires<ArgumentNullException>(applicationStore != null); Contract.Ensures(this.SecuritySettings != null); @@ -98,16 +98,16 @@ namespace DotNetOpenAuth.OpenId.Provider { /// HttpApplication state dictionary to store associations and nonces. /// </summary> [EditorBrowsable(EditorBrowsableState.Advanced)] - public static IProviderApplicationStore HttpApplicationStore { + public static IOpenIdApplicationStore HttpApplicationStore { get { Contract.Requires<InvalidOperationException>(HttpContext.Current != null && HttpContext.Current.Request != null, MessagingStrings.HttpContextRequired); - Contract.Ensures(Contract.Result<IProviderApplicationStore>() != null); + Contract.Ensures(Contract.Result<IOpenIdApplicationStore>() != null); HttpContext context = HttpContext.Current; - var store = (IProviderApplicationStore)context.Application[ApplicationStoreKey]; + var store = (IOpenIdApplicationStore)context.Application[ApplicationStoreKey]; if (store == null) { context.Application.Lock(); try { - if ((store = (IProviderApplicationStore)context.Application[ApplicationStoreKey]) == null) { + if ((store = (IOpenIdApplicationStore)context.Application[ApplicationStoreKey]) == null) { context.Application[ApplicationStoreKey] = store = new StandardProviderApplicationStore(); } } finally { diff --git a/src/DotNetOpenAuth/OpenId/Provider/StandardProviderApplicationStore.cs b/src/DotNetOpenAuth/OpenId/Provider/StandardProviderApplicationStore.cs index 8ead116..265b555 100644 --- a/src/DotNetOpenAuth/OpenId/Provider/StandardProviderApplicationStore.cs +++ b/src/DotNetOpenAuth/OpenId/Provider/StandardProviderApplicationStore.cs @@ -18,10 +18,10 @@ namespace DotNetOpenAuth.OpenId.Provider { /// out of the box on most single-server web sites. It is highly recommended /// that high traffic web sites consider using a database to store the information /// used by an OpenID Provider and write a custom implementation of the - /// <see cref="IProviderApplicationStore"/> interface to use instead of this + /// <see cref="IOpenIdApplicationStore"/> interface to use instead of this /// class. /// </remarks> - public class StandardProviderApplicationStore : IProviderApplicationStore { + public class StandardProviderApplicationStore : IOpenIdApplicationStore { /// <summary> /// The nonce store to use. /// </summary> diff --git a/src/DotNetOpenAuth/OpenId/RelyingParty/IRelyingPartyApplicationStore.cs b/src/DotNetOpenAuth/OpenId/RelyingParty/IRelyingPartyApplicationStore.cs deleted file mode 100644 index 2943720..0000000 --- a/src/DotNetOpenAuth/OpenId/RelyingParty/IRelyingPartyApplicationStore.cs +++ /dev/null @@ -1,21 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="IRelyingPartyApplicationStore.cs" company="Andrew Arnott"> -// Copyright (c) Andrew Arnott. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace DotNetOpenAuth.OpenId.RelyingParty { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Text; - using DotNetOpenAuth.Messaging.Bindings; - using DotNetOpenAuth.OpenId.ChannelElements; - - /// <summary> - /// A hybrid of all the store interfaces that a Relying Party requires in order - /// to operate in "smart" mode. - /// </summary> - public interface IRelyingPartyApplicationStore : ICryptoKeyStore, INonceStore { - } -} diff --git a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdAjaxRelyingParty.cs b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdAjaxRelyingParty.cs index 5978c21..652fa6b 100644 --- a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdAjaxRelyingParty.cs +++ b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdAjaxRelyingParty.cs @@ -37,7 +37,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { /// Initializes a new instance of the <see cref="OpenIdAjaxRelyingParty"/> class. /// </summary> /// <param name="applicationStore">The application store. If <c>null</c>, the relying party will always operate in "dumb mode".</param> - public OpenIdAjaxRelyingParty(IRelyingPartyApplicationStore applicationStore) + public OpenIdAjaxRelyingParty(IOpenIdApplicationStore applicationStore) : base(applicationStore) { Reporting.RecordFeatureUse(this); } diff --git a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdMobileTextBox.cs b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdMobileTextBox.cs index 8684bd1..9cafb74 100644 --- a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdMobileTextBox.cs +++ b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdMobileTextBox.cs @@ -524,7 +524,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { /// If set, this property must be set in each Page Load event /// as it is not persisted across postbacks. /// </remarks> - public IRelyingPartyApplicationStore CustomApplicationStore { get; set; } + public IOpenIdApplicationStore CustomApplicationStore { get; set; } #endregion @@ -759,7 +759,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { // If we're in stateful mode, first use the explicitly given one on this control if there // is one. Then try the configuration file specified one. Finally, use the default // in-memory one that's built into OpenIdRelyingParty. - IRelyingPartyApplicationStore store = this.Stateless ? null : + IOpenIdApplicationStore store = this.Stateless ? null : (this.CustomApplicationStore ?? DotNetOpenAuthSection.Configuration.OpenId.RelyingParty.ApplicationStore.CreateInstance(OpenIdRelyingParty.HttpApplicationStore)); var rp = new OpenIdRelyingParty(store); try { diff --git a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingParty.cs b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingParty.cs index 6efb57e..aec59b8 100644 --- a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingParty.cs +++ b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingParty.cs @@ -100,7 +100,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { /// Initializes a new instance of the <see cref="OpenIdRelyingParty"/> class. /// </summary> /// <param name="applicationStore">The application store. If <c>null</c>, the relying party will always operate in "dumb mode".</param> - public OpenIdRelyingParty(IRelyingPartyApplicationStore applicationStore) + public OpenIdRelyingParty(IOpenIdApplicationStore applicationStore) : this(applicationStore, applicationStore) { } @@ -164,17 +164,17 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { /// HttpApplication state dictionary to store associations and nonces. /// </summary> [EditorBrowsable(EditorBrowsableState.Advanced)] - public static IRelyingPartyApplicationStore HttpApplicationStore { + public static IOpenIdApplicationStore HttpApplicationStore { get { - Contract.Ensures(Contract.Result<IRelyingPartyApplicationStore>() != null); + Contract.Ensures(Contract.Result<IOpenIdApplicationStore>() != null); HttpContext context = HttpContext.Current; - ErrorUtilities.VerifyOperation(context != null, Strings.StoreRequiredWhenNoHttpContextAvailable, typeof(IRelyingPartyApplicationStore).Name); - var store = (IRelyingPartyApplicationStore)context.Application[ApplicationStoreKey]; + ErrorUtilities.VerifyOperation(context != null, Strings.StoreRequiredWhenNoHttpContextAvailable, typeof(IOpenIdApplicationStore).Name); + var store = (IOpenIdApplicationStore)context.Application[ApplicationStoreKey]; if (store == null) { context.Application.Lock(); try { - if ((store = (IRelyingPartyApplicationStore)context.Application[ApplicationStoreKey]) == null) { + if ((store = (IOpenIdApplicationStore)context.Application[ApplicationStoreKey]) == null) { context.Application[ApplicationStoreKey] = store = new StandardRelyingPartyApplicationStore(); } } finally { diff --git a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.cs b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.cs index f22645f..866f942 100644 --- a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.cs +++ b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.cs @@ -301,7 +301,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { /// </summary> /// <param name="store">The store to pass to the relying party constructor.</param> /// <returns>The instantiated relying party.</returns> - protected override OpenIdRelyingParty CreateRelyingParty(IRelyingPartyApplicationStore store) { + protected override OpenIdRelyingParty CreateRelyingParty(IOpenIdApplicationStore store) { return new OpenIdAjaxRelyingParty(store); } diff --git a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyControlBase.cs b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyControlBase.cs index 7cda8e0..b1106e6 100644 --- a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyControlBase.cs +++ b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyControlBase.cs @@ -792,7 +792,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { /// </summary> /// <returns>The instantiated relying party.</returns> protected OpenIdRelyingParty CreateRelyingParty() { - IRelyingPartyApplicationStore store = this.Stateless ? null : DotNetOpenAuthSection.Configuration.OpenId.RelyingParty.ApplicationStore.CreateInstance(OpenIdRelyingParty.HttpApplicationStore); + IOpenIdApplicationStore store = this.Stateless ? null : DotNetOpenAuthSection.Configuration.OpenId.RelyingParty.ApplicationStore.CreateInstance(OpenIdRelyingParty.HttpApplicationStore); return this.CreateRelyingParty(store); } @@ -801,7 +801,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { /// </summary> /// <param name="store">The store to pass to the relying party constructor.</param> /// <returns>The instantiated relying party.</returns> - protected virtual OpenIdRelyingParty CreateRelyingParty(IRelyingPartyApplicationStore store) { + protected virtual OpenIdRelyingParty CreateRelyingParty(IOpenIdApplicationStore store) { return new OpenIdRelyingParty(store); } diff --git a/src/DotNetOpenAuth/OpenId/RelyingParty/StandardRelyingPartyApplicationStore.cs b/src/DotNetOpenAuth/OpenId/RelyingParty/StandardRelyingPartyApplicationStore.cs index c3a623b..f17b260 100644 --- a/src/DotNetOpenAuth/OpenId/RelyingParty/StandardRelyingPartyApplicationStore.cs +++ b/src/DotNetOpenAuth/OpenId/RelyingParty/StandardRelyingPartyApplicationStore.cs @@ -15,7 +15,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { /// An in-memory store for Relying Parties, suitable for single server, single process /// ASP.NET web sites. /// </summary> - public class StandardRelyingPartyApplicationStore : IRelyingPartyApplicationStore { + public class StandardRelyingPartyApplicationStore : IOpenIdApplicationStore { /// <summary> /// The nonce store to use. /// </summary> |