diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2008-11-03 17:22:00 -0800 |
---|---|---|
committer | Andrew <andrewarnott@gmail.com> | 2008-11-04 08:12:52 -0800 |
commit | 462e19abd9034c11a12cad30e9899740f2bef8ff (patch) | |
tree | e08667f1d69249f8daa6c348a919bd0fd5434415 /src/DotNetOAuth/OAuth/ChannelElements/OAuthHttpMethodBindingElement.cs | |
parent | 6a79be0eca3929d8fb4e797799dac8d6f7875475 (diff) | |
download | DotNetOpenAuth-462e19abd9034c11a12cad30e9899740f2bef8ff.zip DotNetOpenAuth-462e19abd9034c11a12cad30e9899740f2bef8ff.tar.gz DotNetOpenAuth-462e19abd9034c11a12cad30e9899740f2bef8ff.tar.bz2 |
Changed namepace and project names in preparation for merge with DotNetOpenId.
Diffstat (limited to 'src/DotNetOAuth/OAuth/ChannelElements/OAuthHttpMethodBindingElement.cs')
-rw-r--r-- | src/DotNetOAuth/OAuth/ChannelElements/OAuthHttpMethodBindingElement.cs | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/src/DotNetOAuth/OAuth/ChannelElements/OAuthHttpMethodBindingElement.cs b/src/DotNetOAuth/OAuth/ChannelElements/OAuthHttpMethodBindingElement.cs deleted file mode 100644 index e026c02..0000000 --- a/src/DotNetOAuth/OAuth/ChannelElements/OAuthHttpMethodBindingElement.cs +++ /dev/null @@ -1,73 +0,0 @@ -//-----------------------------------------------------------------------
-// <copyright file="OAuthHttpMethodBindingElement.cs" company="Andrew Arnott">
-// Copyright (c) Andrew Arnott. All rights reserved.
-// </copyright>
-//-----------------------------------------------------------------------
-
-namespace DotNetOAuth.OAuth.ChannelElements {
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using DotNetOAuth.Messaging;
-
- /// <summary>
- /// Sets the HTTP Method property on a signed message before the signing module gets to it.
- /// </summary>
- internal class OAuthHttpMethodBindingElement : IChannelBindingElement {
- #region IChannelBindingElement Members
-
- /// <summary>
- /// Gets the protection offered (if any) by this binding element.
- /// </summary>
- public MessageProtections Protection {
- get { return MessageProtections.None; }
- }
-
- /// <summary>
- /// Prepares a message for sending based on the rules of this channel binding element.
- /// </summary>
- /// <param name="message">The message to prepare for sending.</param>
- /// <returns>
- /// True if the <paramref name="message"/> applied to this binding element
- /// and the operation was successful. False otherwise.
- /// </returns>
- public bool PrepareMessageForSending(IProtocolMessage message) {
- var oauthMessage = message as ITamperResistantOAuthMessage;
-
- if (oauthMessage != null) {
- HttpDeliveryMethods transmissionMethod = oauthMessage.HttpMethods;
- if ((transmissionMethod & HttpDeliveryMethods.PostRequest) != 0) {
- oauthMessage.HttpMethod = "POST";
- } else if ((transmissionMethod & HttpDeliveryMethods.GetRequest) != 0) {
- oauthMessage.HttpMethod = "GET";
- } else {
- return false;
- }
-
- return true;
- } else {
- return false;
- }
- }
-
- /// <summary>
- /// Performs any transformation on an incoming message that may be necessary and/or
- /// validates an incoming message based on the rules of this channel binding element.
- /// </summary>
- /// <param name="message">The incoming message to process.</param>
- /// <returns>
- /// True if the <paramref name="message"/> applied to this binding element
- /// and the operation was successful. False if the operation did not apply to this message.
- /// </returns>
- /// <exception cref="ProtocolException">
- /// Thrown when the binding element rules indicate that this message is invalid and should
- /// NOT be processed.
- /// </exception>
- public bool PrepareMessageForReceiving(IProtocolMessage message) {
- return false;
- }
-
- #endregion
- }
-}
|