From 5314290bbec53379372d14234fdc4f28cbe3286a Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 31 Dec 2024 16:23:46 +0100 Subject: Initial commit --- src/dummy_auth/routes.clj | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/dummy_auth/routes.clj (limited to 'src/dummy_auth/routes.clj') 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)) -- cgit v1.2.3