diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2011-06-23 20:25:32 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2011-06-23 20:25:32 -0700 |
commit | 23cb348e7eab957e39a5a80d23f097c15595db84 (patch) | |
tree | 506daee6d1d7cc41bf9fca7fa09bef7c0b5d7e4e | |
parent | 3769a926805bb896187c1a4f8848949c57dee819 (diff) | |
download | DotNetOpenAuth-23cb348e7eab957e39a5a80d23f097c15595db84.zip DotNetOpenAuth-23cb348e7eab957e39a5a80d23f097c15595db84.tar.gz DotNetOpenAuth-23cb348e7eab957e39a5a80d23f097c15595db84.tar.bz2 |
Fixed StyleCop messages.
12 files changed, 44 insertions, 42 deletions
diff --git a/projecttemplates/RelyingPartyLogic/OAuthAuthorizationServer.cs b/projecttemplates/RelyingPartyLogic/OAuthAuthorizationServer.cs index 85a53c5..b34b8de 100644 --- a/projecttemplates/RelyingPartyLogic/OAuthAuthorizationServer.cs +++ b/projecttemplates/RelyingPartyLogic/OAuthAuthorizationServer.cs @@ -163,7 +163,7 @@ namespace RelyingPartyLogic { auth.CreatedOnUtc <= issuedUtc && (!auth.ExpirationDateUtc.HasValue || auth.ExpirationDateUtc.Value >= DateTime.UtcNow) && auth.User.AuthenticationTokens.Any(token => token.ClaimedIdentifier == username) - select auth.Scope; + select auth.Scope; if (!grantedScopeStrings.Any()) { // No granted authorizations prior to the issuance of this token, so it must have been revoked. diff --git a/projecttemplates/RelyingPartyLogic/OAuthResourceServer.cs b/projecttemplates/RelyingPartyLogic/OAuthResourceServer.cs index d935d56..fe55f8b 100644 --- a/projecttemplates/RelyingPartyLogic/OAuthResourceServer.cs +++ b/projecttemplates/RelyingPartyLogic/OAuthResourceServer.cs @@ -2,8 +2,8 @@ using System; using System.Collections.Generic; using System.Linq; - using System.Text; using System.Security.Cryptography; + using System.Text; public static class OAuthResourceServer { private static readonly RSAParameters ResourceServerKeyPair = CreateRSAKey(); diff --git a/samples/OAuthAuthorizationServer/Code/OAuth2AuthorizationServer.cs b/samples/OAuthAuthorizationServer/Code/OAuth2AuthorizationServer.cs index 3899135..2bee7ba 100644 --- a/samples/OAuthAuthorizationServer/Code/OAuth2AuthorizationServer.cs +++ b/samples/OAuthAuthorizationServer/Code/OAuth2AuthorizationServer.cs @@ -54,7 +54,7 @@ // Also take into account the remaining life of the authorization and artificially shorten the access token's lifetime // to account for that if necessary. - // TODO: code here + //// TODO: code here return lifetime; } @@ -165,7 +165,7 @@ auth.CreatedOnUtc <= issuedUtc && (!auth.ExpirationDateUtc.HasValue || auth.ExpirationDateUtc.Value >= DateTime.UtcNow) && auth.User.OpenIDClaimedIdentifier == username - select auth.Scope; + select auth.Scope; if (!grantedScopeStrings.Any()) { // No granted authorizations prior to the issuance of this token, so it must have been revoked. diff --git a/src/DotNetOpenAuth/OAuth2/ChannelElements/AccessRequestBindingElement.cs b/src/DotNetOpenAuth/OAuth2/ChannelElements/AccessRequestBindingElement.cs index d54a0a1..b7775b6 100644 --- a/src/DotNetOpenAuth/OAuth2/ChannelElements/AccessRequestBindingElement.cs +++ b/src/DotNetOpenAuth/OAuth2/ChannelElements/AccessRequestBindingElement.cs @@ -9,11 +9,11 @@ namespace DotNetOpenAuth.OAuth2.ChannelElements { using System.Collections.Generic; using System.Globalization; using System.Linq; + using System.Security.Cryptography; using System.Text; using DotNetOpenAuth.Messaging; using DotNetOpenAuth.Messaging.Bindings; using DotNetOpenAuth.OAuth2.Messages; - using System.Security.Cryptography; /// <summary> /// Decodes verification codes, refresh tokens and access tokens on incoming messages. diff --git a/src/DotNetOpenAuth/OAuth2/ChannelElements/AccessToken.cs b/src/DotNetOpenAuth/OAuth2/ChannelElements/AccessToken.cs index aa9a14d..6278828 100644 --- a/src/DotNetOpenAuth/OAuth2/ChannelElements/AccessToken.cs +++ b/src/DotNetOpenAuth/OAuth2/ChannelElements/AccessToken.cs @@ -6,12 +6,11 @@ namespace DotNetOpenAuth.OAuth2.ChannelElements { using System; + using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Security.Cryptography; - using DotNetOpenAuth.Messaging; using DotNetOpenAuth.Messaging.Bindings; - using System.Collections.Generic; /// <summary> /// A short-lived token that accompanies HTTP requests to protected data to authorize the request. diff --git a/src/DotNetOpenAuth/OAuth2/ChannelElements/AccessTokenBindingElement.cs b/src/DotNetOpenAuth/OAuth2/ChannelElements/AccessTokenBindingElement.cs index bdebce1..64e2433 100644 --- a/src/DotNetOpenAuth/OAuth2/ChannelElements/AccessTokenBindingElement.cs +++ b/src/DotNetOpenAuth/OAuth2/ChannelElements/AccessTokenBindingElement.cs @@ -8,10 +8,10 @@ namespace DotNetOpenAuth.OAuth2.ChannelElements { using System; using System.Collections.Generic; using System.Linq; + using System.Security.Cryptography; using System.Text; using DotNetOpenAuth.Messaging; using DotNetOpenAuth.OAuth2.Messages; - using System.Security.Cryptography; /// <summary> /// Serializes access tokens inside an outgoing message. @@ -68,7 +68,7 @@ namespace DotNetOpenAuth.OAuth2.ChannelElements { /// <exception cref="ProtocolException"> /// Thrown when the binding element rules indicate that this message is invalid and should /// NOT be processed. - /// </exception> + /// </exception> public override MessageProtections? ProcessIncomingMessage(IProtocolMessage message) { return null; } diff --git a/src/DotNetOpenAuth/OAuth2/IAuthorizationServer.cs b/src/DotNetOpenAuth/OAuth2/IAuthorizationServer.cs index a0e0a58..883f40c 100644 --- a/src/DotNetOpenAuth/OAuth2/IAuthorizationServer.cs +++ b/src/DotNetOpenAuth/OAuth2/IAuthorizationServer.cs @@ -11,9 +11,9 @@ namespace DotNetOpenAuth.OAuth2 { using System.Linq; using System.Security.Cryptography; using System.Text; + using DotNetOpenAuth.Messaging; using DotNetOpenAuth.Messaging.Bindings; using DotNetOpenAuth.OAuth2.ChannelElements; - using DotNetOpenAuth.Messaging; using DotNetOpenAuth.OAuth2.Messages; /// <summary> diff --git a/src/DotNetOpenAuth/OAuth2/Messages/AccessTokenAuthorizationCodeRequest.cs b/src/DotNetOpenAuth/OAuth2/Messages/AccessTokenAuthorizationCodeRequest.cs index 7ada347..22dad1d 100644 --- a/src/DotNetOpenAuth/OAuth2/Messages/AccessTokenAuthorizationCodeRequest.cs +++ b/src/DotNetOpenAuth/OAuth2/Messages/AccessTokenAuthorizationCodeRequest.cs @@ -60,13 +60,6 @@ namespace DotNetOpenAuth.OAuth2.Messages { IAuthorizationDescription IAuthorizationCarryingRequest.AuthorizationDescription { get; set; } /// <summary> - /// Gets the scope of operations the client is allowed to invoke. - /// </summary> - protected override HashSet<string> RequestedScope { - get { return ((IAuthorizationCarryingRequest)this).AuthorizationDescription.Scope; } - } - - /// <summary> /// Gets the type of the grant. /// </summary> /// <value>The type of the grant.</value> @@ -90,5 +83,12 @@ namespace DotNetOpenAuth.OAuth2.Messages { /// </value> [MessagePart(Protocol.redirect_uri, IsRequired = true)] internal Uri Callback { get; set; } + + /// <summary> + /// Gets the scope of operations the client is allowed to invoke. + /// </summary> + protected override HashSet<string> RequestedScope { + get { return ((IAuthorizationCarryingRequest)this).AuthorizationDescription.Scope; } + } } } diff --git a/src/DotNetOpenAuth/OAuth2/Messages/AccessTokenRequestBase.cs b/src/DotNetOpenAuth/OAuth2/Messages/AccessTokenRequestBase.cs index 7609862..10dc231 100644 --- a/src/DotNetOpenAuth/OAuth2/Messages/AccessTokenRequestBase.cs +++ b/src/DotNetOpenAuth/OAuth2/Messages/AccessTokenRequestBase.cs @@ -28,6 +28,23 @@ namespace DotNetOpenAuth.OAuth2.Messages { } /// <summary> + /// Gets the scope of operations the client is allowed to invoke. + /// </summary> + HashSet<string> IAccessTokenRequest.Scope { + get { return this.RequestedScope; } + } + + /// <summary> + /// Gets a value indicating whether the client requesting the access token has authenticated itself. + /// </summary> + /// <value> + /// Always true, because of our base class. + /// </value> + bool IAccessTokenRequest.ClientAuthenticated { + get { return true; } + } + + /// <summary> /// Gets the type of the grant. /// </summary> /// <value>The type of the grant.</value> @@ -35,6 +52,11 @@ namespace DotNetOpenAuth.OAuth2.Messages { internal abstract GrantType GrantType { get; } /// <summary> + /// Gets the scope of operations the client is allowed to invoke. + /// </summary> + protected abstract HashSet<string> RequestedScope { get; } + + /// <summary> /// Checks the message state for conformity to the protocol specification /// and throws an exception if the message is invalid. /// </summary> @@ -52,27 +74,5 @@ namespace DotNetOpenAuth.OAuth2.Messages { DotNetOpenAuthSection.Configuration.Messaging.RelaxSslRequirements || this.Recipient.IsTransportSecure(), OAuthStrings.HttpsRequired); } - - /// <summary> - /// Gets a value indicating whether the client requesting the access token has authenticated itself. - /// </summary> - /// <value> - /// Always true, because of our base class. - /// </value> - bool IAccessTokenRequest.ClientAuthenticated { - get { return true; } - } - - /// <summary> - /// Gets the scope of operations the client is allowed to invoke. - /// </summary> - HashSet<string> IAccessTokenRequest.Scope { - get { return this.RequestedScope; } - } - - /// <summary> - /// Gets the scope of operations the client is allowed to invoke. - /// </summary> - protected abstract HashSet<string> RequestedScope { get; } } } diff --git a/src/DotNetOpenAuth/OAuth2/Messages/EndUserAuthorizationSuccessAccessTokenResponse.cs b/src/DotNetOpenAuth/OAuth2/Messages/EndUserAuthorizationSuccessAccessTokenResponse.cs index 093802a..c9373eb 100644 --- a/src/DotNetOpenAuth/OAuth2/Messages/EndUserAuthorizationSuccessAccessTokenResponse.cs +++ b/src/DotNetOpenAuth/OAuth2/Messages/EndUserAuthorizationSuccessAccessTokenResponse.cs @@ -102,7 +102,7 @@ namespace DotNetOpenAuth.OAuth2.Messages { public string AccessToken { get; set; } /// <summary> - /// Gets the scope of the <see cref="AccessToken"/> if one is given; otherwise the scope of the authorization code. + /// Gets or sets the scope of the <see cref="AccessToken"/> if one is given; otherwise the scope of the authorization code. /// </summary> /// <value>The scope.</value> [MessagePart(Protocol.scope, IsRequired = false, Encoder = typeof(ScopeEncoder))] diff --git a/src/DotNetOpenAuth/OAuth2/Messages/EndUserAuthorizationSuccessResponseBase.cs b/src/DotNetOpenAuth/OAuth2/Messages/EndUserAuthorizationSuccessResponseBase.cs index b975a09..d3c32e8 100644 --- a/src/DotNetOpenAuth/OAuth2/Messages/EndUserAuthorizationSuccessResponseBase.cs +++ b/src/DotNetOpenAuth/OAuth2/Messages/EndUserAuthorizationSuccessResponseBase.cs @@ -56,7 +56,7 @@ namespace DotNetOpenAuth.OAuth2.Messages { string IMessageWithClientState.ClientState { get; set; } /// <summary> - /// Gets the scope of the <see cref="AccessToken"/> if one is given; otherwise the scope of the authorization code. + /// Gets or sets the scope of the <see cref="AccessToken"/> if one is given; otherwise the scope of the authorization code. /// </summary> /// <value>The scope.</value> public ICollection<string> Scope { get; protected set; } diff --git a/src/DotNetOpenAuth/OAuth2/Messages/IAccessTokenRequest.cs b/src/DotNetOpenAuth/OAuth2/Messages/IAccessTokenRequest.cs index 59670a1..7246beb 100644 --- a/src/DotNetOpenAuth/OAuth2/Messages/IAccessTokenRequest.cs +++ b/src/DotNetOpenAuth/OAuth2/Messages/IAccessTokenRequest.cs @@ -9,9 +9,12 @@ namespace DotNetOpenAuth.OAuth2.Messages { using System.Collections.Generic; using System.Linq; using System.Text; - using DotNetOpenAuth.OAuth2.ChannelElements; using DotNetOpenAuth.Messaging; + using DotNetOpenAuth.OAuth2.ChannelElements; + /// <summary> + /// A request from a client that should be responded to directly with an access token. + /// </summary> public interface IAccessTokenRequest : IMessage { /// <summary> /// Gets a value indicating whether the client requesting the access token has authenticated itself. |