diff options
author | Tim <contact@bytim.eu> | 2024-12-31 16:23:46 +0100 |
---|---|---|
committer | Tim <contact@bytim.eu> | 2024-12-31 16:23:46 +0100 |
commit | 5314290bbec53379372d14234fdc4f28cbe3286a (patch) | |
tree | 32bcb32e394873692d16ff7d2c436a71acf2f6b3 /src/dummy_auth/routes.clj | |
download | dummy-auth-5314290bbec53379372d14234fdc4f28cbe3286a.tar.xz dummy-auth-5314290bbec53379372d14234fdc4f28cbe3286a.zip |
Initial commit
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)) |