diff --git a/.secrets.baseline b/.secrets.baseline index 01b9a3bfe..1c5f0714c 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -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" @@ -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": [ @@ -107,7 +123,7 @@ "hashed_secret": "d5ff02fa48e492fac0a245ad63d1ae608e705c05", "is_secret": false, "is_verified": false, - "line_number": 68, + "line_number": 70, "type": "Secret Keyword", "verified_result": null }, @@ -115,7 +131,7 @@ "hashed_secret": "8f4bfc22c4fd7cb884f94ec175ff4a3284a174a1", "is_secret": false, "is_verified": false, - "line_number": 69, + "line_number": 71, "type": "Secret Keyword", "verified_result": null } @@ -125,7 +141,7 @@ "hashed_secret": "8f4bfc22c4fd7cb884f94ec175ff4a3284a174a1", "is_secret": false, "is_verified": false, - "line_number": 86, + "line_number": 90, "type": "Secret Keyword", "verified_result": null }, @@ -133,7 +149,7 @@ "hashed_secret": "f84f793e0af9ade37c8b927bc5091e98f35bf821", "is_secret": false, "is_verified": false, - "line_number": 88, + "line_number": 92, "type": "Secret Keyword", "verified_result": null }, @@ -141,7 +157,7 @@ "hashed_secret": "45c43fe97e3a06ab078b0eeff6fbe622cc417a25", "is_secret": false, "is_verified": false, - "line_number": 103, + "line_number": 107, "type": "Secret Keyword", "verified_result": null }, @@ -149,7 +165,7 @@ "hashed_secret": "99833a8b234b57b886a9aef1dba187fdd7ceece8", "is_secret": false, "is_verified": false, - "line_number": 105, + "line_number": 109, "type": "Secret Keyword", "verified_result": null } @@ -159,7 +175,7 @@ "hashed_secret": "d5ff02fa48e492fac0a245ad63d1ae608e705c05", "is_secret": false, "is_verified": false, - "line_number": 94, + "line_number": 97, "type": "Secret Keyword", "verified_result": null }, @@ -167,7 +183,7 @@ "hashed_secret": "8f4bfc22c4fd7cb884f94ec175ff4a3284a174a1", "is_secret": false, "is_verified": false, - "line_number": 95, + "line_number": 98, "type": "Secret Keyword", "verified_result": null }, @@ -175,7 +191,7 @@ "hashed_secret": "45a15668db917c293f16e8add0f5d801889e5923", "is_secret": false, "is_verified": false, - "line_number": 109, + "line_number": 112, "type": "Secret Keyword", "verified_result": null }, @@ -183,7 +199,7 @@ "hashed_secret": "65e622227634e8876cfa733000233fb80c6f0473", "is_secret": false, "is_verified": false, - "line_number": 110, + "line_number": 113, "type": "Secret Keyword", "verified_result": null } @@ -193,7 +209,7 @@ "hashed_secret": "8f4bfc22c4fd7cb884f94ec175ff4a3284a174a1", "is_secret": false, "is_verified": false, - "line_number": 101, + "line_number": 107, "type": "Secret Keyword", "verified_result": null }, @@ -201,7 +217,7 @@ "hashed_secret": "f84f793e0af9ade37c8b927bc5091e98f35bf821", "is_secret": false, "is_verified": false, - "line_number": 110, + "line_number": 116, "type": "Secret Keyword", "verified_result": null }, @@ -209,7 +225,7 @@ "hashed_secret": "45c43fe97e3a06ab078b0eeff6fbe622cc417a25", "is_secret": false, "is_verified": false, - "line_number": 144, + "line_number": 150, "type": "Secret Keyword", "verified_result": null }, @@ -217,7 +233,7 @@ "hashed_secret": "99833a8b234b57b886a9aef1dba187fdd7ceece8", "is_secret": false, "is_verified": false, - "line_number": 146, + "line_number": 152, "type": "Secret Keyword", "verified_result": null }, @@ -225,7 +241,7 @@ "hashed_secret": "c563e15142a4d1ab66222756647ec74606793569", "is_secret": false, "is_verified": false, - "line_number": 202, + "line_number": 208, "type": "Secret Keyword", "verified_result": null }, @@ -233,7 +249,7 @@ "hashed_secret": "65e622227634e8876cfa733000233fb80c6f0473", "is_secret": false, "is_verified": false, - "line_number": 203, + "line_number": 209, "type": "Secret Keyword", "verified_result": null } @@ -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 } @@ -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 } @@ -335,7 +351,7 @@ "hashed_secret": "85dd3fb12cb0dcae03f1bba6fb61f4edd90d986d", "is_secret": false, "is_verified": false, - "line_number": 7, + "line_number": 5, "type": "Secret Keyword", "verified_result": null }, @@ -343,7 +359,7 @@ "hashed_secret": "0c910ad3070d996b37a1c65f542b17adc3f962bc", "is_secret": false, "is_verified": false, - "line_number": 8, + "line_number": 6, "type": "Secret Keyword", "verified_result": null } @@ -353,7 +369,7 @@ "hashed_secret": "1572bd30ac06678a82df42b5913e5e52e27f9a12", "is_secret": false, "is_verified": false, - "line_number": 17, + "line_number": 15, "type": "Secret Keyword", "verified_result": null }, @@ -361,7 +377,7 @@ "hashed_secret": "16856d955c788df03735a24feb2e3ffefd91f3dc", "is_secret": false, "is_verified": false, - "line_number": 18, + "line_number": 16, "type": "Secret Keyword", "verified_result": null } @@ -371,7 +387,7 @@ "hashed_secret": "257368587362aab7f1180b4a5fe550ec26053e05", "is_secret": false, "is_verified": false, - "line_number": 16, + "line_number": 14, "type": "Secret Keyword", "verified_result": null }, @@ -379,7 +395,7 @@ "hashed_secret": "5c5a15a8b0b3e154d77746945e563ba40100681b", "is_secret": false, "is_verified": false, - "line_number": 19, + "line_number": 17, "type": "Secret Keyword", "verified_result": null }, @@ -387,7 +403,7 @@ "hashed_secret": "a3bf8418470bbb21ecdb24c28e38b446a3ab9b75", "is_secret": false, "is_verified": false, - "line_number": 50, + "line_number": 48, "type": "Secret Keyword", "verified_result": null }, @@ -395,7 +411,7 @@ "hashed_secret": "2c208e466e476d4d8cbe055832f40f04e4d5dd23", "is_secret": false, "is_verified": false, - "line_number": 55, + "line_number": 53, "type": "Secret Keyword", "verified_result": null }, @@ -403,7 +419,7 @@ "hashed_secret": "945db841c03e42eef2f3d0a4ff310e2f3b3e59ec", "is_secret": false, "is_verified": false, - "line_number": 80, + "line_number": 78, "type": "Secret Keyword", "verified_result": null } @@ -413,7 +429,7 @@ "hashed_secret": "62cdb7020ff920e5aa642c3d4066950dd1f01f4d", "is_secret": false, "is_verified": false, - "line_number": 204, + "line_number": 201, "type": "Secret Keyword", "verified_result": null }, @@ -421,7 +437,7 @@ "hashed_secret": "a7ef1be18bb8d37af79f3d87761a203378bf26a2", "is_secret": false, "is_verified": false, - "line_number": 403, + "line_number": 400, "type": "Secret Keyword", "verified_result": null } @@ -431,7 +447,7 @@ "hashed_secret": "4c65cd3f160d60f7ca28ca04fa60b9035132781c", "is_secret": false, "is_verified": false, - "line_number": 9, + "line_number": 7, "type": "Secret Keyword", "verified_result": null }, @@ -439,7 +455,7 @@ "hashed_secret": "407bb564bd0e4d31368cb53004c9c42adf8f7be8", "is_secret": false, "is_verified": false, - "line_number": 165, + "line_number": 163, "type": "Secret Keyword", "verified_result": null }, @@ -447,7 +463,7 @@ "hashed_secret": "2863fa4b5510c46afc2bd2998dfbc0cf3d6df032", "is_secret": false, "is_verified": false, - "line_number": 191, + "line_number": 189, "type": "Secret Keyword", "verified_result": null }, @@ -455,13 +471,13 @@ "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 diff --git a/Authentication.md b/Authentication.md index f4eaa33e5..cf883aa77 100644 --- a/Authentication.md +++ b/Authentication.md @@ -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 @@ -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'; @@ -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'; @@ -156,6 +167,7 @@ import { getAuthenticatorFromEnvironment } from 'ibm-cloud-sdk-core'; // MY_SERVICE_AUTH_URL= // MY_SERVICE_USERNAME= // MY_SERVICE_PASSWORD= +// MY_SERVICE_APIKEY= const cp4dAuthenticator = getAuthenticatorFromEnvironment('my-service'); ```