Skip to content

Commit

Permalink
docs: document apikey option in CP4D authenticator (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
barrett-schonefeld authored Jul 1, 2021
1 parent a092012 commit f424e47
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 38 deletions.
86 changes: 51 additions & 35 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "package-lock.json|^.secrets.baseline$",
"lines": null
},
"generated_at": "2021-03-12T14:27:43Z",
"generated_at": "2021-06-29T19:23:55Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down Expand Up @@ -80,6 +80,22 @@
"line_number": 121,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "24c3d19b8d127fe8f7274108156a718ec56fc6e6",
"is_secret": false,
"is_verified": false,
"line_number": 135,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "32e8612d8ca77c7ea8374aa7918db8e5df9252ed",
"is_secret": false,
"is_verified": false,
"line_number": 170,
"type": "Secret Keyword",
"verified_result": null
}
],
"MIGRATION-V1.md": [
Expand Down Expand Up @@ -107,15 +123,15 @@
"hashed_secret": "d5ff02fa48e492fac0a245ad63d1ae608e705c05",
"is_secret": false,
"is_verified": false,
"line_number": 68,
"line_number": 70,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "8f4bfc22c4fd7cb884f94ec175ff4a3284a174a1",
"is_secret": false,
"is_verified": false,
"line_number": 69,
"line_number": 71,
"type": "Secret Keyword",
"verified_result": null
}
Expand All @@ -125,31 +141,31 @@
"hashed_secret": "8f4bfc22c4fd7cb884f94ec175ff4a3284a174a1",
"is_secret": false,
"is_verified": false,
"line_number": 86,
"line_number": 90,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "f84f793e0af9ade37c8b927bc5091e98f35bf821",
"is_secret": false,
"is_verified": false,
"line_number": 88,
"line_number": 92,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "45c43fe97e3a06ab078b0eeff6fbe622cc417a25",
"is_secret": false,
"is_verified": false,
"line_number": 103,
"line_number": 107,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "99833a8b234b57b886a9aef1dba187fdd7ceece8",
"is_secret": false,
"is_verified": false,
"line_number": 105,
"line_number": 109,
"type": "Secret Keyword",
"verified_result": null
}
Expand All @@ -159,31 +175,31 @@
"hashed_secret": "d5ff02fa48e492fac0a245ad63d1ae608e705c05",
"is_secret": false,
"is_verified": false,
"line_number": 94,
"line_number": 97,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "8f4bfc22c4fd7cb884f94ec175ff4a3284a174a1",
"is_secret": false,
"is_verified": false,
"line_number": 95,
"line_number": 98,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "45a15668db917c293f16e8add0f5d801889e5923",
"is_secret": false,
"is_verified": false,
"line_number": 109,
"line_number": 112,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "65e622227634e8876cfa733000233fb80c6f0473",
"is_secret": false,
"is_verified": false,
"line_number": 110,
"line_number": 113,
"type": "Secret Keyword",
"verified_result": null
}
Expand All @@ -193,47 +209,47 @@
"hashed_secret": "8f4bfc22c4fd7cb884f94ec175ff4a3284a174a1",
"is_secret": false,
"is_verified": false,
"line_number": 101,
"line_number": 107,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "f84f793e0af9ade37c8b927bc5091e98f35bf821",
"is_secret": false,
"is_verified": false,
"line_number": 110,
"line_number": 116,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "45c43fe97e3a06ab078b0eeff6fbe622cc417a25",
"is_secret": false,
"is_verified": false,
"line_number": 144,
"line_number": 150,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "99833a8b234b57b886a9aef1dba187fdd7ceece8",
"is_secret": false,
"is_verified": false,
"line_number": 146,
"line_number": 152,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "c563e15142a4d1ab66222756647ec74606793569",
"is_secret": false,
"is_verified": false,
"line_number": 202,
"line_number": 208,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "65e622227634e8876cfa733000233fb80c6f0473",
"is_secret": false,
"is_verified": false,
"line_number": 203,
"line_number": 209,
"type": "Secret Keyword",
"verified_result": null
}
Expand All @@ -243,7 +259,7 @@
"hashed_secret": "6947818ac409551f11fbaa78f0ea6391960aa5b8",
"is_secret": false,
"is_verified": false,
"line_number": 49,
"line_number": 47,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down Expand Up @@ -325,7 +341,7 @@
"hashed_secret": "09f798553f7c035c2915bf8c59b46b6c285d2d84",
"is_secret": false,
"is_verified": false,
"line_number": 6,
"line_number": 4,
"type": "Secret Keyword",
"verified_result": null
}
Expand All @@ -335,15 +351,15 @@
"hashed_secret": "85dd3fb12cb0dcae03f1bba6fb61f4edd90d986d",
"is_secret": false,
"is_verified": false,
"line_number": 7,
"line_number": 5,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "0c910ad3070d996b37a1c65f542b17adc3f962bc",
"is_secret": false,
"is_verified": false,
"line_number": 8,
"line_number": 6,
"type": "Secret Keyword",
"verified_result": null
}
Expand All @@ -353,15 +369,15 @@
"hashed_secret": "1572bd30ac06678a82df42b5913e5e52e27f9a12",
"is_secret": false,
"is_verified": false,
"line_number": 17,
"line_number": 15,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "16856d955c788df03735a24feb2e3ffefd91f3dc",
"is_secret": false,
"is_verified": false,
"line_number": 18,
"line_number": 16,
"type": "Secret Keyword",
"verified_result": null
}
Expand All @@ -371,39 +387,39 @@
"hashed_secret": "257368587362aab7f1180b4a5fe550ec26053e05",
"is_secret": false,
"is_verified": false,
"line_number": 16,
"line_number": 14,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "5c5a15a8b0b3e154d77746945e563ba40100681b",
"is_secret": false,
"is_verified": false,
"line_number": 19,
"line_number": 17,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "a3bf8418470bbb21ecdb24c28e38b446a3ab9b75",
"is_secret": false,
"is_verified": false,
"line_number": 50,
"line_number": 48,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "2c208e466e476d4d8cbe055832f40f04e4d5dd23",
"is_secret": false,
"is_verified": false,
"line_number": 55,
"line_number": 53,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "945db841c03e42eef2f3d0a4ff310e2f3b3e59ec",
"is_secret": false,
"is_verified": false,
"line_number": 80,
"line_number": 78,
"type": "Secret Keyword",
"verified_result": null
}
Expand All @@ -413,15 +429,15 @@
"hashed_secret": "62cdb7020ff920e5aa642c3d4066950dd1f01f4d",
"is_secret": false,
"is_verified": false,
"line_number": 204,
"line_number": 201,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "a7ef1be18bb8d37af79f3d87761a203378bf26a2",
"is_secret": false,
"is_verified": false,
"line_number": 403,
"line_number": 400,
"type": "Secret Keyword",
"verified_result": null
}
Expand All @@ -431,37 +447,37 @@
"hashed_secret": "4c65cd3f160d60f7ca28ca04fa60b9035132781c",
"is_secret": false,
"is_verified": false,
"line_number": 9,
"line_number": 7,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "407bb564bd0e4d31368cb53004c9c42adf8f7be8",
"is_secret": false,
"is_verified": false,
"line_number": 165,
"line_number": 163,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "2863fa4b5510c46afc2bd2998dfbc0cf3d6df032",
"is_secret": false,
"is_verified": false,
"line_number": 191,
"line_number": 189,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "ed8c99e906cf3fdbae90a71e06142ebc72b4c056",
"is_secret": false,
"is_verified": false,
"line_number": 209,
"line_number": 207,
"type": "Secret Keyword",
"verified_result": null
}
]
},
"version": "0.13.1+ibm.31.dss",
"version": "0.13.1+ibm.35.dss",
"word_list": {
"file": null,
"hash": null
Expand Down
18 changes: 15 additions & 3 deletions Authentication.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Authentication
The node-sdk-core project supports the following types of authentication:
- Basic Authentication
- Bearer Token
- Bearer Token
- Identity and Access Management (IAM)
- Cloud Pak for Data
- No Authentication
Expand Down Expand Up @@ -131,12 +131,13 @@ The `CloudPakForDataAuthenticator` will accept user-supplied username and passwo

### Properties
- username: (required) the username used to obtain a bearer token.
- password: (required) the password used to obtain a bearer token.
- password: (password or apikey required) the password used to obtain a bearer token.
- apikey: (password or apikey required) the API key used to obtain a bearer token.
- url: (required) The URL representing the Cloud Pak for Data token service endpoint.
- disableSslVerification: (optional) A flag that indicates whether verificaton of the server's SSL certificate should be disabled or not. The default value is `false`.
- headers: (optional) A set of key/value pairs that will be sent as HTTP headers in requests made to the IAM token service.

### Programming example
### Programming examples
```js
import { CloudPakForDataAuthenticator } from 'ibm-cloud-sdk-core';

Expand All @@ -147,6 +148,16 @@ const authenticator = new CloudPakForDataAuthenticator({
});
```

```js
import { CloudPakForDataAuthenticator } from 'ibm-cloud-sdk-core';

const authenticator = new CloudPakForDataAuthenticator({
username: '{username}',
apikey: '{apikey}',
url: '{url}',
});
```

### External configuration example
```js
import { getAuthenticatorFromEnvironment } from 'ibm-cloud-sdk-core';
Expand All @@ -156,6 +167,7 @@ import { getAuthenticatorFromEnvironment } from 'ibm-cloud-sdk-core';
// MY_SERVICE_AUTH_URL=<url>
// MY_SERVICE_USERNAME=<username>
// MY_SERVICE_PASSWORD=<password>
// MY_SERVICE_APIKEY=<apikey>
const cp4dAuthenticator = getAuthenticatorFromEnvironment('my-service');
```

Expand Down

0 comments on commit f424e47

Please sign in to comment.