Skip to content

Instantly share code, notes, and snippets.

@mccraigmccraig
Created February 13, 2018 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mccraigmccraig/e166277b8964f5562dd45937a60bebd3 to your computer and use it in GitHub Desktop.
Save mccraigmccraig/e166277b8964f5562dd45937a60bebd3 to your computer and use it in GitHub Desktop.
(defnk make-http-handler
[[:handler-opts auth-secret]
cassandra :as app]
(info "making HTTP handler")
(info (with-out-str (clojure.pprint/pprint app)))
(let [auth-backend (auth-token/jws-backend {:secret auth-secret})]
(-> (make-http-route-handler app)
(mw/wrap-coerce-ids-handler)
(mw/wrap-check-short-token-authentication-validity-handler 15) ;; 10 second tokens
(mw/wrap-check-token-path-handler)
(wrap-authentication auth-backend)
(mw/wrap-log-request-handler))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment