Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Commit

Permalink
Backport erlang-oauth from master for R15 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
rnewson committed Oct 10, 2011
1 parent da22c19 commit 1a11127
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/erlang-oauth/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ oauth_file_collection = \
oauth_unix.erl \
oauth_uri.erl

# Removed oauth_rsa_sha1.beam until we require R12B5 or
# we add a ./configure option to enable it.

oauthebin_make_generated_file_list = \
oauth.app \
oauth.beam \
oauth_hmac_sha1.beam \
oauth_http.beam \
oauth_plaintext.beam \
oauth_rsa_sha1.beam \
oauth_unix.beam \
oauth_uri.beam

Expand Down
2 changes: 1 addition & 1 deletion src/erlang-oauth/oauth.app.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{application, oauth, [
{description, "Erlang OAuth implementation"},
{vsn, "dev"},
{vsn, "7d85d3ef"},
{modules, [
oauth,
oauth_hmac_sha1,
Expand Down
2 changes: 1 addition & 1 deletion src/erlang-oauth/oauth_hmac_sha1.erl
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ signature(BaseString, CS, TS) ->
base64:encode_to_string(crypto:sha_mac(Key, BaseString)).

verify(Signature, BaseString, CS, TS) ->
couch_util:verify(signature(BaseString, CS, TS), Signature).
Signature =:= signature(BaseString, CS, TS).
2 changes: 1 addition & 1 deletion src/erlang-oauth/oauth_http.erl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ post(URL, Data) ->
request(post, {URL, [], "application/x-www-form-urlencoded", Data}).

request(Method, Request) ->
http:request(Method, Request, [{autoredirect, false}], []).
httpc:request(Method, Request, [{autoredirect, false}], []).

response_params(Response) ->
oauth_uri:params_from_string(response_body(Response)).
Expand Down
2 changes: 1 addition & 1 deletion src/erlang-oauth/oauth_plaintext.erl
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ signature(CS, TS) ->
oauth_uri:calate("&", [CS, TS]).

verify(Signature, CS, TS) ->
couch_util:verify(signature(CS, TS), Signature).
Signature =:= signature(CS, TS).

0 comments on commit 1a11127

Please sign in to comment.