From 4c9187fec6e652d13b7c6e64897e985b9c59c489 Mon Sep 17 00:00:00 2001 From: Krisztian Gulyas Date: Mon, 19 Apr 2021 13:38:02 +0200 Subject: [PATCH 1/3] add auth and acl back --- src/framework/components/app/core.clj | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/framework/components/app/core.clj b/src/framework/components/app/core.clj index 38f85e75..727d5815 100644 --- a/src/framework/components/app/core.clj +++ b/src/framework/components/app/core.clj @@ -126,8 +126,8 @@ #(assoc % :deps deps :request http-request)) - #(if config - (acl-builder/init % config) + #(if (:acl-cfg config) + (acl-builder/init % (:acl-cfg config)) %))) (defn ->app @@ -145,6 +145,7 @@ (fn [http-request] (let [deps {:router (:router router) :db db + :auth auth :session-backend session-backend} state-built (mbuild-state {:deps deps :http-request http-request From 1877a9c77af8c3d2e169789245717ac116d641f2 Mon Sep 17 00:00:00 2001 From: Ian Fernandez Date: Mon, 19 Apr 2021 08:57:05 -0300 Subject: [PATCH 2/3] Fix auth_and_acl and bump version --- project.clj | 2 +- src/framework/components/app/core.clj | 64 +++++++++++++-------------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/project.clj b/project.clj index fa557d24..e67d024b 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject com.flexiana/framework "0.1.9" +(defproject com.flexiana/framework "0.2.0" :description "Framework" :url "https://github.com/Flexiana/framework" :license {:name "FIXME" :url "FIXME"} diff --git a/src/framework/components/app/core.clj b/src/framework/components/app/core.clj index 727d5815..b71dca53 100644 --- a/src/framework/components/app/core.clj +++ b/src/framework/components/app/core.clj @@ -120,50 +120,50 @@ (defn mbuild-state [{:keys [deps http-request - config]}] + acl-cfg]}] (m/>>= (xiana/ok (create-empty-state)) (comp xiana/ok #(assoc % :deps deps :request http-request)) - #(if (:acl-cfg config) - (acl-builder/init % (:acl-cfg config)) + #(if acl-cfg + (acl-builder/init % acl-cfg) %))) (defn ->app - [{_acl-cfg :acl-cfg + [{acl-cfg :acl-cfg session-backend :session-backend - _auth :auth + auth :auth :as config}] (with-meta config `{component/start ~(fn [{:keys [router db - router-interceptors - controller-interceptors] - :as this}] + router-interceptors + controller-interceptors] + :as this}] (assoc this - :handler - (fn [http-request] - (let [deps {:router (:router router) - :db db - :auth auth - :session-backend session-backend} - state-built (mbuild-state {:deps deps - :http-request http-request - :config config}) - router-enter (select-interceptors router-interceptors :enter identity) - router-leave (select-interceptors router-interceptors :leave reverse) - controller-enter (select-interceptors controller-interceptors :enter identity) - controller-leave (select-interceptors controller-interceptors :leave reverse)] - (->> [[state-built] - router-enter - [route] - router-leave - controller-enter - [run-controller] - controller-leave] - (mapcat identity) - (apply m/>>=) - xiana/extract - :response))))) + :handler + (fn [http-request] + (let [deps {:router (:router router) + :db db + :session-backend session-backend} + state-built (mbuild-state {:deps deps + :http-request http-request + :acl-cfg acl-cfg + :auth auth}) + router-enter (select-interceptors router-interceptors :enter identity) + router-leave (select-interceptors router-interceptors :leave reverse) + controller-enter (select-interceptors controller-interceptors :enter identity) + controller-leave (select-interceptors controller-interceptors :leave reverse)] + (->> [[state-built] + router-enter + [route] + router-leave + controller-enter + [run-controller] + controller-leave] + (mapcat identity) + (apply m/>>=) + xiana/extract + :response))))) component/stop ~(fn [this] (dissoc this :handler))})) From bf9f105ff3bd6bc9df4f0293b911af3537045ba1 Mon Sep 17 00:00:00 2001 From: Ian Fernandez Date: Mon, 19 Apr 2021 08:58:32 -0300 Subject: [PATCH 3/3] cljstyle fix --- src/framework/components/app/core.clj | 54 +++++++++++++-------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/framework/components/app/core.clj b/src/framework/components/app/core.clj index b71dca53..6c9653b2 100644 --- a/src/framework/components/app/core.clj +++ b/src/framework/components/app/core.clj @@ -137,33 +137,33 @@ :as config}] (with-meta config `{component/start ~(fn [{:keys [router db - router-interceptors - controller-interceptors] - :as this}] + router-interceptors + controller-interceptors] + :as this}] (assoc this - :handler - (fn [http-request] - (let [deps {:router (:router router) - :db db - :session-backend session-backend} - state-built (mbuild-state {:deps deps - :http-request http-request - :acl-cfg acl-cfg - :auth auth}) - router-enter (select-interceptors router-interceptors :enter identity) - router-leave (select-interceptors router-interceptors :leave reverse) - controller-enter (select-interceptors controller-interceptors :enter identity) - controller-leave (select-interceptors controller-interceptors :leave reverse)] - (->> [[state-built] - router-enter - [route] - router-leave - controller-enter - [run-controller] - controller-leave] - (mapcat identity) - (apply m/>>=) - xiana/extract - :response))))) + :handler + (fn [http-request] + (let [deps {:router (:router router) + :db db + :session-backend session-backend} + state-built (mbuild-state {:deps deps + :http-request http-request + :acl-cfg acl-cfg + :auth auth}) + router-enter (select-interceptors router-interceptors :enter identity) + router-leave (select-interceptors router-interceptors :leave reverse) + controller-enter (select-interceptors controller-interceptors :enter identity) + controller-leave (select-interceptors controller-interceptors :leave reverse)] + (->> [[state-built] + router-enter + [route] + router-leave + controller-enter + [run-controller] + controller-leave] + (mapcat identity) + (apply m/>>=) + xiana/extract + :response))))) component/stop ~(fn [this] (dissoc this :handler))}))