From 431ad4bb49aab2727b6f5b43ce9536e9a9cd545e Mon Sep 17 00:00:00 2001 From: Jason David Davies Date: Thu, 15 Oct 2009 22:57:13 +0000 Subject: Add support for other OAuth signature methods in replication client. To use, set auth.oauth.signature_method to either "HMAC-SHA1" (the default if not specified) or "PLAINTEXT". git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@825693 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_rep_httpc.erl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/couchdb/couch_rep_httpc.erl') diff --git a/src/couchdb/couch_rep_httpc.erl b/src/couchdb/couch_rep_httpc.erl index 55d8180e..60d44cab 100644 --- a/src/couchdb/couch_rep_httpc.erl +++ b/src/couchdb/couch_rep_httpc.erl @@ -213,7 +213,16 @@ oauth_header(Url, QS, Action, Props) -> Token = ?b2l(proplists:get_value(<<"token">>, Props)), TokenSecret = ?b2l(proplists:get_value(<<"token_secret">>, Props)), ConsumerSecret = ?b2l(proplists:get_value(<<"consumer_secret">>, Props)), - Consumer = {ConsumerKey, ConsumerSecret, hmac_sha1}, + SignatureMethodStr = ?b2l(proplists:get_value(<<"signature_method">>, Props, <<"HMAC-SHA1">>)), + SignatureMethodAtom = case SignatureMethodStr of + "PLAINTEXT" -> + plaintext; + "HMAC-SHA1" -> + hmac_sha1; + "RSA-SHA1" -> + rsa_sha1 + end, + Consumer = {ConsumerKey, ConsumerSecret, SignatureMethodAtom}, Method = case Action of get -> "GET"; post -> "POST"; -- cgit v1.2.3