@itentialopensource/adapter-utils 4.45.5 → 4.45.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/lib/connectorRest.js +12 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/lib/connectorRest.js
CHANGED
|
@@ -1865,11 +1865,12 @@ function buildTokenRequest(reqPath, reqBody, callProperties, callback) {
|
|
|
1865
1865
|
let bodyString = null;
|
|
1866
1866
|
|
|
1867
1867
|
// if we have been passed a schema and the Authorization is in a header
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1868
|
+
// COMMENTED OUT AND HANDLED IN IF BELOW - take stuff out of body on line 1930
|
|
1869
|
+
// if (tokenSchema && tokenSchema.headers && tokenSchema.headers.Authorization) {
|
|
1870
|
+
// // request the token
|
|
1871
|
+
// options.headers['Content-length'] = 0;
|
|
1872
|
+
// return getToken(reqPath, options, tokenSchema, '', callProperties, callback);
|
|
1873
|
+
// }
|
|
1873
1874
|
if (tokenSchema) {
|
|
1874
1875
|
// if this is a get, need to put the username on the url
|
|
1875
1876
|
if (options.path.indexOf('/{username}') >= 0) {
|
|
@@ -1926,6 +1927,12 @@ function buildTokenRequest(reqPath, reqBody, callProperties, callback) {
|
|
|
1926
1927
|
}
|
|
1927
1928
|
}
|
|
1928
1929
|
|
|
1930
|
+
if (tokenSchema.headers && tokenSchema.headers.Authorization) {
|
|
1931
|
+
// remove the username and password from the creds
|
|
1932
|
+
delete creds.username;
|
|
1933
|
+
delete creds.password;
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1929
1936
|
// map the data we received to an Entity - will get back the defaults
|
|
1930
1937
|
const tokenEntity = transUtilInst.mapToOutboundEntity(creds, tokenSchema.requestSchema);
|
|
1931
1938
|
bodyString = tokenEntity;
|