Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
/log/
/policies.db/
/rules.edn
/connector/log.json
2 changes: 1 addition & 1 deletion clj-ishare-client/deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
:aliases
{:dev {:extra-paths ["test" "test-resources"]}
:test {:extra-paths ["test" "test-resources"]
:extra-deps {org.clojure/core.async {:mvn/version "1.8.741"}
:extra-deps {org.clojure/core.async {:mvn/version "1.9.865"}
nl.jomco/clj-http-status-codes {:mvn/version "0.2"}
nl.jomco/with-resources {:mvn/version "0.1.2"}
org.bdinetwork/association-register {:local/root "../association-register"}
Expand Down
6 changes: 3 additions & 3 deletions connector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Short name: `logger`

Log incoming requests, response status and duration at `info` level.

Optional `props` will be evaluated in the "leave" or "error"
Optional `props` will be evaluated in the "leave"
phase and logged as diagnostic context, `props` should be a shallow
map with string keys.

Expand Down Expand Up @@ -146,7 +146,7 @@ When it fails to connect to the downstream server, respond with
Example:

```edn
[proxy (str "https://example.com" (get request :uri))]
[proxy "https://example.com"]
```

Note: this interceptor should always be the last in the list of
Expand Down Expand Up @@ -408,7 +408,7 @@ The following example is protected by a basic authentication username / password
[request update :headers assoc "authorization"
#join ["Basic " #b64 #join [#env! "BACKEND_USER" ":" #env! "BACKEND_PASS"]]]
[response update :headers assoc "x-bdi-connector" "passed"]
[proxy (str "http://backend:port/" (get request :uri))]]}
[proxy "http://backend:port/"]]}

{:match {}
:interceptors [[logger]
Expand Down
4 changes: 2 additions & 2 deletions connector/deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
org.bdinetwork/service-commons {:local/root "../service-commons"}

;; drip responses
org.clojure/core.async {:mvn/version "1.8.741"}
org.clojure/core.async {:mvn/version "1.9.865"}

org.clojure/tools.logging {:mvn/version "1.3.1"}
ch.qos.logback/logback-classic {:mvn/version "1.5.32"}

nl.jomco/clj-http-status-codes {:mvn/version "0.2"}
nl.jomco/passage {:git/url "https://codeberg.org/jomco/passage.git"
:git/sha "0d291ae5386d03e1b6a9a900b98e0183dfadeea9"}
:git/sha "01b55586e3824c3b81c715572c5c948af98a9343"}
manifold/manifold {:mvn/version "0.5.0"}
org.clojure/data.json {:mvn/version "2.5.2"}
ring/ring-core {:mvn/version "1.15.3"}
Expand Down
9 changes: 3 additions & 6 deletions connector/src/org/bdinetwork/connector/main.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@

(ns org.bdinetwork.connector.main
(:gen-class)
(:require [environ.core :refer [env]]
[nl.jomco.resources :refer [with-resources wait-until-interrupted]]
[org.bdinetwork.connector.system :as system]
(:require [org.bdinetwork.connector.system :as system]
[passage.main :as passage]))

(defn start!
[env]
(system/run-system (passage/config env passage/opt-specs)))

(defn -main [& _]
(with-resources [_sys (start! env)]
(wait-until-interrupted)))
(defn -main [& args]
(passage/run-system start! args))
4 changes: 2 additions & 2 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
ring/ring-mock {:mvn/version "0.6.2"}

;; clj-ishare-client tests
org.clojure/core.async {:mvn/version "1.8.741"}
org.clojure/core.async {:mvn/version "1.9.865"}

;; connector tests
ring/ring {:mvn/version "1.15.3"}}
Expand All @@ -48,7 +48,7 @@
:lint {:extra-deps {clj-kondo/clj-kondo {:mvn/version "RELEASE"}}
:main-opts ["-m" "clj-kondo.main"]}

:build {:deps {io.github.clojure/tools.build {:mvn/version "0.10.12"}
:build {:deps {io.github.clojure/tools.build {:mvn/version "0.10.13"}
slipset/deps-deploy {:mvn/version "RELEASE"}}
:ns-default build-lib}

Expand Down
3 changes: 2 additions & 1 deletion test-config/backend-connector.edn
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@
(if (get-in request [:params "without-token"])
"authorization"
"dummy")]
[proxy (str association-server-url "/parties/" party-id)]]}
[request update dissoc :query-string]
[proxy "/api/bdi/party" (str association-server-url "/parties/" party-id)]]}

;;;; noodlebar/oauth authentication and authorization

Expand Down
2 changes: 1 addition & 1 deletion test-config/rules.edn
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

[request assoc-in [:headers "x-api-key"] #env! BACKEND_API_KEY]
[request update :query-string str/replace "ownerId=NL.KVK." "ownerId=kvk%3a"] ; translate p8 to itv notation
[proxy (str #env! "BACKEND_URL" (get request :uri))]]}
[proxy #env! "BACKEND_URL"]]}

;; example access to audit log protected by basic
;; authentication (for demo purposes only!)
Expand Down
Loading