summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/DotNetOAuth.Test/Mocks/TestMessage.cs4
-rw-r--r--src/DotNetOAuth/ClassDiagram.cd42
-rw-r--r--src/DotNetOAuth/DotNetOAuth.csproj2
-rw-r--r--src/DotNetOAuth/IProtocolMessage.cs4
-rw-r--r--src/DotNetOAuth/IProtocolMessageRequest.cs19
-rw-r--r--src/DotNetOAuth/MessageScheme.cs2
-rw-r--r--src/DotNetOAuth/MessageTransport.cs20
7 files changed, 72 insertions, 21 deletions
diff --git a/src/DotNetOAuth.Test/Mocks/TestMessage.cs b/src/DotNetOAuth.Test/Mocks/TestMessage.cs
index fb9a30c..6fbac65 100644
--- a/src/DotNetOAuth.Test/Mocks/TestMessage.cs
+++ b/src/DotNetOAuth.Test/Mocks/TestMessage.cs
@@ -21,6 +21,10 @@ namespace DotNetOAuth.Test.Mocks {
}
}
+ MessageTransport IProtocolMessage.Transport {
+ get { return MessageTransport.Direct; }
+ }
+
#endregion
}
}
diff --git a/src/DotNetOAuth/ClassDiagram.cd b/src/DotNetOAuth/ClassDiagram.cd
index 4d68730..1219a22 100644
--- a/src/DotNetOAuth/ClassDiagram.cd
+++ b/src/DotNetOAuth/ClassDiagram.cd
@@ -8,59 +8,54 @@
</TypeIdentifier>
</Class>
<Class Name="DotNetOAuth.Consumer">
- <Position X="2.75" Y="0.5" Width="1.5" />
+ <Position X="2.75" Y="0.5" Width="1.75" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Consumer.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="DotNetOAuth.DirectMessageChannel">
- <Position X="5.75" Y="2" Width="2" />
+ <Position X="5" Y="2.75" Width="2" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>DirectMessageChannel.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="DotNetOAuth.IndirectMessageEncoder">
- <Position X="5.75" Y="3.25" Width="2" />
+ <Position X="5" Y="4" Width="2" />
<TypeIdentifier>
<HashCode>AAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>IndirectMessageEncoder.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="DotNetOAuth.IndirectMessage" Collapsed="true">
- <Position X="5.75" Y="4.5" Width="2" />
+ <Position X="5" Y="5.25" Width="2" />
<TypeIdentifier>
<HashCode>AAAAAAAEAABAAAAAAEABAAAACAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>IndirectMessage.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="DotNetOAuth.ProtocolMessageSerializer&lt;T&gt;">
- <Position X="6" Y="0.5" Width="1.5" />
- <NestedTypes>
- <Class Name="DotNetOAuth.ProtocolMessageSerializer&lt;T&gt;.PseudoXmlWriter" Collapsed="true">
- <TypeIdentifier>
- <NewMemberFileName>ProtocolMessageSerializer.cs</NewMemberFileName>
- </TypeIdentifier>
- </Class>
- <Class Name="DotNetOAuth.ProtocolMessageSerializer&lt;T&gt;.PseudoXmlReader" Collapsed="true">
- <TypeIdentifier>
- <NewMemberFileName>ProtocolMessageSerializer.cs</NewMemberFileName>
- </TypeIdentifier>
- </Class>
- </NestedTypes>
+ <Position X="5" Y="0.5" Width="2.25" />
<TypeIdentifier>
- <HashCode>AAAAAAAAIAAAAAAAAAAAAAAAACBAAAAAAAAAAAAAAAA=</HashCode>
+ <HashCode>AAAAAAAAIAAAAAAAAAAAAAAEACBAAAAAAAAAAAAAAAA=</HashCode>
<FileName>ProtocolMessageSerializer.cs</FileName>
</TypeIdentifier>
</Class>
<Interface Name="DotNetOAuth.IProtocolMessage">
- <Position X="2.75" Y="1.5" Width="1.5" />
+ <Position X="2.75" Y="1.5" Width="1.75" />
<TypeIdentifier>
- <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
+ <HashCode>AAAAAAAAQAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>IProtocolMessage.cs</FileName>
</TypeIdentifier>
</Interface>
+ <Interface Name="DotNetOAuth.IProtocolMessageRequest">
+ <Position X="2.75" Y="3.25" Width="1.75" />
+ <TypeIdentifier>
+ <HashCode>AAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
+ <FileName>IProtocolMessageRequest.cs</FileName>
+ </TypeIdentifier>
+ </Interface>
<Enum Name="DotNetOAuth.MessageScheme">
<Position X="0.5" Y="2.75" Width="2" />
<TypeIdentifier>
@@ -68,5 +63,12 @@
<FileName>MessageScheme.cs</FileName>
</TypeIdentifier>
</Enum>
+ <Enum Name="DotNetOAuth.MessageTransport">
+ <Position X="0.5" Y="4.5" Width="1.75" />
+ <TypeIdentifier>
+ <HashCode>AAACAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
+ <FileName>MessageTransport.cs</FileName>
+ </TypeIdentifier>
+ </Enum>
<Font Name="Segoe UI" Size="9" />
</ClassDiagram> \ No newline at end of file
diff --git a/src/DotNetOAuth/DotNetOAuth.csproj b/src/DotNetOAuth/DotNetOAuth.csproj
index dc4b104..d8de8ba 100644
--- a/src/DotNetOAuth/DotNetOAuth.csproj
+++ b/src/DotNetOAuth/DotNetOAuth.csproj
@@ -70,6 +70,7 @@
<Compile Include="DictionaryXmlReader.cs" />
<Compile Include="DictionaryXmlWriter.cs" />
<Compile Include="DirectMessageChannel.cs" />
+ <Compile Include="IProtocolMessageRequest.cs" />
<Compile Include="IndirectMessage.cs" />
<Compile Include="IndirectMessageEncoder.cs" />
<Compile Include="IProtocolMessage.cs" />
@@ -79,6 +80,7 @@
<Compile Include="Loggers\NoOpLogger.cs" />
<Compile Include="Loggers\TraceLogger.cs" />
<Compile Include="MessageScheme.cs" />
+ <Compile Include="MessageTransport.cs" />
<Compile Include="ProtocolException.cs" />
<Compile Include="ProtocolMessageSerializer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
diff --git a/src/DotNetOAuth/IProtocolMessage.cs b/src/DotNetOAuth/IProtocolMessage.cs
index 4dd31ae..fb1ef96 100644
--- a/src/DotNetOAuth/IProtocolMessage.cs
+++ b/src/DotNetOAuth/IProtocolMessage.cs
@@ -9,6 +9,10 @@ namespace DotNetOAuth {
/// </summary>
interface IProtocolMessage {
/// <summary>
+ /// Gets whether this is a direct or indirect message.
+ /// </summary>
+ MessageTransport Transport { get; }
+ /// <summary>
/// Checks the message state for conformity to the protocol specification
/// and throws an exception if the message is invalid.
/// </summary>
diff --git a/src/DotNetOAuth/IProtocolMessageRequest.cs b/src/DotNetOAuth/IProtocolMessageRequest.cs
new file mode 100644
index 0000000..655c3df
--- /dev/null
+++ b/src/DotNetOAuth/IProtocolMessageRequest.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace DotNetOAuth {
+ /// <summary>
+ /// Implemented by messages that are sent as requests.
+ /// </summary>
+ public interface IProtocolMessageRequest : IProtocolMessage {
+ /// <summary>
+ /// The URL of the intended receiver of this message.
+ /// </summary>
+ Uri Recipient {
+ get;
+ set;
+ }
+ }
+}
diff --git a/src/DotNetOAuth/MessageScheme.cs b/src/DotNetOAuth/MessageScheme.cs
index ab42f28..282194f 100644
--- a/src/DotNetOAuth/MessageScheme.cs
+++ b/src/DotNetOAuth/MessageScheme.cs
@@ -4,7 +4,7 @@ using System.Text;
namespace DotNetOAuth {
/// <summary>
- /// The methods available for the Consumer to send messages to the Service Provider.
+ /// The methods available for the Consumer to send direct messages to the Service Provider.
/// </summary>
/// <remarks>
/// See 1.0 spec section 5.2.
diff --git a/src/DotNetOAuth/MessageTransport.cs b/src/DotNetOAuth/MessageTransport.cs
new file mode 100644
index 0000000..4097cba
--- /dev/null
+++ b/src/DotNetOAuth/MessageTransport.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace DotNetOAuth {
+ /// <summary>
+ /// The type of transport mechanism used for a message: either direct or indirect.
+ /// </summary>
+ public enum MessageTransport {
+ /// <summary>
+ /// A message that is sent directly from the Consumer to the Service Provider, or vice versa.
+ /// </summary>
+ Direct,
+ /// <summary>
+ /// A message that is sent from one party to another via a redirect in the user agent.
+ /// </summary>
+ Indirect,
+ }
+}