summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2008-09-28 17:15:21 -0700
committerAndrew <andrewarnott@gmail.com>2008-09-28 17:15:21 -0700
commite900947a227091adaf2b7a81cafdc0c5b624a91b (patch)
tree982ddecbe75baeff15c962efad056b26cae38899 /src
parentad79dec82e43910db29d1a259155f2cf3f86e731 (diff)
downloadDotNetOpenAuth-e900947a227091adaf2b7a81cafdc0c5b624a91b.zip
DotNetOpenAuth-e900947a227091adaf2b7a81cafdc0c5b624a91b.tar.gz
DotNetOpenAuth-e900947a227091adaf2b7a81cafdc0c5b624a91b.tar.bz2
Removed hard-coded signing modules.
Diffstat (limited to 'src')
-rw-r--r--src/DotNetOAuth.Test/Messaging/ChannelTests.cs1
-rw-r--r--src/DotNetOAuth.Test/Scenarios/AppendixScenarios.cs8
-rw-r--r--src/DotNetOAuth.Test/Scenarios/CoordinatingOAuthChannel.cs2
-rw-r--r--src/DotNetOAuth/Consumer.cs7
-rw-r--r--src/DotNetOAuth/ServiceProvider.cs7
5 files changed, 11 insertions, 14 deletions
diff --git a/src/DotNetOAuth.Test/Messaging/ChannelTests.cs b/src/DotNetOAuth.Test/Messaging/ChannelTests.cs
index 40bf7ac..e9dd6ea 100644
--- a/src/DotNetOAuth.Test/Messaging/ChannelTests.cs
+++ b/src/DotNetOAuth.Test/Messaging/ChannelTests.cs
@@ -199,7 +199,6 @@ namespace DotNetOAuth.Test.Messaging {
[TestMethod]
public void ReadFromRequestWithContext() {
- // TODO: make this a request with a message in it.
var fields = GetStandardTestFields(FieldFill.AllRequired);
TestMessage expectedMessage = GetStandardTestMessage(FieldFill.AllRequired);
HttpRequest request = new HttpRequest("somefile", "http://someurl", MessagingUtilities.CreateQueryString(fields));
diff --git a/src/DotNetOAuth.Test/Scenarios/AppendixScenarios.cs b/src/DotNetOAuth.Test/Scenarios/AppendixScenarios.cs
index 370f2d3..0d73b22 100644
--- a/src/DotNetOAuth.Test/Scenarios/AppendixScenarios.cs
+++ b/src/DotNetOAuth.Test/Scenarios/AppendixScenarios.cs
@@ -26,8 +26,12 @@ namespace DotNetOAuth.Test {
};
MessageReceivingEndpoint accessPhotoEndpoint = new MessageReceivingEndpoint("http://photos.example.net/photos?file=vacation.jpg&size=original", HttpDeliveryMethod.AuthorizationHeaderRequest);
var tokenManager = new InMemoryTokenManager();
- var sp = new ServiceProvider(endpoints, tokenManager);
- Consumer consumer = new Consumer(endpoints, new InMemoryTokenManager()) {
+ ITamperProtectionChannelBindingElement[] signers = new ITamperProtectionChannelBindingElement[] {
+ new PlainTextSigningBindingElement(),
+ new HmacSha1SigningBindingElement(),
+ };
+ var sp = new ServiceProvider(endpoints, tokenManager, signers);
+ Consumer consumer = new Consumer(endpoints, new InMemoryTokenManager(), signers) {
ConsumerKey = "dpf43f3p2l4k3l03",
ConsumerSecret = "kd94hf93k423kf44",
};
diff --git a/src/DotNetOAuth.Test/Scenarios/CoordinatingOAuthChannel.cs b/src/DotNetOAuth.Test/Scenarios/CoordinatingOAuthChannel.cs
index 08a9ac8..67f5ad6 100644
--- a/src/DotNetOAuth.Test/Scenarios/CoordinatingOAuthChannel.cs
+++ b/src/DotNetOAuth.Test/Scenarios/CoordinatingOAuthChannel.cs
@@ -86,7 +86,7 @@ namespace DotNetOAuth.Test.Scenarios {
}
protected override IProtocolMessage ReadFromRequestInternal(HttpRequestInfo request) {
- return request.Message ?? base.ReadFromRequestInternal(request); // TODO: trim off ?? and after?
+ return request.Message;
}
/// <summary>
diff --git a/src/DotNetOAuth/Consumer.cs b/src/DotNetOAuth/Consumer.cs
index c3b34f3..2d9355e 100644
--- a/src/DotNetOAuth/Consumer.cs
+++ b/src/DotNetOAuth/Consumer.cs
@@ -21,7 +21,7 @@ namespace DotNetOAuth {
/// </summary>
/// <param name="endpoints">The endpoints on the Service Provider.</param>
/// <param name="tokenManager">The host's method of storing and recalling tokens and secrets.</param>
- public Consumer(ServiceProviderEndpoints endpoints, ITokenManager tokenManager) {
+ internal Consumer(ServiceProviderEndpoints endpoints, ITokenManager tokenManager, params ITamperProtectionChannelBindingElement[] signingElements) {
if (endpoints == null) {
throw new ArgumentNullException("endpoints");
}
@@ -30,10 +30,7 @@ namespace DotNetOAuth {
}
this.WebRequestHandler = new StandardWebRequestHandler();
- ITamperProtectionChannelBindingElement signingElement = new SigningBindingElementChain(new ITamperProtectionChannelBindingElement[] {
- new PlainTextSigningBindingElement(),
- new HmacSha1SigningBindingElement(),
- });
+ ITamperProtectionChannelBindingElement signingElement = new SigningBindingElementChain(signingElements);
INonceStore store = new NonceMemoryStore(StandardExpirationBindingElement.DefaultMaximumMessageAge);
this.Channel = new OAuthChannel(signingElement, store, new OAuthMessageTypeProvider(tokenManager), this.WebRequestHandler);
this.ServiceProvider = endpoints;
diff --git a/src/DotNetOAuth/ServiceProvider.cs b/src/DotNetOAuth/ServiceProvider.cs
index 6f5c2c4..ad629a3 100644
--- a/src/DotNetOAuth/ServiceProvider.cs
+++ b/src/DotNetOAuth/ServiceProvider.cs
@@ -30,7 +30,7 @@ namespace DotNetOAuth {
/// </summary>
/// <param name="endpoints">The endpoints on the Service Provider.</param>
/// <param name="tokenManager">The host's method of storing and recalling tokens and secrets.</param>
- public ServiceProvider(ServiceProviderEndpoints endpoints, ITokenManager tokenManager) {
+ internal ServiceProvider(ServiceProviderEndpoints endpoints, ITokenManager tokenManager, params ITamperProtectionChannelBindingElement[] signingElements) {
if (endpoints == null) {
throw new ArgumentNullException("endpoints");
}
@@ -38,10 +38,7 @@ namespace DotNetOAuth {
throw new ArgumentNullException("tokenManager");
}
- ITamperProtectionChannelBindingElement signingElement = new SigningBindingElementChain(new ITamperProtectionChannelBindingElement[] {
- new PlainTextSigningBindingElement(),
- new HmacSha1SigningBindingElement(),
- });
+ ITamperProtectionChannelBindingElement signingElement = new SigningBindingElementChain(signingElements);
signingElement.SignatureVerificationCallback = this.TokenSignatureVerificationCallback;
INonceStore store = new NonceMemoryStore(StandardExpirationBindingElement.DefaultMaximumMessageAge);
this.Endpoints = endpoints;