Permalink
Browse files

Lots of StyleCop fixes.

  • Loading branch information...
1 parent 3d37ff4 commit b9ae2ab289e2b9708ea3cce055ac484b00246a8a @AArnott AArnott committed Mar 26, 2013
Showing with 314 additions and 260 deletions.
  1. +2 −2 samples/DotNetOpenAuth.ApplicationBlock/TwitterConsumer.cs
  2. +1 −3 samples/OAuthClient/WindowsLive.aspx.cs
  3. +1 −1 samples/OAuthConsumerWpf/MainWindow.xaml.cs
  4. +4 −4 samples/OAuthServiceProvider/Code/Global.cs
  5. +8 −4 samples/OpenIdOfflineProvider/MainWindow.xaml.cs
  6. +1 −6 samples/OpenIdOfflineProvider/Settings.StyleCop
  7. +1 −2 samples/OpenIdWebRingSsoRelyingParty/Login.aspx.cs
  8. +1 −1 src/DotNetOpenAuth.AspNet.Test/OAuth2ClientTest.cs
  9. +3 −3 src/DotNetOpenAuth.AspNet.Test/OAuthClientTest.cs
  10. +1 −1 src/DotNetOpenAuth.AspNet/AuthenticationResult.cs
  11. +7 −8 src/DotNetOpenAuth.AspNet/Clients/OAuth/DotNetOpenAuthWebConsumer.cs
  12. +2 −0 src/DotNetOpenAuth.AspNet/Clients/OAuth/IOAuthWebWorker.cs
  13. +1 −1 src/DotNetOpenAuth.AspNet/Clients/OAuth/LinkedInClient.cs
  14. +6 −11 src/DotNetOpenAuth.AspNet/Clients/OAuth/OAuthClient.cs
  15. +1 −1 src/DotNetOpenAuth.AspNet/Clients/OAuth/TwitterClient.cs
  16. +1 −1 src/DotNetOpenAuth.AspNet/Clients/OAuth2/FacebookClient.cs
  17. +1 −1 src/DotNetOpenAuth.AspNet/Clients/OAuth2/MicrosoftClient.cs
  18. +1 −3 src/DotNetOpenAuth.AspNet/Clients/OAuth2/OAuth2Client.cs
  19. +1 −1 src/DotNetOpenAuth.AspNet/Clients/OpenID/GoogleOpenIdClient.cs
  20. +1 −1 src/DotNetOpenAuth.AspNet/Clients/OpenID/OpenIDClient.cs
  21. +1 −1 src/DotNetOpenAuth.AspNet/Clients/OpenID/YahooOpenIdClient.cs
  22. +4 −4 src/DotNetOpenAuth.Core/Messaging/Bindings/HardCodedKeyCryptoKeyStore.cs
  23. +22 −7 src/DotNetOpenAuth.Core/Messaging/Channel.cs
  24. +1 −1 src/DotNetOpenAuth.Core/Messaging/HttpRequestInfo.cs
  25. +7 −1 src/DotNetOpenAuth.Core/Messaging/HttpResponseMessageWithOriginal.cs
  26. +18 −0 src/DotNetOpenAuth.OAuth.Consumer/OAuth/AccessTokenResponse.cs
  27. +3 −3 src/DotNetOpenAuth.OAuth.Consumer/OAuth/Consumer.cs
  28. +2 −3 src/DotNetOpenAuth.OAuth.Consumer/OAuth/CookieTemporaryCredentialStorage.cs
  29. +0 −1 src/DotNetOpenAuth.OAuth.Consumer/OAuth/MemoryTemporaryCredentialStorage.cs
  30. +1 −1 src/DotNetOpenAuth.OAuth.Consumer/OAuth/OAuth1HttpMessageHandlerBase.cs
  31. +2 −2 src/DotNetOpenAuth.OAuth.Consumer/OAuth/ServiceProviderDescription.cs
  32. +0 −1 src/DotNetOpenAuth.OAuth/DotNetOpenAuth.OAuth.csproj
  33. +1 −0 src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/OAuthChannel.cs
  34. +0 −10 src/DotNetOpenAuth.OAuth/OAuth/Messages/MessageBaseSimple.cs
  35. +4 −1 src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/AuthorizationServer.cs
  36. +2 −0 ...NetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/OAuth2AuthorizationServerChannel.cs
  37. +2 −2 src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ClientDescription.cs
  38. +1 −0 src/DotNetOpenAuth.OAuth2.Client/OAuth2/ChannelElements/OAuth2ClientChannel.cs
  39. +4 −5 src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientBase.cs
  40. +12 −12 src/DotNetOpenAuth.OAuth2.Client/OAuth2/UserAgentClient.cs
  41. +1 −1 src/DotNetOpenAuth.OAuth2.Client/OAuth2/WebServerClient.cs
  42. +6 −1 src/DotNetOpenAuth.OAuth2.ResourceServer/OAuth2/ChannelElements/OAuth2ResourceServerChannel.cs
  43. +1 −1 src/DotNetOpenAuth.OAuth2.ResourceServer/OAuth2/ResourceServer.cs
  44. +8 −1 src/DotNetOpenAuth.OAuth2.ResourceServer/OAuth2/StandardAccessTokenAnalyzer.cs
  45. +4 −1 src/DotNetOpenAuth.OAuth2/OAuth2/AccessToken.cs
  46. +15 −15 src/DotNetOpenAuth.OpenId.Provider.UI/OpenId/Provider/ProviderEndpoint.cs
  47. +4 −1 src/DotNetOpenAuth.OpenId.Provider/OpenId/Provider/AutoResponsiveRequest.cs
  48. +1 −1 src/DotNetOpenAuth.OpenId.Provider/OpenId/Provider/HostProcessedRequest.cs
  49. +2 −1 src/DotNetOpenAuth.OpenId.Provider/OpenId/Provider/OpenIdProvider.cs
  50. +3 −2 src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/OpenIdRelyingParty.cs
  51. +4 −1 src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/KeyValueFormEncoding.cs
  52. +4 −4 src/DotNetOpenAuth.OpenId/OpenId/UntrustedWebRequestHandler.cs
  53. +1 −1 src/DotNetOpenAuth.OpenId/Yadis/Yadis.cs
  54. +0 −6 src/DotNetOpenAuth.OpenIdOAuth/OAuth/WebConsumerOpenIdRelyingParty.cs
  55. +31 −31 src/DotNetOpenAuth.Test/Messaging/MessagingTestBase.cs
  56. +2 −4 src/DotNetOpenAuth.Test/MockingHostFactories.cs
  57. +3 −3 src/DotNetOpenAuth.Test/OAuth2/WebServerClientAuthorizeTests.cs
  58. +2 −3 src/DotNetOpenAuth.Test/OpenId/ChannelElements/ExtensionsBindingElementTests.cs
  59. +1 −2 src/DotNetOpenAuth.Test/OpenId/NonIdentityTests.cs
  60. +66 −66 src/DotNetOpenAuth.Test/OpenId/OpenIdTestBase.cs
  61. +21 −1 src/DotNetOpenAuth.Test/Settings.StyleCop
  62. +2 −3 src/DotNetOpenAuth.Test/TestBase.cs
