-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from martellj/feature/streaming-credential-fix
Streaming credentials bug fix and documentation changes
- Loading branch information
Showing
9 changed files
with
2,603 additions
and
2,240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,16 +13,29 @@ npm install git+https://[email protected]/dowjones/dj-dna-streams-javascript.git -- | |
|
||
Alternatively you can simply check out this project from Git. | ||
|
||
#### Authentication Options | ||
There are two credential types that can be used. | ||
|
||
Option 1. Service Account Id (service_account_id) | ||
|
||
Option 2. Client Credentials (user_id, client_id, password) | ||
|
||
#### Configuring The App | ||
|
||
There are three ways to pass configuration variables to the app. They are listed in increasing order of precendence (for example, if credentials or subscription ID are set via both options 1 and 2, the credentials set in option 2 will be used and those set in option 1 will be ignored). | ||
There are three ways to pass configuration variables to the app. Please note that environment variables (Option 1) will override values provided in the `customerConfig.json` file (Option 2). | ||
They will not override values passed directly to the `Listener` constructor (Option 3). | ||
|
||
Option 1. Modify the 'customerConfig.json' file. In this project's root you will find the 'customerConfig.json' file. Add your service account credentials (user_id, client_id, and password) and your subscription ID. Ensure your additions follow the JSON data format conventions. | ||
Option 1. Set environment variables. | ||
|
||
or | ||
###### Service Account ID | ||
|
||
Option 2. Set environment variables. | ||
**SERVICE_ACCOUNT_ID** | ||
Dow Jones provided Service Account ID. | ||
|
||
**SUBSCRIPTION_ID** | ||
This environment variable holds the subscription ID. | ||
|
||
###### Client Credentials | ||
|
||
**USER_ID** | ||
Dow Jones provided service account user ID. | ||
|
@@ -38,6 +51,30 @@ Option 2. Set environment variables. | |
|
||
Note that USER_ID, CLIENT_ID, and PASSWORD will all need to be set in order to pass credentials to the app in this way. If any one of these is not set, any others that are set will be ignored. | ||
|
||
Option 2. Modify the 'customerConfig.json' file. In this project's root you will find the 'customerConfig.json' file. Add your credentials and subscription ID. Ensure your additions follow the JSON data format conventions. | ||
|
||
###### Service Account Id | ||
|
||
``` | ||
{ | ||
"service_account_id": "<Dow Jones provided Service Account Id>", | ||
"subscription_id": "<Subscription ID returned upon stream creation>" | ||
} | ||
``` | ||
|
||
###### Client Credentials | ||
|
||
``` | ||
{ | ||
"user_id": "<Dow Jones provided service account user ID>", | ||
"client_id": "<Dow Jones provided service account client ID>", | ||
"password": "<Dow Jones provided service account password>", | ||
"subscription_id": "<Subscription ID returned upon stream creation>" | ||
} | ||
``` | ||
|
||
or | ||
|
||
Option 3: Passing values as function arguments. Specifically you can pass either the service account credentials and/or subscription ID. When you start a listener you can pass the service account crendentials to the Listener constructor as an object with the fields "user_id", "client_id", and "password", like so: | ||
|
||
~~~~ | ||
|
@@ -48,6 +85,13 @@ Option 3: Passing values as function arguments. Specifically you can pass either | |
}; | ||
const listener = new Listener({ | ||
/** | ||
Service Account ID | ||
*/ | ||
service_account_id: "<YOUR SERVICE ACCOUNT ID HERE>", | ||
/** | ||
Client Credentials | ||
*/ | ||
user_id: "<YOUR USER ID HERE>", | ||
client_id: "<YOUR CLIENT ID HERE>", | ||
password: "<YOUR PASSWORD HERE>" | ||
|
@@ -93,6 +137,16 @@ Step 1: Build the docker image. Execute the following command line: | |
|
||
Step 2: Run the docker image | ||
|
||
######Service Account ID | ||
|
||
~~~ | ||
docker run -it \ | ||
-e SERVICE_ACCOUNT_ID="<your service account ID"> \ | ||
-e SUBSCRIPTION_ID="<your subscription ID>" \ | ||
dj-dna-streaming-javascript | ||
~~~ | ||
|
||
######Client Credentials | ||
~~~ | ||
docker run -it \ | ||
-e USER_ID="<your user ID"> \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"service_account_id": "", | ||
"user_id": "", | ||
"client_id": "", | ||
"password": "", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.