summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Core.Portable/Messaging
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.Core.Portable/Messaging')
-rw-r--r--src/DotNetOpenAuth.Core.Portable/Messaging/Bindings/INonceStore.cs3
-rw-r--r--src/DotNetOpenAuth.Core.Portable/Messaging/Bindings/MemoryCryptoKeyAndNonceStore.cs2
-rw-r--r--src/DotNetOpenAuth.Core.Portable/Messaging/Bindings/MemoryNonceStore.cs2
-rw-r--r--src/DotNetOpenAuth.Core.Portable/Messaging/ChannelBase.cs44
-rw-r--r--src/DotNetOpenAuth.Core.Portable/Messaging/IMessageWithEvents.cs2
5 files changed, 42 insertions, 11 deletions
diff --git a/src/DotNetOpenAuth.Core.Portable/Messaging/Bindings/INonceStore.cs b/src/DotNetOpenAuth.Core.Portable/Messaging/Bindings/INonceStore.cs
index 3ce521d..ed3d145 100644
--- a/src/DotNetOpenAuth.Core.Portable/Messaging/Bindings/INonceStore.cs
+++ b/src/DotNetOpenAuth.Core.Portable/Messaging/Bindings/INonceStore.cs
@@ -30,8 +30,7 @@ namespace DotNetOpenAuth.Messaging.Bindings {
/// The nonce must be stored for no less than the maximum time window a message may
/// be processed within before being discarded as an expired message.
/// This maximum message age can be looked up via the
- /// <see cref="DotNetOpenAuth.Configuration.MessagingElement.MaximumMessageLifetime"/>
- /// property, accessible via the <see cref="DotNetOpenAuth.Configuration.MessagingElement.Configuration"/>
+ /// <see cref="ChannelBase.MaximumMessageLifetime"/>
/// property.
/// </remarks>
bool StoreNonce(string context, string nonce, DateTime timestampUtc);
diff --git a/src/DotNetOpenAuth.Core.Portable/Messaging/Bindings/MemoryCryptoKeyAndNonceStore.cs b/src/DotNetOpenAuth.Core.Portable/Messaging/Bindings/MemoryCryptoKeyAndNonceStore.cs
index f486c72..d2c1889 100644
--- a/src/DotNetOpenAuth.Core.Portable/Messaging/Bindings/MemoryCryptoKeyAndNonceStore.cs
+++ b/src/DotNetOpenAuth.Core.Portable/Messaging/Bindings/MemoryCryptoKeyAndNonceStore.cs
@@ -66,7 +66,7 @@ namespace DotNetOpenAuth.Messaging.Bindings {
/// be processed within before being discarded as an expired message.
/// If the binding element is applicable to your channel, this expiration window
/// is retrieved or set using the
- /// <see cref="StandardExpirationBindingElement.MaximumMessageAge"/> property.
+ /// <see cref="ChannelBase.MaximumMessageLifetime"/> property.
/// </remarks>
public bool StoreNonce(string context, string nonce, DateTime timestampUtc) {
return this.nonceStore.StoreNonce(context, nonce, timestampUtc);
diff --git a/src/DotNetOpenAuth.Core.Portable/Messaging/Bindings/MemoryNonceStore.cs b/src/DotNetOpenAuth.Core.Portable/Messaging/Bindings/MemoryNonceStore.cs
index c1d5fb8..3faffc9 100644
--- a/src/DotNetOpenAuth.Core.Portable/Messaging/Bindings/MemoryNonceStore.cs
+++ b/src/DotNetOpenAuth.Core.Portable/Messaging/Bindings/MemoryNonceStore.cs
@@ -68,7 +68,7 @@ namespace DotNetOpenAuth.Messaging.Bindings {
/// be processed within before being discarded as an expired message.
/// If the binding element is applicable to your channel, this expiration window
/// is retrieved or set using the
- /// <see cref="StandardExpirationBindingElement.MaximumMessageAge"/> property.
+ /// <see cref="ChannelBase.MaximumMessageLifetime"/> property.
/// </remarks>
public bool StoreNonce(string context, string nonce, DateTime timestamp) {
if (timestamp.ToUniversalTimeSafe() + this.MaximumMessageAge < DateTime.UtcNow) {
diff --git a/src/DotNetOpenAuth.Core.Portable/Messaging/ChannelBase.cs b/src/DotNetOpenAuth.Core.Portable/Messaging/ChannelBase.cs
index fcc27dd..c33cfbf 100644
--- a/src/DotNetOpenAuth.Core.Portable/Messaging/ChannelBase.cs
+++ b/src/DotNetOpenAuth.Core.Portable/Messaging/ChannelBase.cs
@@ -1,5 +1,5 @@
//-----------------------------------------------------------------------
-// <copyright file="Channel.cs" company="Outercurve Foundation">
+// <copyright file="ChannelBase.cs" company="Outercurve Foundation">
// Copyright (c) Outercurve Foundation. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
@@ -131,7 +131,7 @@ namespace DotNetOpenAuth.Messaging {
private int maximumIndirectMessageUrlLength;
/// <summary>
- /// Initializes a new instance of the <see cref="Channel" /> class.
+ /// Initializes a new instance of the <see cref="ChannelBase" /> class.
/// </summary>
/// <param name="messageTypeProvider">A class prepared to analyze incoming messages and indicate what concrete
/// message types can deserialize from it.</param>
@@ -185,6 +185,12 @@ namespace DotNetOpenAuth.Messaging {
}
}
+ /// <summary>
+ /// Gets or sets the maximum clock skew allowed.
+ /// </summary>
+ /// <value>
+ /// The maximum clock skew.
+ /// </value>
public TimeSpan MaximumClockSkew { get; set; }
/// <summary>
@@ -197,6 +203,12 @@ namespace DotNetOpenAuth.Messaging {
get { return this.MaximumMessageLifetimeNoSkew + this.MaximumClockSkew; }
}
+ /// <summary>
+ /// Gets or sets the maximum message lifetime without taking clock skew into account.
+ /// </summary>
+ /// <value>
+ /// The maximum message lifetime no skew.
+ /// </value>
public TimeSpan MaximumMessageLifetimeNoSkew { get; set; }
/// <summary>
@@ -349,7 +361,6 @@ namespace DotNetOpenAuth.Messaging {
/// <returns>
/// True if the expected message was recognized and deserialized. False otherwise.
/// </returns>
- /// <exception cref="InvalidOperationException">Thrown when <see cref="HttpContext.Current" /> is null.</exception>
/// <exception cref="ProtocolException">Thrown when a request message of an unexpected type is received.</exception>
public async Task<TRequest> TryReadFromRequestAsync<TRequest>(HttpRequestMessage httpRequest, CancellationToken cancellationToken)
where TRequest : class, IProtocolMessage {
@@ -906,7 +917,7 @@ namespace DotNetOpenAuth.Messaging {
/// <param name="request">The message to send.</param>
/// <returns>The <see cref="HttpWebRequest"/> prepared to send the request.</returns>
/// <remarks>
- /// This method must be overridden by a derived class, unless the <see cref="Channel.RequestCoreAsync"/> method
+ /// This method must be overridden by a derived class, unless the <see cref="RequestCoreAsync"/> method
/// is overridden and does not require this method.
/// </remarks>
protected virtual HttpRequestMessage CreateHttpRequest(IDirectedProtocolMessage request) {
@@ -1308,10 +1319,31 @@ namespace DotNetOpenAuth.Messaging {
/// Puts binding elements in their correct outgoing message processing order.
/// </summary>
private class BindingElementOutgoingMessageApplicationOrder : IComparer<MessageProtections> {
- private BindingElementOutgoingMessageApplicationOrder() { }
-
+ /// <summary>
+ /// Gets the singleton instance.
+ /// </summary>
internal static readonly IComparer<MessageProtections> Default = new BindingElementOutgoingMessageApplicationOrder();
+ /// <summary>
+ /// Prevents a default instance of the <see cref="BindingElementOutgoingMessageApplicationOrder"/> class from being created.
+ /// </summary>
+ private BindingElementOutgoingMessageApplicationOrder() { }
+
+ /// <summary>
+ /// Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other.
+ /// </summary>
+ /// <param name="x">The first object to compare.</param>
+ /// <param name="y">The second object to compare.</param>
+ /// <returns>
+ /// Value
+ /// Condition
+ /// Less than zero
+ /// <paramref name="x" /> is less than <paramref name="y" />.
+ /// Zero
+ /// <paramref name="x" /> equals <paramref name="y" />.
+ /// Greater than zero
+ /// <paramref name="x" /> is greater than <paramref name="y" />.
+ /// </returns>
public int Compare(MessageProtections x, MessageProtections y) {
ErrorUtilities.VerifyInternal(x != MessageProtections.None || y != MessageProtections.None, "This comparison function should only be used to compare protection binding elements. Otherwise we change the order of user-defined message transformations.");
diff --git a/src/DotNetOpenAuth.Core.Portable/Messaging/IMessageWithEvents.cs b/src/DotNetOpenAuth.Core.Portable/Messaging/IMessageWithEvents.cs
index 965b074..59c5cfa 100644
--- a/src/DotNetOpenAuth.Core.Portable/Messaging/IMessageWithEvents.cs
+++ b/src/DotNetOpenAuth.Core.Portable/Messaging/IMessageWithEvents.cs
@@ -7,7 +7,7 @@
namespace DotNetOpenAuth.Messaging {
/// <summary>
/// An interface that messages wishing to perform custom serialization/deserialization
- /// may implement to be notified of <see cref="Channel"/> events.
+ /// may implement to be notified of <see cref="ChannelBase"/> events.
/// </summary>
internal interface IMessageWithEvents : IMessage {
/// <summary>