Skip to content

Commit

Permalink
Merge branch 'KETTLE-75'
Browse files Browse the repository at this point in the history
* KETTLE-75:
  KETTLE-75: Updating for release 1.10.1
  KETTLE-75: Improvements to rendering of dataSource URLs when logged
  • Loading branch information
amb26 committed Feb 5, 2019
2 parents 113aed4 + 9b5d7d4 commit a9323f3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
5 changes: 4 additions & 1 deletion lib/dataSource-url.js
Expand Up @@ -226,7 +226,10 @@ kettle.dataSource.URL.censorRequestOptions = function (requestOptions, toCensor)
fluid.set(togo, key, "(SENSITIVE)");
}
});
togo.pathname = togo.path; // Compensate for our use of legacy member "path" throughout
// Compensate for our use of legacy member "path" throughout
var parsedPath = urlModule.parse(togo.path);
togo.pathname = parsedPath.pathname;
togo.search = parsedPath.search;
togo.url = urlModule.format(togo);
return togo;
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name": "kettle",
"description": "Declarative IoC-based framework for HTTP and WebSockets servers on node.js based on express and ws",
"version": "1.10.0",
"version": "1.10.1",
"author": {
"name": "The Fluid Project"
},
Expand Down
13 changes: 8 additions & 5 deletions tests/DataSourceURLTests.js
Expand Up @@ -71,20 +71,23 @@ fluid.defaults("kettle.tests.dataSource.https", {
// KETTLE-73 sensitive info in error test

kettle.tests.dataSource.testSensitiveErrorResponse = function (expected, data) {
console.log("Got error ", data);
jqUnit.assertEquals("Received expected status code", expected.statusCode, data.statusCode);
jqUnit.assertTrue("Expected string appeared", data.message.includes(expected.shouldAppear));
jqUnit.assertFalse("Unexpected string did not appear", data.message.includes(expected.shouldNotAppear));
jqUnit.assertTrue("Expected string should appear", data.message.includes(expected.shouldAppear));
expected.shouldNotAppear.forEach(function (shouldNotAppear) {
jqUnit.assertFalse("Unexpected string should not appear", data.message.includes(shouldNotAppear));
});
};

fluid.defaults("kettle.tests.dataSource.URL.sensitiveError", {
gradeNames: ["kettle.tests.singleRequest.config", "kettle.tests.simpleDataSourceTest"],
name: "w. Testing URL dataSource with sensitive info in URL",
expect: 2,
expect: 3,
components: {
dataSource: {
type: "kettle.dataSource.URL",
options: {
url: "http://secret-user:secret-password@localhost:8081/notfound"
url: "http://secret-user:secret-password@localhost:8081/notfound?search"
}
}
},
Expand All @@ -93,7 +96,7 @@ fluid.defaults("kettle.tests.dataSource.URL.sensitiveError", {
isError: true,
statusCode: 404,
shouldAppear: "SENSITIVE",
shouldNotAppear: "secret",
shouldNotAppear: ["secret", "%3F"],
message: "socket hang up while executing HTTP GET on url http://localhost:8081/"
},
invokers: {
Expand Down

0 comments on commit a9323f3

Please sign in to comment.