Permalink
Browse files

The make-consumer fn takes now keyword args.

  • Loading branch information...
r0man committed Jan 21, 2012
1 parent 7112def commit 08b46b65bc66f0fa38502a984714ff642bee5d19
Showing with 11 additions and 11 deletions.
  1. +10 −10 src/oauth/v1.clj
  2. +1 −1 test/oauth/test/v1.clj
View
@@ -100,7 +100,7 @@
(defn make-consumer
"Returns an OAuth consumer HTTP client."
- [oauth-defaults]
+ [& {:as oauth-defaults}]
(-> clj-http.core/request
(wrap-oauth-authorization)
(wrap-oauth-signature)
@@ -112,26 +112,26 @@
"Obtain the OAuth access token."
[url oauth-consumer-key oauth-token oauth-verifier]
(-> ((make-consumer
- {:oauth-consumer-key oauth-consumer-key
- :oauth-token oauth-token
- :oauth-verifier oauth-verifier})
+ :oauth-consumer-key oauth-consumer-key
+ :oauth-token oauth-token
+ :oauth-verifier oauth-verifier)
{:method :post :url url})
parse-body))
(defn oauth-request-token
"Obtain the OAuth request token to request user authorization."
[url oauth-consumer-key oauth-consumer-secret]
(-> ((make-consumer
- {:oauth-consumer-key oauth-consumer-key
- :oauth-consumer-secret oauth-consumer-secret})
+ :oauth-consumer-key oauth-consumer-key
+ :oauth-consumer-secret oauth-consumer-secret)
{:method :post :url url})
parse-body))
(defn oauth-client
"Returns a HTTP client for version 1 of the OAuth protocol."
[oauth-consumer-key oauth-consumer-secret oauth-token oauth-token-secret]
(make-consumer
- {:oauth-consumer-key oauth-consumer-key
- :oauth-consumer-secret oauth-consumer-secret
- :oauth-token oauth-token
- :oauth-token-secret oauth-token-secret}))
+ :oauth-consumer-key oauth-consumer-key
+ :oauth-consumer-secret oauth-consumer-secret
+ :oauth-token oauth-token
+ :oauth-token-secret oauth-token-secret))
View
@@ -107,5 +107,5 @@
:oauth-token-secret "LswwdoUaIvS8ltyTt5jkRh4J50vUPVVHtR2YPi5kE")))
(deftest test-make-consumer
- (let [consumer (make-consumer {})]
+ (let [consumer (make-consumer)]
(is (fn? consumer))))

0 comments on commit 08b46b6

Please sign in to comment.