fixed warnings.
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
{:alg :hs512}))
|
||||
|
||||
(defroutes routes
|
||||
(GET "/oauth" {{:strs [code]} :query-params :keys [scheme] :as r {:strs [host]} :headers}
|
||||
(GET "/oauth" {{:strs [code]} :query-params {:strs [host]} :headers}
|
||||
(try
|
||||
(let [auth (-> "https://accounts.google.com/o/oauth2/token"
|
||||
(http/post
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
(ns auto-ap.routes.events
|
||||
(:require [auto-ap.routes.utils :refer [wrap-secure]]
|
||||
[config.core :refer [env]]
|
||||
[clj-http.client :as http]
|
||||
[clj-time.coerce :as c]
|
||||
[clj-time.core :as time]
|
||||
[clj-time.periodic :as p]
|
||||
[clj-time.predicates :as pred]
|
||||
[clojure.data.json :as json]
|
||||
[compojure.core :refer [GET PUT POST context defroutes
|
||||
wrap-routes]]
|
||||
[clojure.tools.logging :as log]
|
||||
[unilog.context :as lc])
|
||||
(:import (org.joda.time DateTime)))
|
||||
@@ -1,13 +1,13 @@
|
||||
(ns auto-ap.routes.graphql
|
||||
(:require [auto-ap.routes.utils :refer [wrap-secure wrap-spec]]
|
||||
(:require [auto-ap.routes.utils :refer [wrap-secure]]
|
||||
[auto-ap.graphql :as ql]
|
||||
[auto-ap.logging :refer [warn-event]]
|
||||
[buddy.auth :refer [throw-unauthorized]]
|
||||
[clojure.edn :as edn]
|
||||
[compojure.core :refer [GET POST PUT context defroutes
|
||||
[compojure.core :refer [GET POST context defroutes
|
||||
wrap-routes]]
|
||||
[clojure.tools.logging :as log]))
|
||||
(defn handle-graphql [{:keys [request-method query-params body edn-params method] :as r}]
|
||||
(defn handle-graphql [{:keys [request-method query-params] :as r}]
|
||||
(when (= "none" (:user/role (:identity r)))
|
||||
(throw-unauthorized))
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
(defroutes routes
|
||||
(wrap-routes
|
||||
(context "/yodlee2" []
|
||||
(GET "/fastlink" {:keys [query-params identity] :as request}
|
||||
(GET "/fastlink" {:keys [query-params identity]}
|
||||
(assert-can-see-client identity (d/pull (d/db conn) [:db/id] [:client/code (get query-params "client")]))
|
||||
|
||||
(let [token (if-let [client-id (get query-params "client-id")]
|
||||
@@ -27,9 +27,7 @@
|
||||
:headers {"Content-Type" "application/edn"}
|
||||
:body (pr-str {:token token
|
||||
:url (:yodlee2-fastlink env)}) }))
|
||||
(POST "/provider-accounts/refresh/" {:keys [query-params identity edn-params]
|
||||
{:keys [id]} :route-params
|
||||
:as request}
|
||||
(POST "/provider-accounts/refresh/" {:keys [identity edn-params]}
|
||||
(assert-admin identity)
|
||||
(log/info "refreshing " edn-params)
|
||||
(try
|
||||
@@ -48,9 +46,8 @@
|
||||
:body (pr-str {:message (.getMessage e)
|
||||
:error (.toString e)})})))
|
||||
|
||||
(GET "/provider-accounts/:client/:id" {:keys [query-params identity edn-params]
|
||||
{:keys [client id]} :route-params
|
||||
:as request}
|
||||
(GET "/provider-accounts/:client/:id" {:keys [identity]
|
||||
{:keys [client id]} :route-params}
|
||||
(assert-admin identity)
|
||||
(log/info "looking-up " client id)
|
||||
(try
|
||||
@@ -68,7 +65,7 @@
|
||||
:headers {"Content-Type" "application/edn"}
|
||||
:body (pr-str {:message (.getMessage e)
|
||||
:error (.toString e)})})))
|
||||
(POST "/provider-accounts/delete/" {:keys [edn-params identity] {:keys [id]} :route-params :as request}
|
||||
(POST "/provider-accounts/delete/" {:keys [edn-params identity]}
|
||||
(assert-admin identity)
|
||||
(try
|
||||
(yodlee/delete-provider-account (-> (:client-id edn-params)
|
||||
|
||||
Reference in New Issue
Block a user