summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.OpenId/Xrds
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.OpenId/Xrds')
-rw-r--r--src/DotNetOpenAuth.OpenId/Xrds/ServiceElement.cs133
-rw-r--r--src/DotNetOpenAuth.OpenId/Xrds/TypeElement.cs34
-rw-r--r--src/DotNetOpenAuth.OpenId/Xrds/UriElement.cs98
-rw-r--r--src/DotNetOpenAuth.OpenId/Xrds/XrdElement.cs160
-rw-r--r--src/DotNetOpenAuth.OpenId/Xrds/XrdsDocument.cs87
-rw-r--r--src/DotNetOpenAuth.OpenId/Xrds/XrdsNode.cs69
-rw-r--r--src/DotNetOpenAuth.OpenId/Xrds/XrdsStrings.Designer.cs99
-rw-r--r--src/DotNetOpenAuth.OpenId/Xrds/XrdsStrings.resx132
-rw-r--r--src/DotNetOpenAuth.OpenId/Xrds/XrdsStrings.sr.resx132
9 files changed, 944 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.OpenId/Xrds/ServiceElement.cs b/src/DotNetOpenAuth.OpenId/Xrds/ServiceElement.cs
new file mode 100644
index 0000000..0acf2b5
--- /dev/null
+++ b/src/DotNetOpenAuth.OpenId/Xrds/ServiceElement.cs
@@ -0,0 +1,133 @@
+//-----------------------------------------------------------------------
+// <copyright file="ServiceElement.cs" company="Andrew Arnott, Scott Hanselman">
+// Copyright (c) Andrew Arnott, Scott Hanselman. All rights reserved.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace DotNetOpenAuth.Xrds {
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Xml.XPath;
+ using DotNetOpenAuth.OpenId;
+
+ /// <summary>
+ /// The Service element in an XRDS document.
+ /// </summary>
+ internal class ServiceElement : XrdsNode, IComparable<ServiceElement> {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ServiceElement"/> class.
+ /// </summary>
+ /// <param name="serviceElement">The service element.</param>
+ /// <param name="parent">The parent.</param>
+ public ServiceElement(XPathNavigator serviceElement, XrdElement parent) :
+ base(serviceElement, parent) {
+ }
+
+ /// <summary>
+ /// Gets the XRD parent element.
+ /// </summary>
+ public XrdElement Xrd {
+ get { return (XrdElement)ParentNode; }
+ }
+
+ /// <summary>
+ /// Gets the priority.
+ /// </summary>
+ public int? Priority {
+ get {
+ XPathNavigator n = Node.SelectSingleNode("@priority", XmlNamespaceResolver);
+ return n != null ? n.ValueAsInt : (int?)null;
+ }
+ }
+
+ /// <summary>
+ /// Gets the URI child elements.
+ /// </summary>
+ public IEnumerable<UriElement> UriElements {
+ get {
+ List<UriElement> uris = new List<UriElement>();
+ foreach (XPathNavigator node in Node.Select("xrd:URI", XmlNamespaceResolver)) {
+ uris.Add(new UriElement(node, this));
+ }
+ uris.Sort();
+ return uris;
+ }
+ }
+
+ /// <summary>
+ /// Gets the type child elements.
+ /// </summary>
+ /// <value>The type elements.</value>
+ public IEnumerable<TypeElement> TypeElements {
+ get {
+ foreach (XPathNavigator node in Node.Select("xrd:Type", XmlNamespaceResolver)) {
+ yield return new TypeElement(node, this);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets the type child element's URIs.
+ /// </summary>
+ public string[] TypeElementUris {
+ get {
+ return this.TypeElements.Select(type => type.Uri).ToArray();
+ }
+ }
+
+ /// <summary>
+ /// Gets the OP Local Identifier.
+ /// </summary>
+ public Identifier ProviderLocalIdentifier {
+ get {
+ var n = Node.SelectSingleNode("xrd:LocalID", XmlNamespaceResolver)
+ ?? Node.SelectSingleNode("openid10:Delegate", XmlNamespaceResolver);
+ if (n != null && n.Value != null) {
+ string value = n.Value.Trim();
+ if (value.Length > 0) {
+ return n.Value;
+ }
+ }
+
+ return null;
+ }
+ }
+
+ #region IComparable<ServiceElement> Members
+
+ /// <summary>
+ /// Compares the current object with another object of the same type.
+ /// </summary>
+ /// <param name="other">An object to compare with this object.</param>
+ /// <returns>
+ /// A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has the following meanings:
+ /// Value
+ /// Meaning
+ /// Less than zero
+ /// This object is less than the <paramref name="other"/> parameter.
+ /// Zero
+ /// This object is equal to <paramref name="other"/>.
+ /// Greater than zero
+ /// This object is greater than <paramref name="other"/>.
+ /// </returns>
+ public int CompareTo(ServiceElement other) {
+ if (other == null) {
+ return -1;
+ }
+ if (this.Priority.HasValue && other.Priority.HasValue) {
+ return this.Priority.Value.CompareTo(other.Priority.Value);
+ } else {
+ if (this.Priority.HasValue) {
+ return -1;
+ } else if (other.Priority.HasValue) {
+ return 1;
+ } else {
+ return 0;
+ }
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/src/DotNetOpenAuth.OpenId/Xrds/TypeElement.cs b/src/DotNetOpenAuth.OpenId/Xrds/TypeElement.cs
new file mode 100644
index 0000000..e1ad188
--- /dev/null
+++ b/src/DotNetOpenAuth.OpenId/Xrds/TypeElement.cs
@@ -0,0 +1,34 @@
+//-----------------------------------------------------------------------
+// <copyright file="TypeElement.cs" company="Andrew Arnott, Scott Hanselman">
+// Copyright (c) Andrew Arnott, Scott Hanselman. All rights reserved.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace DotNetOpenAuth.Xrds {
+ using System;
+ using System.Diagnostics.Contracts;
+ using System.Xml.XPath;
+
+ /// <summary>
+ /// The Type element in an XRDS document.
+ /// </summary>
+ internal class TypeElement : XrdsNode {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="TypeElement"/> class.
+ /// </summary>
+ /// <param name="typeElement">The type element.</param>
+ /// <param name="parent">The parent.</param>
+ public TypeElement(XPathNavigator typeElement, ServiceElement parent) :
+ base(typeElement, parent) {
+ Requires.NotNull(typeElement, "typeElement");
+ Requires.NotNull(parent, "parent");
+ }
+
+ /// <summary>
+ /// Gets the URI.
+ /// </summary>
+ public string Uri {
+ get { return Node.Value; }
+ }
+ }
+}
diff --git a/src/DotNetOpenAuth.OpenId/Xrds/UriElement.cs b/src/DotNetOpenAuth.OpenId/Xrds/UriElement.cs
new file mode 100644
index 0000000..a67d259
--- /dev/null
+++ b/src/DotNetOpenAuth.OpenId/Xrds/UriElement.cs
@@ -0,0 +1,98 @@
+//-----------------------------------------------------------------------
+// <copyright file="UriElement.cs" company="Andrew Arnott, Scott Hanselman">
+// Copyright (c) Andrew Arnott, Scott Hanselman. All rights reserved.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace DotNetOpenAuth.Xrds {
+ using System;
+ using System.Xml.XPath;
+
+ /// <summary>
+ /// The Uri element in an XRDS document.
+ /// </summary>
+ internal class UriElement : XrdsNode, IComparable<UriElement> {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="UriElement"/> class.
+ /// </summary>
+ /// <param name="uriElement">The URI element.</param>
+ /// <param name="service">The service.</param>
+ public UriElement(XPathNavigator uriElement, ServiceElement service) :
+ base(uriElement, service) {
+ }
+
+ /// <summary>
+ /// Gets the priority.
+ /// </summary>
+ public int? Priority {
+ get {
+ XPathNavigator n = Node.SelectSingleNode("@priority", XmlNamespaceResolver);
+ return n != null ? n.ValueAsInt : (int?)null;
+ }
+ }
+
+ /// <summary>
+ /// Gets the URI.
+ /// </summary>
+ public Uri Uri {
+ get {
+ if (Node.Value != null) {
+ string value = Node.Value.Trim();
+ if (value.Length > 0) {
+ return new Uri(value);
+ }
+ }
+
+ return null;
+ }
+ }
+
+ /// <summary>
+ /// Gets the parent service.
+ /// </summary>
+ public ServiceElement Service {
+ get { return (ServiceElement)ParentNode; }
+ }
+
+ #region IComparable<UriElement> Members
+
+ /// <summary>
+ /// Compares the current object with another object of the same type.
+ /// </summary>
+ /// <param name="other">An object to compare with this object.</param>
+ /// <returns>
+ /// A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has the following meanings:
+ /// Value
+ /// Meaning
+ /// Less than zero
+ /// This object is less than the <paramref name="other"/> parameter.
+ /// Zero
+ /// This object is equal to <paramref name="other"/>.
+ /// Greater than zero
+ /// This object is greater than <paramref name="other"/>.
+ /// </returns>
+ public int CompareTo(UriElement other) {
+ if (other == null) {
+ return -1;
+ }
+ int compare = this.Service.CompareTo(other.Service);
+ if (compare != 0) {
+ return compare;
+ }
+
+ if (this.Priority.HasValue && other.Priority.HasValue) {
+ return this.Priority.Value.CompareTo(other.Priority.Value);
+ } else {
+ if (this.Priority.HasValue) {
+ return -1;
+ } else if (other.Priority.HasValue) {
+ return 1;
+ } else {
+ return 0;
+ }
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/src/DotNetOpenAuth.OpenId/Xrds/XrdElement.cs b/src/DotNetOpenAuth.OpenId/Xrds/XrdElement.cs
new file mode 100644
index 0000000..2cdc720
--- /dev/null
+++ b/src/DotNetOpenAuth.OpenId/Xrds/XrdElement.cs
@@ -0,0 +1,160 @@
+//-----------------------------------------------------------------------
+// <copyright file="XrdElement.cs" company="Andrew Arnott, Scott Hanselman">
+// Copyright (c) Andrew Arnott, Scott Hanselman. All rights reserved.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace DotNetOpenAuth.Xrds {
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Text;
+ using System.Xml.XPath;
+ using DotNetOpenAuth.Messaging;
+ using DotNetOpenAuth.OpenId;
+
+ /// <summary>
+ /// The Xrd element in an XRDS document.
+ /// </summary>
+ internal class XrdElement : XrdsNode {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="XrdElement"/> class.
+ /// </summary>
+ /// <param name="xrdElement">The XRD element.</param>
+ /// <param name="parent">The parent.</param>
+ public XrdElement(XPathNavigator xrdElement, XrdsDocument parent) :
+ base(xrdElement, parent) {
+ }
+
+ /// <summary>
+ /// Gets the child service elements.
+ /// </summary>
+ /// <value>The services.</value>
+ public IEnumerable<ServiceElement> Services {
+ get {
+ // We should enumerate them in priority order
+ List<ServiceElement> services = new List<ServiceElement>();
+ foreach (XPathNavigator node in Node.Select("xrd:Service", XmlNamespaceResolver)) {
+ services.Add(new ServiceElement(node, this));
+ }
+ services.Sort();
+ return services;
+ }
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether this XRD element's resolution at the XRI resolver was successful.
+ /// </summary>
+ /// <value>
+ /// <c>true</c> if this XRD's resolution was successful; otherwise, <c>false</c>.
+ /// </value>
+ public bool IsXriResolutionSuccessful {
+ get {
+ return this.XriResolutionStatusCode == 100;
+ }
+ }
+
+ /// <summary>
+ /// Gets the canonical ID (i-number) for this element.
+ /// </summary>
+ public string CanonicalID {
+ get {
+ var n = Node.SelectSingleNode("xrd:CanonicalID", XmlNamespaceResolver);
+ return n != null ? n.Value : null;
+ }
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether the <see cref="CanonicalID"/> was verified.
+ /// </summary>
+ public bool IsCanonicalIdVerified {
+ get {
+ var n = Node.SelectSingleNode("xrd:Status", XmlNamespaceResolver);
+ return n != null && string.Equals(n.GetAttribute("cid", string.Empty), "verified", StringComparison.Ordinal);
+ }
+ }
+
+ /// <summary>
+ /// Gets the services for OP Identifiers.
+ /// </summary>
+ public IEnumerable<ServiceElement> OpenIdProviderIdentifierServices {
+ get { return this.SearchForServiceTypeUris(p => p.OPIdentifierServiceTypeURI); }
+ }
+
+ /// <summary>
+ /// Gets the services for Claimed Identifiers.
+ /// </summary>
+ public IEnumerable<ServiceElement> OpenIdClaimedIdentifierServices {
+ get { return this.SearchForServiceTypeUris(p => p.ClaimedIdentifierServiceTypeURI); }
+ }
+
+ /// <summary>
+ /// Gets the services that would be discoverable at an RP for return_to verification.
+ /// </summary>
+ public IEnumerable<ServiceElement> OpenIdRelyingPartyReturnToServices {
+ get { return this.SearchForServiceTypeUris(p => p.RPReturnToTypeURI); }
+ }
+
+ /// <summary>
+ /// Gets the services that would be discoverable at an RP for the UI extension icon.
+ /// </summary>
+ public IEnumerable<ServiceElement> OpenIdRelyingPartyIcons {
+ get { return this.SearchForServiceTypeUris(p => "http://specs.openid.net/extensions/ui/icon"); }
+ }
+
+ /// <summary>
+ /// Gets an enumeration of all Service/URI elements, sorted in priority order.
+ /// </summary>
+ public IEnumerable<UriElement> ServiceUris {
+ get {
+ return from service in this.Services
+ from uri in service.UriElements
+ select uri;
+ }
+ }
+
+ /// <summary>
+ /// Gets the XRI resolution status code.
+ /// </summary>
+ private int XriResolutionStatusCode {
+ get {
+ var n = Node.SelectSingleNode("xrd:Status", XmlNamespaceResolver);
+ string codeString = null;
+ ErrorUtilities.VerifyProtocol(n != null && !string.IsNullOrEmpty(codeString = n.GetAttribute("code", string.Empty)), XrdsStrings.XriResolutionStatusMissing);
+ int code;
+ ErrorUtilities.VerifyProtocol(int.TryParse(codeString, out code) && code >= 100 && code < 400, XrdsStrings.XriResolutionStatusMissing);
+ return code;
+ }
+ }
+
+ /// <summary>
+ /// Searches for service sub-elements that have Type URI sub-elements that match
+ /// one that we have for a known OpenID protocol version.
+ /// </summary>
+ /// <param name="p">A function that selects what element of the OpenID Protocol we're interested in finding.</param>
+ /// <returns>A sequence of service elements that match the search criteria, sorted in XRDS @priority attribute order.</returns>
+ internal IEnumerable<ServiceElement> SearchForServiceTypeUris(Func<Protocol, string> p) {
+ var xpath = new StringBuilder();
+ xpath.Append("xrd:Service[");
+ foreach (var protocol in Protocol.AllVersions) {
+ string typeUri = p(protocol);
+ if (typeUri == null) {
+ continue;
+ }
+ xpath.Append("xrd:Type/text()='");
+ xpath.Append(typeUri);
+ xpath.Append("' or ");
+ }
+ xpath.Length -= 4;
+ xpath.Append("]");
+ var services = new List<ServiceElement>();
+ foreach (XPathNavigator service in Node.Select(xpath.ToString(), XmlNamespaceResolver)) {
+ services.Add(new ServiceElement(service, this));
+ }
+
+ // Put the services in their own defined priority order
+ services.Sort();
+ return services;
+ }
+ }
+}
diff --git a/src/DotNetOpenAuth.OpenId/Xrds/XrdsDocument.cs b/src/DotNetOpenAuth.OpenId/Xrds/XrdsDocument.cs
new file mode 100644
index 0000000..040c994
--- /dev/null
+++ b/src/DotNetOpenAuth.OpenId/Xrds/XrdsDocument.cs
@@ -0,0 +1,87 @@
+//-----------------------------------------------------------------------
+// <copyright file="XrdsDocument.cs" company="Andrew Arnott">
+// Copyright (c) Andrew Arnott. All rights reserved.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace DotNetOpenAuth.Xrds {
+ using System.Collections.Generic;
+ using System.Diagnostics.CodeAnalysis;
+ using System.IO;
+ using System.Linq;
+ using System.Xml;
+ using System.Xml.XPath;
+ using DotNetOpenAuth.Messaging;
+ using DotNetOpenAuth.OpenId;
+
+ /// <summary>
+ /// An XRDS document.
+ /// </summary>
+ internal class XrdsDocument : XrdsNode {
+ /// <summary>
+ /// The namespace used by XML digital signatures.
+ /// </summary>
+ private const string XmlDSigNamespace = "http://www.w3.org/2000/09/xmldsig#";
+
+ /// <summary>
+ /// The namespace used by Google Apps for Domains for OpenID URI templates.
+ /// </summary>
+ private const string GoogleOpenIdNamespace = "http://namespace.google.com/openid/xmlns";
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="XrdsDocument"/> class.
+ /// </summary>
+ /// <param name="xrdsNavigator">The root node of the XRDS document.</param>
+ public XrdsDocument(XPathNavigator xrdsNavigator)
+ : base(xrdsNavigator) {
+ XmlNamespaceResolver.AddNamespace("xrd", XrdsNode.XrdNamespace);
+ XmlNamespaceResolver.AddNamespace("xrds", XrdsNode.XrdsNamespace);
+ XmlNamespaceResolver.AddNamespace("openid10", Protocol.V10.XmlNamespace);
+ XmlNamespaceResolver.AddNamespace("ds", XmlDSigNamespace);
+ XmlNamespaceResolver.AddNamespace("google", GoogleOpenIdNamespace);
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="XrdsDocument"/> class.
+ /// </summary>
+ /// <param name="reader">The Xml reader positioned at the root node of the XRDS document.</param>
+ public XrdsDocument(XmlReader reader)
+ : this(new XPathDocument(reader).CreateNavigator()) { }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="XrdsDocument"/> class.
+ /// </summary>
+ /// <param name="xml">The text that is the XRDS document.</param>
+ [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "Fixing would decrease readability, and not likely avoid any finalizer on a StringReader anyway.")]
+ public XrdsDocument(string xml)
+ : this(new XPathDocument(new StringReader(xml)).CreateNavigator()) { }
+
+ /// <summary>
+ /// Gets the XRD child elements of the document.
+ /// </summary>
+ public IEnumerable<XrdElement> XrdElements {
+ get {
+ // We may be looking at a full XRDS document (in the case of YADIS discovery)
+ // or we may be looking at just an individual XRD element from a larger document
+ // if we asked xri.net for just one.
+ if (Node.SelectSingleNode("/xrds:XRDS", XmlNamespaceResolver) != null) {
+ foreach (XPathNavigator node in Node.Select("/xrds:XRDS/xrd:XRD", XmlNamespaceResolver)) {
+ yield return new XrdElement(node, this);
+ }
+ } else {
+ XPathNavigator node = Node.SelectSingleNode("/xrd:XRD", XmlNamespaceResolver);
+ if (node != null) {
+ yield return new XrdElement(node, this);
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether all child XRD elements were resolved successfully.
+ /// </summary>
+ internal bool IsXrdResolutionSuccessful {
+ get { return this.XrdElements.All(xrd => xrd.IsXriResolutionSuccessful); }
+ }
+ }
+}
diff --git a/src/DotNetOpenAuth.OpenId/Xrds/XrdsNode.cs b/src/DotNetOpenAuth.OpenId/Xrds/XrdsNode.cs
new file mode 100644
index 0000000..7a27a9c
--- /dev/null
+++ b/src/DotNetOpenAuth.OpenId/Xrds/XrdsNode.cs
@@ -0,0 +1,69 @@
+//-----------------------------------------------------------------------
+// <copyright file="XrdsNode.cs" company="Andrew Arnott, Scott Hanselman">
+// Copyright (c) Andrew Arnott, Scott Hanselman. All rights reserved.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace DotNetOpenAuth.Xrds {
+ using System;
+ using System.Diagnostics.Contracts;
+ using System.Xml;
+ using System.Xml.XPath;
+ using DotNetOpenAuth.Messaging;
+
+ /// <summary>
+ /// A node in an XRDS document.
+ /// </summary>
+ internal class XrdsNode {
+ /// <summary>
+ /// The XRD namespace xri://$xrd*($v*2.0)
+ /// </summary>
+ internal const string XrdNamespace = "xri://$xrd*($v*2.0)";
+
+ /// <summary>
+ /// The XRDS namespace xri://$xrds
+ /// </summary>
+ internal const string XrdsNamespace = "xri://$xrds";
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="XrdsNode"/> class.
+ /// </summary>
+ /// <param name="node">The node represented by this instance.</param>
+ /// <param name="parentNode">The parent node.</param>
+ protected XrdsNode(XPathNavigator node, XrdsNode parentNode) {
+ Requires.NotNull(node, "node");
+ Requires.NotNull(parentNode, "parentNode");
+
+ this.Node = node;
+ this.ParentNode = parentNode;
+ this.XmlNamespaceResolver = this.ParentNode.XmlNamespaceResolver;
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="XrdsNode"/> class.
+ /// </summary>
+ /// <param name="document">The document's root node, which this instance represents.</param>
+ protected XrdsNode(XPathNavigator document) {
+ Requires.NotNull(document, "document");
+ Requires.True(document.NameTable != null, null);
+
+ this.Node = document;
+ this.XmlNamespaceResolver = new XmlNamespaceManager(document.NameTable);
+ }
+
+ /// <summary>
+ /// Gets the node.
+ /// </summary>
+ internal XPathNavigator Node { get; private set; }
+
+ /// <summary>
+ /// Gets the parent node, or null if this is the root node.
+ /// </summary>
+ protected internal XrdsNode ParentNode { get; private set; }
+
+ /// <summary>
+ /// Gets the XML namespace resolver to use in XPath expressions.
+ /// </summary>
+ protected internal XmlNamespaceManager XmlNamespaceResolver { get; private set; }
+ }
+}
diff --git a/src/DotNetOpenAuth.OpenId/Xrds/XrdsStrings.Designer.cs b/src/DotNetOpenAuth.OpenId/Xrds/XrdsStrings.Designer.cs
new file mode 100644
index 0000000..2279b5f
--- /dev/null
+++ b/src/DotNetOpenAuth.OpenId/Xrds/XrdsStrings.Designer.cs
@@ -0,0 +1,99 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:4.0.30104.0
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace DotNetOpenAuth.Xrds {
+ 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", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class XrdsStrings {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal XrdsStrings() {
+ }
+
+ /// <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.Xrds.XrdsStrings", typeof(XrdsStrings).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 XRI CanonicalID verification failed..
+ /// </summary>
+ internal static string CIDVerificationFailed {
+ get {
+ return ResourceManager.GetString("CIDVerificationFailed", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Failure parsing XRDS document..
+ /// </summary>
+ internal static string InvalidXRDSDocument {
+ get {
+ return ResourceManager.GetString("InvalidXRDSDocument", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to The XRDS document for XRI {0} is missing the required CanonicalID element..
+ /// </summary>
+ internal static string MissingCanonicalIDElement {
+ get {
+ return ResourceManager.GetString("MissingCanonicalIDElement", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Could not find XRI resolution Status tag or code attribute was invalid..
+ /// </summary>
+ internal static string XriResolutionStatusMissing {
+ get {
+ return ResourceManager.GetString("XriResolutionStatusMissing", resourceCulture);
+ }
+ }
+ }
+}
diff --git a/src/DotNetOpenAuth.OpenId/Xrds/XrdsStrings.resx b/src/DotNetOpenAuth.OpenId/Xrds/XrdsStrings.resx
new file mode 100644
index 0000000..acb43f2
--- /dev/null
+++ b/src/DotNetOpenAuth.OpenId/Xrds/XrdsStrings.resx
@@ -0,0 +1,132 @@
+<?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="CIDVerificationFailed" xml:space="preserve">
+ <value>XRI CanonicalID verification failed.</value>
+ </data>
+ <data name="InvalidXRDSDocument" xml:space="preserve">
+ <value>Failure parsing XRDS document.</value>
+ </data>
+ <data name="MissingCanonicalIDElement" xml:space="preserve">
+ <value>The XRDS document for XRI {0} is missing the required CanonicalID element.</value>
+ </data>
+ <data name="XriResolutionStatusMissing" xml:space="preserve">
+ <value>Could not find XRI resolution Status tag or code attribute was invalid.</value>
+ </data>
+</root> \ No newline at end of file
diff --git a/src/DotNetOpenAuth.OpenId/Xrds/XrdsStrings.sr.resx b/src/DotNetOpenAuth.OpenId/Xrds/XrdsStrings.sr.resx
new file mode 100644
index 0000000..8e2d09a
--- /dev/null
+++ b/src/DotNetOpenAuth.OpenId/Xrds/XrdsStrings.sr.resx
@@ -0,0 +1,132 @@
+<?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="CIDVerificationFailed" xml:space="preserve">
+ <value>XRI CanonicalID provera neuspešna.</value>
+ </data>
+ <data name="InvalidXRDSDocument" xml:space="preserve">
+ <value>Greška u obradi XRDS dokumenta.</value>
+ </data>
+ <data name="MissingCanonicalIDElement" xml:space="preserve">
+ <value>XRDS dokumentu za XRI {0} nedostaje neophodni CanonicalID element.</value>
+ </data>
+ <data name="XriResolutionStatusMissing" xml:space="preserve">
+ <value>Ne može se pronaći XRI resolution Status tag ili je code attribute neispravan.</value>
+ </data>
+</root> \ No newline at end of file