@@ -154,7 +154,7 @@ public TwitterConsumer(string consumerKey, string consumerSecret)
}
public async Task<JArray> GetUpdatesAsync(AccessToken accessToken, CancellationToken cancellationToken = default(CancellationToken)) {
- if (String.IsNullOrEmpty(accessToken.Token)) {
+ if (string.IsNullOrEmpty(accessToken.Token)) {
throw new ArgumentNullException("accessToken.Token");
}
@@ -169,7 +169,7 @@ public TwitterConsumer(string consumerKey, string consumerSecret)
}
public async Task<XDocument> GetFavorites(AccessToken accessToken, CancellationToken cancellationToken = default(CancellationToken)) {
- if (String.IsNullOrEmpty(accessToken.Token)) {
+ if (string.IsNullOrEmpty(accessToken.Token)) {
throw new ArgumentNullException("accessToken.Token");
}
@@ -33,9 +33,7 @@ public partial class WindowsLive : System.Web.UI.Page {
await client.ProcessUserAuthorizationAsync(new HttpRequestWrapper(Request), Response.ClientDisconnectedToken);
if (authorization == null) {
// Kick off authorization request
- var request =
- await client.PrepareRequestUserAuthorizationAsync(scopes: new[] { WindowsLiveClient.Scopes.Basic });
- // this scope isn't even required just to log in
+ var request = await client.PrepareRequestUserAuthorizationAsync(scopes: new[] { WindowsLiveClient.Scopes.Basic }); // this scope isn't even required just to log in
await request.SendAsync(new HttpContextWrapper(this.Context), Response.ClientDisconnectedToken);
this.Context.Response.End();
} else {
@@ -176,7 +176,7 @@ public partial class MainWindow : Window {
authorizePopup.Authorization.Scope.AddRange(OAuthUtilities.SplitScopes(this.oauth2ScopeBox.Text));
authorizePopup.Authorization.Callback = new Uri("http://www.microsoft.com/en-us/default.aspx");
authorizePopup.Owner = this;
- authorizePopup.ClientAuthorizationView.RequestImplicitGrant = flowBox.SelectedIndex == 1;
+ authorizePopup.ClientAuthorizationView.RequestImplicitGrant = this.flowBox.SelectedIndex == 1;
bool? result = authorizePopup.ShowDialog();
if (result.HasValue && result.Value) {
var request = new HttpRequestMessage(
@@ -10,10 +10,6 @@
/// The web application global events and properties.
/// </summary>
public class Global : HttpApplication {
- private readonly object syncObject = new object();
-
- private volatile bool initialized;
-
/// <summary>
/// An application memory cache of recent log messages.
/// </summary>
@@ -24,6 +20,10 @@ public class Global : HttpApplication {
/// </summary>
public static log4net.ILog Logger = log4net.LogManager.GetLogger("DotNetOpenAuth.OAuthServiceProvider");
+ private readonly object syncObject = new object();
+
+ private volatile bool initialized;
+
/// <summary>
/// Gets the transaction-protected database connection for the current request.
/// </summary>
@@ -20,6 +20,7 @@ namespace DotNetOpenAuth.OpenIdOfflineProvider {
using System.Threading;
using System.Threading.Tasks;
using System.Web;
+ using System.Web.Http;
using System.Web.Http.Routing;
using System.Web.Http.SelfHost;
using System.Windows;
@@ -39,13 +40,16 @@ namespace DotNetOpenAuth.OpenIdOfflineProvider {
using log4net.Core;
using Validation;
- using System.Web.Http;
-
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window, IDisposable {
/// <summary>
+ /// The main window for the app.
+ /// </summary>
+ internal static MainWindow Instance;
+
+ /// <summary>
/// The logger the application may use.
/// </summary>
private ILog logger = log4net.LogManager.GetLogger(typeof(MainWindow));
@@ -69,8 +73,6 @@ public partial class MainWindow : Window, IDisposable {
this.StartProviderAsync();
}
- internal static MainWindow Instance;
-
#region IDisposable Members
/// <summary>
@@ -155,6 +157,7 @@ public partial class MainWindow : Window, IDisposable {
/// <summary>
/// Starts the provider.
/// </summary>
+ /// <returns>A task that completes when the asynchronous operation is finished.</returns>
private async Task StartProviderAsync() {
Exception exception = null;
try {
@@ -199,6 +202,7 @@ public partial class MainWindow : Window, IDisposable {
/// <summary>
/// Stops the provider.
/// </summary>
+ /// <returns>A task that completes when the asynchronous operation is finished.</returns>
private async Task StopProviderAsync() {
if (this.hostServer != null) {
await this.hostServer.CloseAsync();
@@ -1,4 +1,4 @@
-<StyleCopSettings Version="4.3">
+<StyleCopSettings Version="105">
<Analyzers>
<Analyzer AnalyzerId="StyleCop.CSharp.DocumentationRules">
<Rules>
@@ -7,11 +7,6 @@
<BooleanProperty Name="Enabled">True</BooleanProperty>
</RuleSettings>
</Rule>
- <Rule Name="ElementsMustBeDocumented">
- <RuleSettings>
- <BooleanProperty Name="Enabled">True</BooleanProperty>
- </RuleSettings>
- </Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
@@ -80,8 +80,7 @@ public partial class Login : System.Web.UI.Page {
response.ClaimedIdentifier,
DateTime.Now,
DateTime.Now.AddMinutes(TimeoutInMinutes),
- false,
- // non-persistent, since login is automatic and we wanted updated roles
+ false, // non-persistent, since login is automatic and we wanted updated roles
string.Join(";", roles.ToArray()));
HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(ticket));
@@ -8,11 +8,11 @@ namespace DotNetOpenAuth.AspNet.Test {
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
+ using System.Threading.Tasks;
using System.Web;
using DotNetOpenAuth.AspNet.Clients;
using Moq;
using NUnit.Framework;
- using System.Threading.Tasks;
[TestFixture]
public class OAuth2ClientTest {
@@ -7,16 +7,16 @@
namespace DotNetOpenAuth.AspNet.Test {
using System;
using System.Collections.Specialized;
+ using System.Threading;
+ using System.Threading.Tasks;
using System.Web;
using DotNetOpenAuth.AspNet;
using DotNetOpenAuth.AspNet.Clients;
using DotNetOpenAuth.Messaging;
+ using DotNetOpenAuth.OAuth;
using DotNetOpenAuth.OAuth.Messages;
using Moq;
using NUnit.Framework;
- using DotNetOpenAuth.OAuth;
- using System.Threading;
- using System.Threading.Tasks;
[TestFixture]
public class OAuthClientTest {
@@ -7,9 +7,9 @@
namespace DotNetOpenAuth.AspNet {
using System;
using System.Collections.Generic;
+ using System.Collections.Specialized;
using System.Diagnostics.CodeAnalysis;
using DotNetOpenAuth.Messaging;
- using System.Collections.Specialized;
/// <summary>
/// Represents the result of OAuth or OpenID authentication.
@@ -34,14 +34,11 @@ public class DotNetOpenAuthWebConsumer : IOAuthWebWorker {
#region Constructors and Destructors
/// <summary>
- /// Initializes a new instance of the <see cref="DotNetOpenAuthWebConsumer"/> class.
+ /// Initializes a new instance of the <see cref="DotNetOpenAuthWebConsumer" /> class.
/// </summary>
- /// <param name="serviceDescription">
- /// The service description.
- /// </param>
- /// <param name="tokenManager">
- /// The token manager.
- /// </param>
+ /// <param name="serviceDescription">The service description.</param>
+ /// <param name="consumerKey">The consumer key.</param>
+ /// <param name="consumerSecret">The consumer secret.</param>
public DotNetOpenAuthWebConsumer(ServiceProviderDescription serviceDescription, string consumerKey, string consumerSecret) {
Requires.NotNull(serviceDescription, "serviceDescription");
@@ -56,7 +53,7 @@ public class DotNetOpenAuthWebConsumer : IOAuthWebWorker {
#endregion
/// <summary>
- /// Gets the DotNetOpenAuth <see cref="WebConsumer"/> instance that can be used to make OAuth 1.0 authorized HTTP requests.
+ /// Gets the DotNetOpenAuth <see cref="Consumer"/> instance that can be used to make OAuth 1.0 authorized HTTP requests.
/// </summary>
public Consumer Consumer {
get { return this.webConsumer; }
@@ -68,6 +65,7 @@ public class DotNetOpenAuthWebConsumer : IOAuthWebWorker {
/// Creates an HTTP message handler that authorizes outgoing web requests.
/// </summary>
/// <param name="accessToken">The access token.</param>
+ /// <returns>An <see cref="HttpMessageHandler"/> that applies the access token to all outgoing requests.</returns>
public HttpMessageHandler CreateMessageHandler(AccessToken accessToken) {
Requires.NotNullOrEmpty(accessToken.Token, "accessToken");
@@ -77,6 +75,7 @@ public class DotNetOpenAuthWebConsumer : IOAuthWebWorker {
/// <summary>
/// The process user authorization.
/// </summary>
+ /// <param name="context">The HTTP context.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>
/// The response message.
@@ -23,11 +23,13 @@ public interface IOAuthWebWorker {
/// Creates an HTTP message handler that authorizes outgoing web requests.
/// </summary>
/// <param name="accessToken">The access token.</param>
+ /// <returns>An <see cref="HttpMessageHandler"/> that applies the access token to all outgoing requests.</returns>
HttpMessageHandler CreateMessageHandler(AccessToken accessToken);
/// <summary>
/// The process user authorization.
/// </summary>
+ /// <param name="context">The HTTP context.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>
/// The access token, if obtained; otherwise <c>null</c>.
@@ -7,6 +7,7 @@
namespace DotNetOpenAuth.AspNet.Clients {
using System;
using System.Collections.Generic;
+ using System.Collections.Specialized;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Net;
@@ -18,7 +19,6 @@ namespace DotNetOpenAuth.AspNet.Clients {
using DotNetOpenAuth.OAuth;
using DotNetOpenAuth.OAuth.ChannelElements;
using DotNetOpenAuth.OAuth.Messages;
- using System.Collections.Specialized;
/// <summary>
/// Represents LinkedIn authentication client.
@@ -7,6 +7,7 @@
namespace DotNetOpenAuth.AspNet.Clients {
using System;
using System.Collections.Generic;
+ using System.Collections.Specialized;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Threading;
@@ -19,7 +20,6 @@ namespace DotNetOpenAuth.AspNet.Clients {
using DotNetOpenAuth.OAuth.ChannelElements;
using DotNetOpenAuth.OAuth.Messages;
using Validation;
- using System.Collections.Specialized;
/// <summary>
/// Represents base class for OAuth 1.0 clients
@@ -28,17 +28,12 @@ public abstract class OAuthClient : IAuthenticationClient {
#region Constructors and Destructors
/// <summary>
- /// Initializes a new instance of the <see cref="OAuthClient"/> class.
+ /// Initializes a new instance of the <see cref="OAuthClient" /> class.
/// </summary>
- /// <param name="providerName">
- /// Name of the provider.
- /// </param>
- /// <param name="serviceDescription">
- /// The service Description.
- /// </param>
- /// <param name="tokenManager">
- /// The token Manager.
- /// </param>
+ /// <param name="providerName">Name of the provider.</param>
+ /// <param name="serviceDescription">The service Description.</param>
+ /// <param name="consumerKey">The consumer key.</param>
+ /// <param name="consumerSecret">The consumer secret.</param>
protected OAuthClient(
string providerName, ServiceProviderDescription serviceDescription, string consumerKey, string consumerSecret)
: this(providerName, new DotNetOpenAuthWebConsumer(serviceDescription, consumerKey, consumerSecret)) {
@@ -7,6 +7,7 @@
namespace DotNetOpenAuth.AspNet.Clients {
using System;
using System.Collections.Generic;
+ using System.Collections.Specialized;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Net;
@@ -18,7 +19,6 @@ namespace DotNetOpenAuth.AspNet.Clients {
using DotNetOpenAuth.OAuth;
using DotNetOpenAuth.OAuth.ChannelElements;
using DotNetOpenAuth.OAuth.Messages;
- using System.Collections.Specialized;
/// <summary>
/// Represents a Twitter client
@@ -7,12 +7,12 @@
namespace DotNetOpenAuth.AspNet.Clients {
using System;
using System.Collections.Generic;
+ using System.Collections.Specialized;
using System.Diagnostics.CodeAnalysis;
using System.Net;
using System.Web;
using DotNetOpenAuth.Messaging;
using Validation;
- using System.Collections.Specialized;
/// <summary>
/// The facebook client.
@@ -7,11 +7,11 @@
namespace DotNetOpenAuth.AspNet.Clients {
using System;
using System.Collections.Generic;
+ using System.Collections.Specialized;
using System.IO;
using System.Net;
using DotNetOpenAuth.Messaging;
using Validation;
- using System.Collections.Specialized;
/// <summary>
/// The Microsoft account client.
@@ -7,15 +7,13 @@
namespace DotNetOpenAuth.AspNet.Clients {
using System;
using System.Collections.Generic;
+ using System.Collections.Specialized;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
-
using DotNetOpenAuth.Messaging;
-
using Validation;
- using System.Collections.Specialized;
/// <summary>
/// Represents the base class for OAuth 2.0 clients
@@ -6,9 +6,9 @@
namespace DotNetOpenAuth.AspNet.Clients {
using System.Collections.Generic;
+ using System.Collections.Specialized;
using DotNetOpenAuth.OpenId.Extensions.AttributeExchange;
using DotNetOpenAuth.OpenId.RelyingParty;
- using System.Collections.Specialized;
/// <summary>
/// Represents Google OpenID client.
@@ -7,6 +7,7 @@
namespace DotNetOpenAuth.AspNet.Clients {
using System;
using System.Collections.Generic;
+ using System.Collections.Specialized;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.Threading.Tasks;
@@ -15,7 +16,6 @@ namespace DotNetOpenAuth.AspNet.Clients {
using DotNetOpenAuth.OpenId;
using DotNetOpenAuth.OpenId.RelyingParty;
using Validation;
- using System.Collections.Specialized;
/// <summary>
/// Base classes for OpenID clients.
@@ -6,9 +6,9 @@
namespace DotNetOpenAuth.AspNet.Clients {
using System.Collections.Generic;
+ using System.Collections.Specialized;
using DotNetOpenAuth.OpenId.Extensions.AttributeExchange;
using DotNetOpenAuth.OpenId.RelyingParty;
- using System.Collections.Specialized;
/// <summary>
/// The yahoo open id client.
Oops, something went wrong.

0 comments on commit b9ae2ab

Please sign in to comment.