summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason David Davies <jasondavies@apache.org>2009-10-15 22:57:13 +0000
committerJason David Davies <jasondavies@apache.org>2009-10-15 22:57:13 +0000
commit431ad4bb49aab2727b6f5b43ce9536e9a9cd545e (patch)
tree4fc734e0b6608997ec2352a803c062dcc9eebda5 /src
parent743aad0f321440604180eacd0a97fa22a8a6fb9b (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/couchdb/couch_rep_httpc.erl11
1 files changed, 10 insertions, 1 deletions
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";