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

Commit

Permalink
Renamed references to TrustRoot types from TrustRootUrl to just Trust…
Browse files Browse the repository at this point in the history
…Root.

git-svn-id: https://dotnetopenid.googlecode.com/svn/trunk@278 01efa1a6-402a-0410-b0ae-47b76eba00f0
  • Loading branch information
AArnott committed Mar 5, 2008
1 parent f46f320 commit ca50f80
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/DotNetOpenId.Test/EndToEndTesting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void parameterizedTest(Uri identityUrl, TrustRoot trustRoot, Uri returnTo,
// Test properties and defaults
Assert.AreEqual(AuthenticationRequestMode.Setup, request.Mode);
Assert.AreEqual(returnTo, request.ReturnToUrl);
Assert.AreEqual(trustRoot, request.TrustRootUrl);
Assert.AreEqual(trustRoot, request.TrustRoot);

request.Mode = requestMode;

Expand Down
8 changes: 4 additions & 4 deletions src/DotNetOpenId/Consumer/AuthenticationRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ class AuthenticationRequest : IAuthenticationRequest {
ServiceEndpoint endpoint;

internal AuthenticationRequest(string token, Association assoc, ServiceEndpoint endpoint,
TrustRoot trustRootUrl, Uri returnToUrl) {
TrustRoot trustRoot, Uri returnToUrl) {
this.token = token;
this.assoc = assoc;
this.endpoint = endpoint;
TrustRootUrl = trustRootUrl;
TrustRoot = trustRoot;
ReturnToUrl = returnToUrl;

Mode = AuthenticationRequestMode.Setup;
Expand All @@ -42,7 +42,7 @@ internal AuthenticationRequest(string token, Association assoc, ServiceEndpoint
protected IDictionary<string, string> ReturnToArgs { get; private set; }

public AuthenticationRequestMode Mode { get; set; }
public TrustRoot TrustRootUrl { get; private set; }
public TrustRoot TrustRoot { get; private set; }
public Uri ReturnToUrl { get; private set; }
/// <summary>
/// Gets the URL the user agent should be redirected to to begin the
Expand All @@ -59,7 +59,7 @@ public Uri RedirectToProviderUrl {
QueryStringArgs.Modes.checkid_immediate : QueryStringArgs.Modes.checkid_setup);
qsArgs.Add(QueryStringArgs.openid.identity, this.endpoint.ServerId.AbsoluteUri); //TODO: breaks the Law of Demeter
qsArgs.Add(QueryStringArgs.openid.return_to, returnToBuilder.ToString());
qsArgs.Add(QueryStringArgs.openid.trust_root, TrustRootUrl.ToString());
qsArgs.Add(QueryStringArgs.openid.trust_root, TrustRoot.ToString());

if (this.assoc != null)
qsArgs.Add(QueryStringArgs.openid.assoc_handle, this.assoc.Handle); // !!!!
Expand Down
4 changes: 2 additions & 2 deletions src/DotNetOpenId/Consumer/GenericConsumer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ public GenericConsumer(IConsumerApplicationStore store)
}

public AuthenticationRequest Begin(ServiceEndpoint service_endpoint,
TrustRoot trustRootUrl, Uri returnToUrl)
TrustRoot trustRoot, Uri returnToUrl)
{
string token = new Token(service_endpoint).Serialize(store);

Association assoc = this.getAssociation(service_endpoint.ServerUrl);

AuthenticationRequest request = new AuthenticationRequest(token, assoc, service_endpoint,
trustRootUrl, returnToUrl);
trustRoot, returnToUrl);

return request;
}
Expand Down
2 changes: 1 addition & 1 deletion src/DotNetOpenId/Consumer/IAuthenticationRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ public interface IAuthenticationRequest {
/// </summary>
Uri RedirectToProviderUrl { get; }
Uri ReturnToUrl { get; }
TrustRoot TrustRootUrl { get; }
TrustRoot TrustRoot { get; }
}
}
16 changes: 8 additions & 8 deletions src/DotNetOpenId/Consumer/OpenIdConsumer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,17 @@ public OpenIdConsumer(NameValueCollection query, IConsumerApplicationStore store
}
}

public IAuthenticationRequest CreateRequest(Uri openIdUrl, TrustRoot trustRootUrl, Uri returnToUrl) {
public IAuthenticationRequest CreateRequest(Uri openIdUrl, TrustRoot trustRoot, Uri returnToUrl) {
ServiceEndpoint endpoint = manager.GetNextService(openIdUrl);
if (endpoint == null)
throw new OpenIdException("No openid endpoint found");
return prepareRequest(endpoint, trustRootUrl, returnToUrl);
return prepareRequest(endpoint, trustRoot, returnToUrl);
}

/// <remarks>
/// This method requires an ASP.NET HttpContext.
/// </remarks>
public IAuthenticationRequest CreateRequest(Uri openIdUrl, TrustRoot trustRootUrl) {
public IAuthenticationRequest CreateRequest(Uri openIdUrl, TrustRoot trustRoot) {
if (HttpContext.Current == null) throw new InvalidOperationException(Strings.CurrentHttpContextRequired);

// Build the return_to URL
Expand All @@ -91,7 +91,7 @@ public IAuthenticationRequest CreateRequest(Uri openIdUrl, TrustRoot trustRootUr
}
UriUtil.AppendQueryArgs(returnTo, returnToParams);

return CreateRequest(openIdUrl, trustRootUrl, returnTo.Uri);
return CreateRequest(openIdUrl, trustRoot, returnTo.Uri);
}

/// <remarks>
Expand All @@ -108,15 +108,15 @@ public IAuthenticationRequest CreateRequest(Uri openIdUrl) {
}

AuthenticationRequest prepareRequest(ServiceEndpoint endpoint,
TrustRoot trustRootUrl, Uri returnToUrl) {
TrustRoot trustRoot, Uri returnToUrl) {
// Throw an exception now if the trustroot and the return_to URLs don't match
// as required by the provider. We could wait for the provider to test this and
// fail, but this will be faster and give us a better error message.
if (!trustRootUrl.Contains(returnToUrl))
if (!trustRoot.Contains(returnToUrl))
throw new OpenIdException(string.Format(CultureInfo.CurrentUICulture,
Strings.ReturnToNotUnderTrustRoot, returnToUrl, trustRootUrl));
Strings.ReturnToNotUnderTrustRoot, returnToUrl, trustRoot));

return consumer.Begin(endpoint, trustRootUrl, returnToUrl);
return consumer.Begin(endpoint, trustRoot, returnToUrl);
}

/// <summary>
Expand Down

0 comments on commit ca50f80

Please sign in to comment.