From 2e6093c4efc4697083081c33c6633d9109a75c9d Mon Sep 17 00:00:00 2001
From: Dan Jones <dan.jones@noc.ac.uk>
Date: Wed, 11 Jan 2023 16:09:21 +0000
Subject: [PATCH] fix: pass config to adapter constructor

- Update README with install instructions for private repo
- Move location of soar-config.json import from adapter to
  the host of the adapter.
---
 README.md              | 16 ++++++++++++++--
 comms-adapter/index.js |  3 +--
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md
index 071b770..e3ef52e 100644
--- a/README.md
+++ b/README.md
@@ -12,14 +12,26 @@ Implements:
 
 ## Install
 
-**TODO** These should work once the repository is made public
-
 ### Yarn
 
+#### Once public 
+
 ```yarn
 yarn add git+https://git.noc.ac.uk/communications-backbone-system/backbone-adapter-javascript.git
 ```
 
+#### For now 
+
+```yarn
+# You may need to tell it how to use your ssh key
+eval `ssh-agent -s` 
+ssh-add ~/.ssh/id_rsa  
+export GIT_SSH_COMMAND="/usr/bin/ssh -i /home/danjon/.ssh/id_rsa -o IdentitiesOnly=yes"
+
+# Then you can install the private repo via ssh
+yarn add ssh://git@git.noc.ac.uk:communications-backbone-system/backbone-adapter-javascript.git#1-import-prototype-adapter-code-from-example-web-client
+```
+
 ### NPM
 
 ```npm
diff --git a/comms-adapter/index.js b/comms-adapter/index.js
index e3cc98d..33b6849 100644
--- a/comms-adapter/index.js
+++ b/comms-adapter/index.js
@@ -1,12 +1,11 @@
 import Validator from 'swagger-model-validator';
 import axios from 'axios';
-import * as soarConfig from '~/soar-config.json';
 
 /**
  * Handle authentication and send/receive with the backbone
  */
 export class Adapter {
-  constructor(protocol) {
+  constructor(protocol, soarConfig) {
     this.apiRoot = soarConfig.api;
     this.protocol = protocol;
     this.axios = axios;
-- 
GitLab