Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Fold oauth_unix module into oauth module.
  • Loading branch information
tim committed Nov 26, 2010
1 parent cfe8271 commit 546d0ee7e45dca21c9ae74f82fbb25e191d8dae7
Showing 3 changed files with 13 additions and 17 deletions.
@@ -8,7 +8,6 @@
oauth_http,
oauth_plaintext,
oauth_rsa_sha1,
oauth_unix,
oauth_uri
]},
{registered, []},
@@ -71,7 +71,7 @@ token_param(Token, Params) ->

params(Consumer, Params) ->
Nonce = base64:encode_to_string(crypto:rand_bytes(32)), % cf. ruby-oauth
params(Consumer, oauth_unix:timestamp(), Nonce, Params).
params(Consumer, unix_timestamp(), Nonce, Params).

params(Consumer, Timestamp, Nonce, Params) ->
[ {"oauth_version", "1.0"}
@@ -82,6 +82,18 @@ params(Consumer, Timestamp, Nonce, Params) ->
| Params
].

unix_timestamp() ->
unix_timestamp(calendar:universal_time()).

unix_timestamp(DateTime) ->
unix_seconds(DateTime) - unix_epoch().

unix_epoch() ->
unix_seconds({{1970,1,1},{00,00,00}}).

unix_seconds(DateTime) ->
calendar:datetime_to_gregorian_seconds(DateTime).

signature_method_string(Consumer) ->
case signature_method(Consumer) of
plaintext ->

This file was deleted.

0 comments on commit 546d0ee

Please sign in to comment.