diff options
Diffstat (limited to 'src/dummy_auth/routes.clj')
-rw-r--r-- | src/dummy_auth/routes.clj | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/dummy_auth/routes.clj b/src/dummy_auth/routes.clj new file mode 100644 index 0000000..8ecdc1c --- /dev/null +++ b/src/dummy_auth/routes.clj @@ -0,0 +1,23 @@ +(ns dummy-auth.routes + (:require [reitit.ring :as rring] + [ring.middleware.params :as rmparams] + [ring.middleware.json :as rmjson] + + [dummy-auth.error :as derror] + [dummy-auth.oauth2.auth :as do2auth] + [dummy-auth.oauth2.token :as do2token] + [dummy-auth.oidc.userinfo :as doidcuserinfo])) + +(def routes [["/oauth2" + ["/authorize" {:get {:handler do2auth/handle}}] + ["/token" {:post {:handler do2token/handle}}]] + ["/oidc" + ["/userinfo" {:get {:handler doidcuserinfo/handle} + :post {:handler doidcuserinfo/handle}}]] + ["/error" {:get {:handler derror/handle}}]]) + +(def ring-handler (-> routes + rring/router + rring/ring-handler + rmjson/wrap-json-response + rmparams/wrap-params)) |