diff options
Diffstat (limited to 'src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2')
9 files changed, 8 insertions, 74 deletions
diff --git a/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/ChannelElements/OAuth2ChannelBase.cs b/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/ChannelElements/OAuth2ChannelBase.cs index f2f674e..e6be1c4 100644 --- a/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/ChannelElements/OAuth2ChannelBase.cs +++ b/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/ChannelElements/OAuth2ChannelBase.cs @@ -12,6 +12,7 @@ namespace DotNetOpenAuth.OAuth2.ChannelElements { using DotNetOpenAuth.Messaging; using DotNetOpenAuth.OAuth2.Messages; + using Validation; /// <summary> /// The base messaging channel used by OAuth 2.0 parties. diff --git a/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/IClientDescription.cs b/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/IClientDescription.cs index b4bc689..fe05f25 100644 --- a/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/IClientDescription.cs +++ b/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/IClientDescription.cs @@ -7,13 +7,12 @@ namespace DotNetOpenAuth.OAuth2 { using System; using System.Collections.Generic; - using System.Diagnostics.Contracts; using DotNetOpenAuth.Messaging; + using Validation; /// <summary> /// A description of a client from an Authorization Server's point of view. /// </summary> - [ContractClass(typeof(IClientDescriptionContract))] public interface IClientDescription { /// <summary> /// Gets the callback to use when an individual authorization request @@ -69,70 +68,4 @@ namespace DotNetOpenAuth.OAuth2 { /// </remarks> bool IsValidClientSecret(string secret); } - - /// <summary> - /// Contract class for the <see cref="IClientDescription"/> interface. - /// </summary> - [ContractClassFor(typeof(IClientDescription))] - internal abstract class IClientDescriptionContract : IClientDescription { - #region IClientDescription Members - - /// <summary> - /// Gets the type of the client. - /// </summary> - ClientType IClientDescription.ClientType { - get { throw new NotImplementedException(); } - } - - /// <summary> - /// Gets the callback to use when an individual authorization request - /// does not include an explicit callback URI. - /// </summary> - /// <value> - /// An absolute URL; or <c>null</c> if none is registered. - /// </value> - Uri IClientDescription.DefaultCallback { - get { - Contract.Ensures(Contract.Result<Uri>() == null || Contract.Result<Uri>().IsAbsoluteUri); - throw new NotImplementedException(); - } - } - - /// <summary> - /// Gets a value indicating whether a non-empty secret is registered for this client. - /// </summary> - bool IClientDescription.HasNonEmptySecret { - get { throw new NotImplementedException(); } - } - - /// <summary> - /// Determines whether a callback URI included in a client's authorization request - /// is among those allowed callbacks for the registered client. - /// </summary> - /// <param name="callback">The requested callback URI.</param> - /// <returns> - /// <c>true</c> if the callback is allowed; otherwise, <c>false</c>. - /// </returns> - bool IClientDescription.IsCallbackAllowed(Uri callback) { - Requires.NotNull(callback, "callback"); - Requires.True(callback.IsAbsoluteUri, "callback"); - throw new NotImplementedException(); - } - - /// <summary> - /// Checks whether the specified client secret is correct. - /// </summary> - /// <param name="secret">The secret obtained from the client.</param> - /// <returns><c>true</c> if the secret matches the one in the authorization server's record for the client; <c>false</c> otherwise.</returns> - /// <remarks> - /// All string equality checks, whether checking secrets or their hashes, - /// should be done using <see cref="MessagingUtilities.EqualsConstantTime"/> to mitigate timing attacks. - /// </remarks> - bool IClientDescription.IsValidClientSecret(string secret) { - Requires.NotNullOrEmpty(secret, "secret"); - throw new NotImplementedException(); - } - - #endregion - } } diff --git a/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/AccessTokenAuthorizationCodeRequest.cs b/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/AccessTokenAuthorizationCodeRequest.cs index b8c9ede..bf06627 100644 --- a/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/AccessTokenAuthorizationCodeRequest.cs +++ b/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/AccessTokenAuthorizationCodeRequest.cs @@ -7,7 +7,6 @@ namespace DotNetOpenAuth.OAuth2.Messages { using System; using System.Collections.Generic; - using System.Diagnostics.Contracts; using System.Linq; using System.Text; diff --git a/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/EndUserAuthorizationFailedResponse.cs b/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/EndUserAuthorizationFailedResponse.cs index 7cc8e82..cb1c5d4 100644 --- a/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/EndUserAuthorizationFailedResponse.cs +++ b/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/EndUserAuthorizationFailedResponse.cs @@ -7,11 +7,11 @@ namespace DotNetOpenAuth.OAuth2.Messages { using System; using System.Collections.Generic; - using System.Diagnostics.Contracts; using System.Linq; using System.Runtime.Remoting.Messaging; using System.Text; using DotNetOpenAuth.Messaging; + using Validation; /// <summary> /// The message that an Authorization Server responds to a Client with when the user denies a user authorization request. diff --git a/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/EndUserAuthorizationRequest.cs b/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/EndUserAuthorizationRequest.cs index f229cf9..9da2c03 100644 --- a/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/EndUserAuthorizationRequest.cs +++ b/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/EndUserAuthorizationRequest.cs @@ -8,10 +8,10 @@ namespace DotNetOpenAuth.OAuth2.Messages { using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; - using System.Diagnostics.Contracts; using DotNetOpenAuth.Configuration; using DotNetOpenAuth.Messaging; using DotNetOpenAuth.OAuth2.ChannelElements; + using Validation; /// <summary> /// A message sent by a web application Client to the AuthorizationServer diff --git a/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/EndUserAuthorizationSuccessAccessTokenResponse.cs b/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/EndUserAuthorizationSuccessAccessTokenResponse.cs index 7a79e46..a776459 100644 --- a/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/EndUserAuthorizationSuccessAccessTokenResponse.cs +++ b/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/EndUserAuthorizationSuccessAccessTokenResponse.cs @@ -7,12 +7,12 @@ namespace DotNetOpenAuth.OAuth2.Messages { using System; using System.Collections.Generic; - using System.Diagnostics.Contracts; using System.Linq; using System.Text; using DotNetOpenAuth.Messaging; using DotNetOpenAuth.OAuth2.ChannelElements; + using Validation; /// <summary> /// The message sent by the Authorization Server to the Client via the user agent diff --git a/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/EndUserAuthorizationSuccessAuthCodeResponse.cs b/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/EndUserAuthorizationSuccessAuthCodeResponse.cs index 9d6b015..9f7c4b1 100644 --- a/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/EndUserAuthorizationSuccessAuthCodeResponse.cs +++ b/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/EndUserAuthorizationSuccessAuthCodeResponse.cs @@ -6,10 +6,10 @@ namespace DotNetOpenAuth.OAuth2.Messages { using System; - using System.Diagnostics.Contracts; using DotNetOpenAuth.Messaging; using DotNetOpenAuth.OAuth2.ChannelElements; + using Validation; /// <summary> /// The message sent by the Authorization Server to the Client via the user agent diff --git a/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/EndUserAuthorizationSuccessResponseBase.cs b/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/EndUserAuthorizationSuccessResponseBase.cs index ef0010e..bf385f9 100644 --- a/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/EndUserAuthorizationSuccessResponseBase.cs +++ b/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/EndUserAuthorizationSuccessResponseBase.cs @@ -8,11 +8,11 @@ namespace DotNetOpenAuth.OAuth2.Messages { using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; - using System.Diagnostics.Contracts; using System.Security.Cryptography; using DotNetOpenAuth.Messaging; using DotNetOpenAuth.OAuth2.ChannelElements; + using Validation; /// <summary> /// The message sent by the Authorization Server to the Client via the user agent diff --git a/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/TokenEndpointProtocolException.cs b/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/TokenEndpointProtocolException.cs index e86c27e..d18e788 100644 --- a/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/TokenEndpointProtocolException.cs +++ b/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/TokenEndpointProtocolException.cs @@ -13,6 +13,7 @@ namespace DotNetOpenAuth.OAuth2 { using DotNetOpenAuth.Messaging; using DotNetOpenAuth.OAuth2.Messages; + using Validation; /// <summary> /// Describes an error generated by an Authorization Server's token endpoint. |