Permalink
Browse files

Merge pull request #34 from gilbertw1/master

Added oauth support for pubsubhubub endpoint
  • Loading branch information...
2 parents 358bd25 + d9ec3f9 commit b0d35675186f33ae8066e41fa7eab71ca2712328 @Raynes committed Aug 14, 2013
Showing with 12 additions and 9 deletions.
  1. +12 −9 src/tentacles/repos.clj
View
@@ -402,15 +402,18 @@
[user repo mode event callback & [options]]
(no-content?
(post "https://api.github.com/hub"
- {:basic-auth (:auth options)
- :form-params
- (merge
- {"hub.mode" mode
- "hub.topic" (format "https://github.com/%s/%s/events/%s"
- user repo event)
- "hub.callback" callback}
- (when-let [secret (:secret options)]
- {"hub.secret" secret}))})))
+ (merge
+ (when-let [oauth-token (:oauth-token options)]
+ {:headers {"Authorization" (str "token " oauth-token)}})
+ {:basic-auth (:auth options)
+ :form-params
+ (merge
+ {"hub.mode" mode
+ "hub.topic" (format "https://github.com/%s/%s/events/%s"
+ user repo event)
+ "hub.callback" callback}
+ (when-let [secret (:secret options)]
+ {"hub.secret" secret}))}))))
;; ## Repo Contents API

0 comments on commit b0d3567

Please sign in to comment.