diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2008-11-06 08:12:43 -0800 |
---|---|---|
committer | Andrew <andrewarnott@gmail.com> | 2008-11-06 08:12:43 -0800 |
commit | 3320188443a4e9cd6fa94928a87161b4593bcfd0 (patch) | |
tree | d9e76ac6c5b86529be7a010608cf138d542b2b30 /src | |
parent | 15ffce6c077b52339dd3ba1b792b2005c61c7e84 (diff) | |
download | DotNetOpenAuth-3320188443a4e9cd6fa94928a87161b4593bcfd0.zip DotNetOpenAuth-3320188443a4e9cd6fa94928a87161b4593bcfd0.tar.gz DotNetOpenAuth-3320188443a4e9cd6fa94928a87161b4593bcfd0.tar.bz2 |
Moved OAuth-specific string resources into the OAuth directory.
Diffstat (limited to 'src')
11 files changed, 297 insertions, 105 deletions
diff --git a/src/DotNetOpenAuth/DotNetOpenAuth.csproj b/src/DotNetOpenAuth/DotNetOpenAuth.csproj index 26030ce..1df143c 100644 --- a/src/DotNetOpenAuth/DotNetOpenAuth.csproj +++ b/src/DotNetOpenAuth/DotNetOpenAuth.csproj @@ -83,6 +83,11 @@ <Compile Include="OAuth\Messages\ITokenSecretContainingMessage.cs" /> <Compile Include="Messaging\ChannelEventArgs.cs" /> <Compile Include="Messaging\ITamperProtectionChannelBindingElement.cs" /> + <Compile Include="OAuth\OAuthStrings.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>OAuthStrings.resx</DependentUpon> + </Compile> <Compile Include="OAuth\ServiceProviderDescription.cs" /> <Compile Include="OAuth\Messages\ITokenContainingMessage.cs" /> <Compile Include="OAuth\Messages\SignedMessageBase.cs" /> @@ -166,6 +171,10 @@ <Generator>ResXFileCodeGenerator</Generator> <LastGenOutput>MessagingStrings.Designer.cs</LastGenOutput> </EmbeddedResource> + <EmbeddedResource Include="OAuth\OAuthStrings.resx"> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>OAuthStrings.Designer.cs</LastGenOutput> + </EmbeddedResource> <EmbeddedResource Include="Strings.resx"> <Generator>ResXFileCodeGenerator</Generator> <LastGenOutput>Strings.Designer.cs</LastGenOutput> @@ -174,4 +183,4 @@ </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="..\..\tools\DotNetOpenAuth.Versioning.targets" /> -</Project>
\ No newline at end of file +</Project> diff --git a/src/DotNetOpenAuth/OAuth/ChannelElements/OAuthChannel.cs b/src/DotNetOpenAuth/OAuth/ChannelElements/OAuthChannel.cs index 736594e..b6f20d1 100644 --- a/src/DotNetOpenAuth/OAuth/ChannelElements/OAuthChannel.cs +++ b/src/DotNetOpenAuth/OAuth/ChannelElements/OAuthChannel.cs @@ -73,7 +73,7 @@ namespace DotNetOpenAuth.OAuth.ChannelElements { this.webRequestHandler = webRequestHandler; this.TokenManager = tokenManager; if (signingBindingElement.SignatureCallback != null) { - throw new ArgumentException(Strings.SigningElementAlreadyAssociatedWithChannel, "signingBindingElement"); + throw new ArgumentException(OAuthStrings.SigningElementAlreadyAssociatedWithChannel, "signingBindingElement"); } signingBindingElement.SignatureCallback = this.SignatureCallback; @@ -390,7 +390,7 @@ namespace DotNetOpenAuth.OAuth.ChannelElements { message.TokenSecret = this.TokenManager.GetTokenSecret(tokenMessage.Token); } } catch (KeyNotFoundException ex) { - throw new ProtocolException(Strings.ConsumerOrTokenSecretNotFound, ex); + throw new ProtocolException(OAuthStrings.ConsumerOrTokenSecretNotFound, ex); } } } diff --git a/src/DotNetOpenAuth/OAuth/ChannelElements/OAuthConsumerMessageTypeProvider.cs b/src/DotNetOpenAuth/OAuth/ChannelElements/OAuthConsumerMessageTypeProvider.cs index 292c3b0..6305326 100644 --- a/src/DotNetOpenAuth/OAuth/ChannelElements/OAuthConsumerMessageTypeProvider.cs +++ b/src/DotNetOpenAuth/OAuth/ChannelElements/OAuthConsumerMessageTypeProvider.cs @@ -88,7 +88,7 @@ namespace DotNetOpenAuth.OAuth.ChannelElements { return typeof(AuthorizedTokenResponse); } else { Logger.ErrorFormat("Unexpected response message given the request type {0}", request.GetType().Name); - throw new ProtocolException(Strings.InvalidIncomingMessage); + throw new ProtocolException(OAuthStrings.InvalidIncomingMessage); } } diff --git a/src/DotNetOpenAuth/OAuth/ChannelElements/SigningBindingElementChain.cs b/src/DotNetOpenAuth/OAuth/ChannelElements/SigningBindingElementChain.cs index f42c12e..7bc5763 100644 --- a/src/DotNetOpenAuth/OAuth/ChannelElements/SigningBindingElementChain.cs +++ b/src/DotNetOpenAuth/OAuth/ChannelElements/SigningBindingElementChain.cs @@ -40,7 +40,7 @@ namespace DotNetOpenAuth.OAuth.ChannelElements { } MessageProtections protection = signers[0].Protection; if (signers.Any(element => element.Protection != protection)) { - throw new ArgumentException(Strings.SigningElementsMustShareSameProtection, "signers"); + throw new ArgumentException(OAuthStrings.SigningElementsMustShareSameProtection, "signers"); } this.signers = signers; diff --git a/src/DotNetOpenAuth/OAuth/Messages/AuthorizedTokenRequest.cs b/src/DotNetOpenAuth/OAuth/Messages/AuthorizedTokenRequest.cs index d53221d..2d4793c 100644 --- a/src/DotNetOpenAuth/OAuth/Messages/AuthorizedTokenRequest.cs +++ b/src/DotNetOpenAuth/OAuth/Messages/AuthorizedTokenRequest.cs @@ -46,7 +46,7 @@ namespace DotNetOpenAuth.OAuth.Messages { base.EnsureValidMessage(); if (this.ExtraData.Count > 0) { - throw new ProtocolException(string.Format(CultureInfo.CurrentCulture, Strings.MessageNotAllowedExtraParameters, GetType().Name)); + throw new ProtocolException(string.Format(CultureInfo.CurrentCulture, OAuthStrings.MessageNotAllowedExtraParameters, GetType().Name)); } } } diff --git a/src/DotNetOpenAuth/OAuth/OAuthStrings.Designer.cs b/src/DotNetOpenAuth/OAuth/OAuthStrings.Designer.cs new file mode 100644 index 0000000..8d42b10 --- /dev/null +++ b/src/DotNetOpenAuth/OAuth/OAuthStrings.Designer.cs @@ -0,0 +1,135 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:2.0.50727.3053 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace DotNetOpenAuth.OAuth { + using System; + + + /// <summary> + /// A strongly-typed resource class, for looking up localized strings, etc. + /// </summary> + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class OAuthStrings { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal OAuthStrings() { + } + + /// <summary> + /// Returns the cached ResourceManager instance used by this class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DotNetOpenAuth.OAuth.OAuthStrings", typeof(OAuthStrings).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// <summary> + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// <summary> + /// Looks up a localized string similar to Cannot send access token to Consumer for request token '{0}' before it has been authorized.. + /// </summary> + internal static string AccessTokenNotAuthorized { + get { + return ResourceManager.GetString("AccessTokenNotAuthorized", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to The access token '{0}' is invalid or expired.. + /// </summary> + internal static string BadAccessTokenInProtectedResourceRequest { + get { + return ResourceManager.GetString("BadAccessTokenInProtectedResourceRequest", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Failure looking up secret for consumer or token.. + /// </summary> + internal static string ConsumerOrTokenSecretNotFound { + get { + return ResourceManager.GetString("ConsumerOrTokenSecretNotFound", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to An invalid OAuth message received and discarded.. + /// </summary> + internal static string InvalidIncomingMessage { + get { + return ResourceManager.GetString("InvalidIncomingMessage", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to The {0} message included extra data which is not allowed.. + /// </summary> + internal static string MessageNotAllowedExtraParameters { + get { + return ResourceManager.GetString("MessageNotAllowedExtraParameters", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to The request URL query MUST NOT contain any OAuth Protocol Parameters.. + /// </summary> + internal static string RequestUrlMustNotHaveOAuthParameters { + get { + return ResourceManager.GetString("RequestUrlMustNotHaveOAuthParameters", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to The signing element already has been associated with a channel.. + /// </summary> + internal static string SigningElementAlreadyAssociatedWithChannel { + get { + return ResourceManager.GetString("SigningElementAlreadyAssociatedWithChannel", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to All signing elements must offer the same message protection.. + /// </summary> + internal static string SigningElementsMustShareSameProtection { + get { + return ResourceManager.GetString("SigningElementsMustShareSameProtection", resourceCulture); + } + } + } +} diff --git a/src/DotNetOpenAuth/OAuth/OAuthStrings.resx b/src/DotNetOpenAuth/OAuth/OAuthStrings.resx new file mode 100644 index 0000000..3e59ca9 --- /dev/null +++ b/src/DotNetOpenAuth/OAuth/OAuthStrings.resx @@ -0,0 +1,144 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="AccessTokenNotAuthorized" xml:space="preserve"> + <value>Cannot send access token to Consumer for request token '{0}' before it has been authorized.</value> + </data> + <data name="BadAccessTokenInProtectedResourceRequest" xml:space="preserve"> + <value>The access token '{0}' is invalid or expired.</value> + </data> + <data name="ConsumerOrTokenSecretNotFound" xml:space="preserve"> + <value>Failure looking up secret for consumer or token.</value> + </data> + <data name="InvalidIncomingMessage" xml:space="preserve"> + <value>An invalid OAuth message received and discarded.</value> + </data> + <data name="MessageNotAllowedExtraParameters" xml:space="preserve"> + <value>The {0} message included extra data which is not allowed.</value> + </data> + <data name="RequestUrlMustNotHaveOAuthParameters" xml:space="preserve"> + <value>The request URL query MUST NOT contain any OAuth Protocol Parameters.</value> + </data> + <data name="SigningElementAlreadyAssociatedWithChannel" xml:space="preserve"> + <value>The signing element already has been associated with a channel.</value> + </data> + <data name="SigningElementsMustShareSameProtection" xml:space="preserve"> + <value>All signing elements must offer the same message protection.</value> + </data> +</root>
\ No newline at end of file diff --git a/src/DotNetOpenAuth/OAuth/ServiceProvider.cs b/src/DotNetOpenAuth/OAuth/ServiceProvider.cs index 0bd7fe8..a303845 100644 --- a/src/DotNetOpenAuth/OAuth/ServiceProvider.cs +++ b/src/DotNetOpenAuth/OAuth/ServiceProvider.cs @@ -290,7 +290,7 @@ namespace DotNetOpenAuth.OAuth { throw new ProtocolException( string.Format( CultureInfo.CurrentCulture, - Strings.AccessTokenNotAuthorized, + OAuthStrings.AccessTokenNotAuthorized, request.RequestToken)); } @@ -372,7 +372,7 @@ namespace DotNetOpenAuth.OAuth { throw new ProtocolException( string.Format( CultureInfo.CurrentCulture, - Strings.BadAccessTokenInProtectedResourceRequest, + OAuthStrings.BadAccessTokenInProtectedResourceRequest, accessMessage.AccessToken)); } } diff --git a/src/DotNetOpenAuth/OAuth/ServiceProviderDescription.cs b/src/DotNetOpenAuth/OAuth/ServiceProviderDescription.cs index f0ed8a0..fefb05c 100644 --- a/src/DotNetOpenAuth/OAuth/ServiceProviderDescription.cs +++ b/src/DotNetOpenAuth/OAuth/ServiceProviderDescription.cs @@ -44,7 +44,7 @@ namespace DotNetOpenAuth.OAuth { set { if (value != null && UriUtil.QueryStringContainsOAuthParameters(value.Location)) { - throw new ArgumentException(Strings.RequestUrlMustNotHaveOAuthParameters); + throw new ArgumentException(OAuthStrings.RequestUrlMustNotHaveOAuthParameters); } this.requestTokenEndpoint = value; diff --git a/src/DotNetOpenAuth/Strings.Designer.cs b/src/DotNetOpenAuth/Strings.Designer.cs index 67f552e..9ef42bc 100644 --- a/src/DotNetOpenAuth/Strings.Designer.cs +++ b/src/DotNetOpenAuth/Strings.Designer.cs @@ -59,77 +59,5 @@ namespace DotNetOpenAuth { resourceCulture = value; } } - - /// <summary> - /// Looks up a localized string similar to Cannot send access token to Consumer for request token '{0}' before it has been authorized.. - /// </summary> - internal static string AccessTokenNotAuthorized { - get { - return ResourceManager.GetString("AccessTokenNotAuthorized", resourceCulture); - } - } - - /// <summary> - /// Looks up a localized string similar to The access token '{0}' is invalid or expired.. - /// </summary> - internal static string BadAccessTokenInProtectedResourceRequest { - get { - return ResourceManager.GetString("BadAccessTokenInProtectedResourceRequest", resourceCulture); - } - } - - /// <summary> - /// Looks up a localized string similar to Failure looking up secret for consumer or token.. - /// </summary> - internal static string ConsumerOrTokenSecretNotFound { - get { - return ResourceManager.GetString("ConsumerOrTokenSecretNotFound", resourceCulture); - } - } - - /// <summary> - /// Looks up a localized string similar to An invalid OAuth message received and discarded.. - /// </summary> - internal static string InvalidIncomingMessage { - get { - return ResourceManager.GetString("InvalidIncomingMessage", resourceCulture); - } - } - - /// <summary> - /// Looks up a localized string similar to The {0} message included extra data which is not allowed.. - /// </summary> - internal static string MessageNotAllowedExtraParameters { - get { - return ResourceManager.GetString("MessageNotAllowedExtraParameters", resourceCulture); - } - } - - /// <summary> - /// Looks up a localized string similar to The request URL query MUST NOT contain any OAuth Protocol Parameters.. - /// </summary> - internal static string RequestUrlMustNotHaveOAuthParameters { - get { - return ResourceManager.GetString("RequestUrlMustNotHaveOAuthParameters", resourceCulture); - } - } - - /// <summary> - /// Looks up a localized string similar to The signing element already has been associated with a channel.. - /// </summary> - internal static string SigningElementAlreadyAssociatedWithChannel { - get { - return ResourceManager.GetString("SigningElementAlreadyAssociatedWithChannel", resourceCulture); - } - } - - /// <summary> - /// Looks up a localized string similar to All signing elements must offer the same message protection.. - /// </summary> - internal static string SigningElementsMustShareSameProtection { - get { - return ResourceManager.GetString("SigningElementsMustShareSameProtection", resourceCulture); - } - } } } diff --git a/src/DotNetOpenAuth/Strings.resx b/src/DotNetOpenAuth/Strings.resx index 3e59ca9..7080a7d 100644 --- a/src/DotNetOpenAuth/Strings.resx +++ b/src/DotNetOpenAuth/Strings.resx @@ -117,28 +117,4 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="AccessTokenNotAuthorized" xml:space="preserve"> - <value>Cannot send access token to Consumer for request token '{0}' before it has been authorized.</value> - </data> - <data name="BadAccessTokenInProtectedResourceRequest" xml:space="preserve"> - <value>The access token '{0}' is invalid or expired.</value> - </data> - <data name="ConsumerOrTokenSecretNotFound" xml:space="preserve"> - <value>Failure looking up secret for consumer or token.</value> - </data> - <data name="InvalidIncomingMessage" xml:space="preserve"> - <value>An invalid OAuth message received and discarded.</value> - </data> - <data name="MessageNotAllowedExtraParameters" xml:space="preserve"> - <value>The {0} message included extra data which is not allowed.</value> - </data> - <data name="RequestUrlMustNotHaveOAuthParameters" xml:space="preserve"> - <value>The request URL query MUST NOT contain any OAuth Protocol Parameters.</value> - </data> - <data name="SigningElementAlreadyAssociatedWithChannel" xml:space="preserve"> - <value>The signing element already has been associated with a channel.</value> - </data> - <data name="SigningElementsMustShareSameProtection" xml:space="preserve"> - <value>All signing elements must offer the same message protection.</value> - </data> </root>
\ No newline at end of file |