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
12 changes: 6 additions & 6 deletions connector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,12 @@ Enforce BDI authentication on incoming requests and add "x-bdi-client-id" reques
Responds with 401 Unauthorized when request is not allowed. Example:

```
[bdi/authenticate {:server-id "EU.EORI.CONNECTOR"
:private-key #private-key "certs/connector.key.pem"
:public-key #public-key "certs/connector.cert.pem"
:x5c #x5c "certs/connector.x5c.pem"
:association-server-id "EU.EORI.ASSOCIATION-REGISTER"
:association-server-url "https://association-register.com"}]
[(bdi/authenticate {:server-id "EU.EORI.CONNECTOR"
:private-key #private-key "certs/connector.key.pem"
:public-key #public-key "certs/connector.cert.pem"
:x5c #x5c "certs/connector.x5c.pem"
:association-server-id "EU.EORI.ASSOCIATION-REGISTER"
:association-server-url "https://association-register.com"})]
```

---
Expand Down
14 changes: 7 additions & 7 deletions connector/src/org/bdinetwork/connector/interceptors.clj
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
Responds with 401 Unauthorized when request is not allowed. Example:

```
[bdi/authenticate {:server-id \"EU.EORI.CONNECTOR\"
:private-key #private-key \"certs/connector.key.pem\"
:public-key #public-key \"certs/connector.cert.pem\"
:x5c #x5c \"certs/connector.x5c.pem\"
:association-server-id \"EU.EORI.ASSOCIATION-REGISTER\"
:association-server-url \"https://association-register.com\"}]
[(bdi/authenticate {:server-id \"EU.EORI.CONNECTOR\"
:private-key #private-key \"certs/connector.key.pem\"
:public-key #public-key \"certs/connector.cert.pem\"
:x5c #x5c \"certs/connector.x5c.pem\"
:association-server-id \"EU.EORI.ASSOCIATION-REGISTER\"
:association-server-url \"https://association-register.com\"})]
```"
[config]
{:enter
Expand Down Expand Up @@ -181,7 +181,7 @@

;; for adherence test of server
:ishare/satellite-id association-id
:ishare/satellite-url association-url}
:ishare/satellite-base-url association-url}

(ishare-request/access-token-request path)
(ishare-client/exec))]
Expand Down
12 changes: 8 additions & 4 deletions connector/test/org/bdinetwork/connector/interceptors_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
[org.bdinetwork.test.system-helpers
:refer [association-system
association-server-id
association-server-url]]
association-server-url
backend-connector-system
backend-connector-url
backend-connector-id]]
[passage :as gateway]
[passage.interceptors]
[ring.adapter.jetty :refer [run-jetty]]
Expand Down Expand Up @@ -124,11 +127,12 @@


(deftest set-bearer-token
(with-resources [_association-system (association-system)]
(with-resources [_backend-connector-system (backend-connector-system)
_association-system (association-system)]
(let [{:keys [enter]} (interceptors/set-bearer-token)
config (assoc client-config
:server-id association-server-id
:base-url association-server-url
:server-id backend-connector-id
:base-url backend-connector-url
:association-id association-server-id
:association-url association-server-url)
ctx @(enter {} config)]
Expand Down