Skip to content
This repository has been archived by the owner on Mar 20, 2019. It is now read-only.

Commit

Permalink
Exposed UriIdentifier and XriIdentifier types, but no members in thos…
Browse files Browse the repository at this point in the history
…e derived types.

This enables scenarios where people want to detect whether an identifier is an XRI or not.
  • Loading branch information
AArnott committed Sep 6, 2008
1 parent 6943a50 commit 228c885
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions src/DotNetOpenId/UriIdentifier.cs
Expand Up @@ -8,7 +8,7 @@

namespace DotNetOpenId {
[Serializable]
class UriIdentifier : Identifier {
public sealed class UriIdentifier : Identifier {
static readonly string[] allowedSchemes = { "http", "https" };
public static implicit operator Uri(UriIdentifier identifier) {
if (identifier == null) return null;
Expand All @@ -19,8 +19,8 @@ class UriIdentifier : Identifier {
return new UriIdentifier(identifier);
}

public UriIdentifier(string uri) : this(uri, false) { }
public UriIdentifier(string uri, bool requireSslDiscovery)
internal UriIdentifier(string uri) : this(uri, false) { }
internal UriIdentifier(string uri, bool requireSslDiscovery)
: base(requireSslDiscovery) {
if (string.IsNullOrEmpty(uri)) throw new ArgumentNullException("uri");
Uri canonicalUri;
Expand All @@ -33,8 +33,8 @@ public UriIdentifier(string uri, bool requireSslDiscovery)
Uri = canonicalUri;
SchemeImplicitlyPrepended = schemePrepended;
}
public UriIdentifier(Uri uri) : this(uri, false) { }
public UriIdentifier(Uri uri, bool requireSslDiscovery)
internal UriIdentifier(Uri uri) : this(uri, false) { }
internal UriIdentifier(Uri uri, bool requireSslDiscovery)
: base(requireSslDiscovery) {
if (uri == null) throw new ArgumentNullException("uri");
if (!TryCanonicalize(new UriBuilder(uri), out uri))
Expand All @@ -46,7 +46,7 @@ public UriIdentifier(Uri uri, bool requireSslDiscovery)
SchemeImplicitlyPrepended = false;
}

public Uri Uri { get; private set; }
internal Uri Uri { get; private set; }
/// <summary>
/// Gets whether the scheme was missing when this Identifier was
/// created and added automatically as part of the normalization
Expand Down Expand Up @@ -134,7 +134,7 @@ public UriIdentifier(Uri uri, bool requireSslDiscovery)
/// OpenID 2.0 tags are always used if they are present, otherwise
/// OpenID 1.x tags are used if present.
/// </remarks>
protected virtual ServiceEndpoint DiscoverFromHtml(Uri claimedIdentifier, string html) {
private ServiceEndpoint DiscoverFromHtml(Uri claimedIdentifier, string html) {
Uri providerEndpoint = null;
Protocol discoveredProtocol = null;
Identifier providerLocalIdentifier = null;
Expand Down
12 changes: 6 additions & 6 deletions src/DotNetOpenId/XriIdentifier.cs
Expand Up @@ -9,12 +9,12 @@

namespace DotNetOpenId {
[Serializable]
class XriIdentifier : Identifier {
public sealed class XriIdentifier : Identifier {
internal static readonly char[] GlobalContextSymbols = { '=', '@', '+', '$', '!' };
const string xriScheme = "xri://";

public XriIdentifier(string xri) : this(xri, false) { }
public XriIdentifier(string xri, bool requireSsl)
internal XriIdentifier(string xri) : this(xri, false) { }
internal XriIdentifier(string xri, bool requireSsl)
: base(requireSsl) {
if (!IsValidXri(xri))
throw new FormatException(string.Format(CultureInfo.CurrentCulture,
Expand All @@ -32,11 +32,11 @@ public XriIdentifier(string xri, bool requireSsl)
/// <summary>
/// The original XRI supplied to the constructor.
/// </summary>
public string OriginalXri { get; private set; }
internal string OriginalXri { get; private set; }
/// <summary>
/// The canonical form of the XRI string.
/// </summary>
public string CanonicalXri { get; private set; }
internal string CanonicalXri { get; private set; }

/// <summary>
/// Tests whether a given string represents a valid XRI format.
Expand Down Expand Up @@ -74,7 +74,7 @@ public XriIdentifier(string xri, bool requireSsl)
/// <summary>
/// Resolves the XRI to a URL from which an XRDS document may be downloaded.
/// </summary>
protected virtual Uri XrdsUrl {
private Uri XrdsUrl {
get {
return new Uri(string.Format(CultureInfo.InvariantCulture,
xriResolverProxy, this));
Expand Down

0 comments on commit 228c885

Please sign in to comment.