Skip to content
This repository was archived by the owner on Jan 22, 2024. It is now read-only.

Commit 6dedcb9

Browse files
committed
changes to support secure wcmdesigns
1 parent c04fa51 commit 6dedcb9

6 files changed

Lines changed: 34 additions & 33 deletions

File tree

digexp-dashboard/js/controllers/wcmDesignsController.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function($scope, $route) {
1717
$scope.configInfo = dashConfig.getConfigInfo();
1818
$scope.server = dashConfig.getServerForTool(dashConfig.tools.wcmDesigns);
1919
if ($scope.server != oldServer){
20-
wcmDesign.init($scope.server.host, $scope.server.port, $scope.server.contenthandlerPath, $scope.server.userName, $scope.server.password, $scope.configInfo.wcmDesignsPath);
20+
wcmDesign.init($scope.server.host, $scope.server.port, $scope.server.contenthandlerPath, $scope.server.userName, $scope.server.password, $scope.server.secure, $scope.configInfo.wcmDesignsPath);
2121
oldServer = $scope.server;
2222
}
2323

@@ -193,5 +193,5 @@ function($scope, $route) {
193193
watchProcesses[wcmDesign.title] = null;
194194
};
195195

196-
$scope.numOfLibs = function() { return Object.keys($scope.wcmDesigns).length }
196+
$scope.numOfLibs = function() { return Object.keys($scope.wcmDesigns).length; };
197197
}]);

digexp-dashboard/js/wcmDesign.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ var parseDate = function(dateStr) {
2222
var wcmDesign = (function() {
2323
return {
2424
wcmDesigns: wcmDesignMap,
25-
init: function( host, port, contenthandlerPath , userName, password, designsFolder){
26-
wcmHelper.init(host, port, contenthandlerPath , userName, password, designsFolder);
25+
init: function( host, port, contenthandlerPath , userName, password, secure, designsFolder){
26+
wcmHelper.init(host, port, contenthandlerPath , userName, password, secure, designsFolder);
2727
},
2828
getWcmDesigns:function () {
2929
/**

digexp-wcm-design/test/wcmHelper.js

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ var should = require("chai").should(),
1414

1515
const TEST_USERNAME = "wpsadmin";
1616
const TEST_PASSWORD = "wpsadmin";
17-
const TEST_HOST = "wpg-portal85-cf06.rtp.raleigh.ibm.com";
17+
const TEST_HOST = "gsagerwcmdesign.rtp.raleigh.ibm.com";
1818
const TEST_PORT = 10039;
1919
const TEST_CONTENT_HANDLER = "/wps/mycontenthandler";
20+
const TEST_SECURE = false;
2021

2122
const BAD_USERNAME = "justfortesting";
2223
const BAD_PASSWORD = "alsorgangrpgaasgoijgoah842948aofwehffortesting";
@@ -50,7 +51,7 @@ describe("getLibraries-valid-server", function() {
5051
before(function(done) {
5152
this.timeout(LONG_TIMEOUT);
5253
wcmHelper.init(TEST_HOST, TEST_PORT, TEST_CONTENT_HANDLER, TEST_USERNAME,
53-
TEST_PASSWORD, TESTING_FOLDER);
54+
TEST_PASSWORD, TEST_SECURE, TESTING_FOLDER);
5455
wcmHelper.getLibraries().then(function(items) {
5556
libraries = items;
5657
done();
@@ -83,7 +84,7 @@ describe("getLibraries-invalid-server", function() {
8384
this.timeout(LONG_TIMEOUT);
8485
var wcmHelper = require("../wcmHelper.js");
8586
wcmHelper.init(TEST_HOST, TEST_PORT, TEST_CONTENT_HANDLER, BAD_USERNAME,
86-
TEST_PASSWORD, TESTING_FOLDER);
87+
TEST_PASSWORD, TEST_SECURE, TESTING_FOLDER);
8788
return wcmHelper.getLibraries().then(function(items) {
8889
assert(!items, "NO libraries should be given when the username is invalid")
8990
console.log("DONE, NO ERROR");
@@ -99,7 +100,7 @@ describe("getLibraries-invalid-server", function() {
99100
this.timeout(LONG_TIMEOUT);
100101
var wcmHelper = require("../wcmHelper.js");
101102
wcmHelper.init(TEST_HOST, TEST_PORT, TEST_CONTENT_HANDLER, TEST_USERNAME,
102-
BAD_PASSWORD, TESTING_FOLDER);
103+
BAD_PASSWORD, TEST_SECURE, TESTING_FOLDER);
103104
return wcmHelper.getLibraries().then(function(items) {
104105
console.log("ITEMS!")
105106
// console.log(items)
@@ -114,7 +115,7 @@ describe("getLibraries-invalid-server", function() {
114115
var wcmHelper = require("../wcmHelper.js");
115116
this.timeout(LONG_TIMEOUT);
116117
wcmHelper.init(BAD_HOST, TEST_PORT, TEST_CONTENT_HANDLER, TEST_USERNAME,
117-
TEST_PASSWORD, TESTING_FOLDER);
118+
TEST_PASSWORD, TEST_SECURE, TESTING_FOLDER);
118119
return wcmHelper.getLibraries().then(function(items) {
119120
assert(!items, "NO libraries should be given when the host is invalid")
120121
should.fail("", "There should be an error if it's invalid");
@@ -128,7 +129,7 @@ describe("getLibraries-invalid-server", function() {
128129
this.timeout(LONG_TIMEOUT);
129130
var wcmHelper = require("../wcmHelper.js");
130131
wcmHelper.init(TEST_HOST, BAD_PORT, TEST_CONTENT_HANDLER, TEST_USERNAME,
131-
TEST_PASSWORD, TESTING_FOLDER);
132+
TEST_PASSWORD, TEST_SECURE, TESTING_FOLDER);
132133
return wcmHelper.getLibraries().then(function(items) {
133134
assert(!items, "NO libraries should be given when the port is invalid")
134135
should.fail("", "There should be an error if it's invalid");
@@ -142,7 +143,7 @@ describe("getLibraries-invalid-server", function() {
142143
this.timeout(LONG_TIMEOUT);
143144
var wcmHelper = require("../wcmHelper.js");
144145
wcmHelper.init(TEST_HOST, TEST_PORT, BAD_CONTENT_HANDLER, TEST_USERNAME,
145-
TEST_PASSWORD, TESTING_FOLDER);
146+
TEST_PASSWORD, TEST_SECURE, TESTING_FOLDER);
146147
wcmHelper.getLibraries().then(function(items) {
147148
assert(!items, "NO libraries should be given when the port is invalid")
148149
should.fail("", "There should be an error if it's invalid");
@@ -157,7 +158,7 @@ describe("getLibraries-invalid-server", function() {
157158
this.timeout(LONG_TIMEOUT);
158159
var wcmHelper = require("../wcmHelper.js");
159160
wcmHelper.init(TEST_HOST, TEST_PORT, BAD_CONTENT_HANDLER_WITH_SUBFOLDER, TEST_USERNAME,
160-
TEST_PASSWORD, TESTING_FOLDER);
161+
TEST_PASSWORD, TEST_SECURE, TESTING_FOLDER);
161162
wcmHelper.getLibraries().then(function(items) {
162163
assert(!items, "NO libraries should be given when the content handler is invalid")
163164
should.fail("", "There should be an error if it's invalid");
@@ -174,7 +175,7 @@ describe("pullLibrary-valid-server", function() {
174175
it("should-succeed-when-server-is-valid", function() {
175176
this.timeout(LONG_TIMEOUT);
176177
wcmHelper.init(TEST_HOST, TEST_PORT, TEST_CONTENT_HANDLER, TEST_USERNAME,
177-
TEST_PASSWORD, TESTING_FOLDER);
178+
TEST_PASSWORD, TEST_SECURE, TESTING_FOLDER);
178179
return wcmHelper.pullLibrary(TESTING_LIBRARY, {includeMeta: false}).then(function() {
179180
// success!
180181
}, function(err) {
@@ -187,7 +188,7 @@ describe("pullLibrary-valid-server-parallel", function() {
187188
it("should-succeed-when-server-is-valid", function() {
188189
this.timeout(LONG_TIMEOUT);
189190
wcmHelper.init(TEST_HOST, TEST_PORT, TEST_CONTENT_HANDLER, TEST_USERNAME,
190-
TEST_PASSWORD, TESTING_FOLDER);
191+
TEST_PASSWORD, TEST_SECURE, TESTING_FOLDER);
191192
return wcmHelper.pullLibrary(TESTING_LIBRARY, {includeMeta: false, pullParallel: true}).then(function() {
192193
// success!
193194
}, function(err) {
@@ -200,7 +201,7 @@ describe("pullLibrary-invalid-server", function() {
200201
it("should-fail-when-given-an-invalid-host", function() {
201202
this.timeout(LONG_TIMEOUT);
202203
wcmHelper.init(BAD_HOST, TEST_PORT, TEST_CONTENT_HANDLER, TEST_USERNAME,
203-
TEST_PASSWORD, TESTING_FOLDER);
204+
TEST_PASSWORD, TEST_SECURE, TESTING_FOLDER);
204205
return wcmHelper.pullLibrary(TESTING_LIBRARY, {includeMeta: false}).then(function(items) {
205206
fail("Expected an error");
206207
}, function(err) {
@@ -212,7 +213,7 @@ describe("pullLibrary-invalid-server", function() {
212213
it("should-fail-when-given-an-invalid-port", function() {
213214
this.timeout(LONG_TIMEOUT);
214215
wcmHelper.init(TEST_HOST, BAD_PORT, TEST_CONTENT_HANDLER, TEST_USERNAME,
215-
TEST_PASSWORD, TESTING_FOLDER);
216+
TEST_PASSWORD, TEST_SECURE, TESTING_FOLDER);
216217
return wcmHelper.pullLibrary(TESTING_LIBRARY, {includeMeta: false}).then(function() {
217218
fail("Expected an error");
218219
}, function(err) {
@@ -224,7 +225,7 @@ describe("pullLibrary-invalid-server", function() {
224225
it("should-fail-when-given-an-invalid-content-handler", function() {
225226
this.timeout(LONG_TIMEOUT);
226227
wcmHelper.init(TEST_HOST, TEST_PORT, BAD_CONTENT_HANDLER, TEST_USERNAME,
227-
TEST_PASSWORD, TESTING_FOLDER);
228+
TEST_PASSWORD, TEST_SECURE, TESTING_FOLDER);
228229
return wcmHelper.pullLibrary(TESTING_LIBRARY, {includeMeta: false}).then(function() {
229230
fail("Expected an error");
230231
}, function(err) {
@@ -236,7 +237,7 @@ describe("pullLibrary-invalid-server", function() {
236237
it("should-fail-when-given-an-invalid-content-handler-subfolder", function() {
237238
this.timeout(LONG_TIMEOUT);
238239
wcmHelper.init(TEST_HOST, TEST_PORT, BAD_CONTENT_HANDLER_WITH_SUBFOLDER, TEST_USERNAME,
239-
TEST_PASSWORD, TESTING_FOLDER);
240+
TEST_PASSWORD, TEST_SECURE, TESTING_FOLDER);
240241
return wcmHelper.pullLibrary(TESTING_LIBRARY, {includeMeta: false}).then(function(items) {
241242
console.log("NO ERROR")
242243
fail("Expected an error");
@@ -250,7 +251,7 @@ describe("pullLibrary-invalid-server", function() {
250251
it("should-fail-when-given-an-invalid-username", function() {
251252
this.timeout(LONG_TIMEOUT);
252253
wcmHelper.init(TEST_HOST, TEST_PORT, TEST_CONTENT_HANDLER, BAD_USERNAME,
253-
TEST_PASSWORD, TESTING_FOLDER);
254+
TEST_PASSWORD, TEST_SECURE, TESTING_FOLDER);
254255
return wcmHelper.pullLibrary(TESTING_LIBRARY, {includeMeta: false}).then(function(items) {
255256
console.log("NO ERROR")
256257
fail("Expected an error");
@@ -264,7 +265,7 @@ describe("pullLibrary-invalid-server", function() {
264265
it("should-fail-when-given-an-invalid-password", function() {
265266
this.timeout(LONG_TIMEOUT);
266267
wcmHelper.init(TEST_HOST, TEST_PORT, TEST_CONTENT_HANDLER, TEST_USERNAME,
267-
BAD_PASSWORD, TESTING_FOLDER);
268+
BAD_PASSWORD, TEST_SECURE, TESTING_FOLDER);
268269
return wcmHelper.pullLibrary(TESTING_LIBRARY, {includeMeta: false}).then(function(items) {
269270
console.log("NO ERROR")
270271
fail("Expected an error");
@@ -280,7 +281,7 @@ describe("pushLibrary-valid-server", function() {
280281
it("should-succeed-when-server-is-valid", function(done) {
281282
this.timeout(LONG_TIMEOUT);
282283
wcmHelper.init(TEST_HOST, TEST_PORT, TEST_CONTENT_HANDLER, TEST_USERNAME,
283-
TEST_PASSWORD, TESTING_FOLDER);
284+
TEST_PASSWORD, TEST_SECURE, TESTING_FOLDER);
284285
wcmHelper.pushLibrary(TESTING_LIBRARY, true).then(function() {
285286
expect(true).to.equal(true);
286287
done();
@@ -300,7 +301,7 @@ describe("pushLibrary-invalid-server", function() {
300301
it("should-fail-when-given-an-invalid-host", function() {
301302
this.timeout(LONG_TIMEOUT);
302303
wcmHelper.init(BAD_HOST, TEST_PORT, TEST_CONTENT_HANDLER, TEST_USERNAME,
303-
TEST_PASSWORD, TESTING_FOLDER);
304+
TEST_PASSWORD, TEST_SECURE, TESTING_FOLDER);
304305
return wcmHelper.pushLibrary(TESTING_LIBRARY, true).then(function() {
305306
fail("Expected an error");
306307
}, function(err) {
@@ -313,7 +314,7 @@ describe("pushLibrary-invalid-server", function() {
313314
it("should-fail-when-given-an-invalid-port", function() {
314315
this.timeout(LONG_TIMEOUT);
315316
wcmHelper.init(TEST_HOST, BAD_PORT, TEST_CONTENT_HANDLER, TEST_USERNAME,
316-
TEST_PASSWORD, TESTING_FOLDER);
317+
TEST_PASSWORD, TEST_SECURE, TESTING_FOLDER);
317318
return wcmHelper.pushLibrary(TESTING_LIBRARY, true).then(function() {
318319
console.log("DONE WITHOUT AN ERROR")
319320
fail("Expected an error");
@@ -327,7 +328,7 @@ describe("pushLibrary-invalid-server", function() {
327328
it("should-fail-when-port-is-out-of-range", function() {
328329
this.timeout(LONG_TIMEOUT);
329330
wcmHelper.init(TEST_HOST, 99999999, TEST_CONTENT_HANDLER, TEST_USERNAME,
330-
TEST_PASSWORD, TESTING_FOLDER);
331+
TEST_PASSWORD, TEST_SECURE, TESTING_FOLDER);
331332
return wcmHelper.pushLibrary(TESTING_LIBRARY, true).then(function() {
332333
fail("Expected an error");
333334
}, function(err) {
@@ -341,7 +342,7 @@ describe("pushLibrary-invalid-server", function() {
341342
this.timeout(LONG_TIMEOUT);
342343

343344
wcmHelper.init(TEST_HOST, TEST_PORT, BAD_CONTENT_HANDLER, TEST_USERNAME,
344-
TEST_PASSWORD, TESTING_FOLDER);
345+
TEST_PASSWORD, TEST_SECURE, TESTING_FOLDER);
345346
return wcmHelper.pushLibrary(TESTING_LIBRARY, true).then(function() {
346347
console.log("NO ERROR")
347348
fail("Expected an error");
@@ -355,7 +356,7 @@ describe("pushLibrary-invalid-server", function() {
355356
it("should-fail-when-given-an-invalid-content-handler-subfolder", function() {
356357
this.timeout(LONG_TIMEOUT);
357358
wcmHelper.init(TEST_HOST, TEST_PORT, BAD_CONTENT_HANDLER_WITH_SUBFOLDER, TEST_USERNAME,
358-
TEST_PASSWORD, TESTING_FOLDER);
359+
TEST_PASSWORD, TEST_SECURE, TESTING_FOLDER);
359360
return wcmHelper.pushLibrary(TESTING_LIBRARY, true).then(function() {
360361
console.log("NO ERROR")
361362
fail("Expected an error");
@@ -369,7 +370,7 @@ describe("pushLibrary-invalid-server", function() {
369370
it("should-fail-when-given-an-invalid-username", function() {
370371
this.timeout(LONG_TIMEOUT);
371372
wcmHelper.init(TEST_HOST, TEST_PORT, TEST_CONTENT_HANDLER, BAD_USERNAME,
372-
TEST_PASSWORD, TESTING_FOLDER);
373+
TEST_PASSWORD, TEST_SECURE, TESTING_FOLDER);
373374
return wcmHelper.pushLibrary(TESTING_LIBRARY, true).then(function() {
374375
fail("Expected an error");
375376
}, function(err) {
@@ -381,7 +382,7 @@ describe("pushLibrary-invalid-server", function() {
381382
it("should-fail-when-given-an-invalid-password", function() {
382383
this.timeout(LONG_TIMEOUT);
383384
wcmHelper.init(TEST_HOST, TEST_PORT, TEST_CONTENT_HANDLER, TEST_USERNAME,
384-
BAD_PASSWORD, TESTING_FOLDER);
385+
BAD_PASSWORD, TEST_SECURE, TESTING_FOLDER);
385386
return wcmHelper.pushLibrary(TESTING_LIBRARY, true).then(function() {
386387
fail("Expected an error");
387388
}, function(err) {

digexp-wcm-design/wcmHelper.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,16 @@ var authRequest = require('./lib/wcm-authenticated-request'),
5454
* These will reset to 0 when the operation(s) is completed.
5555
*/
5656
var progCounter = 0, progGoal = 0;
57-
init = function(host, port, contentPath, user, password, wcmDir) {
58-
debugLogger.trace("init:: host::"+host +" port::" + port + "contentPath::" + contentPath + "user::" + user + "password::" + password + "wcmDir::" + wcmDir);
57+
init = function(host, port, contentPath, user, password, secure, wcmDir) {
58+
debugLogger.trace("init:: host::"+host +" port::" + port + "contentPath::" + contentPath + "user::" + user + "secure::" + secure + "wcmDir::" + wcmDir);
5959
wcmRequests.clearFolderMap();
6060
wcmCwd = wcmDir + Path.sep;
6161
curUser = user;
6262
curPassword = password;
6363
curHost = host;
6464
curPort = port;
6565
curContentPath = contentPath;
66-
return authRequest.init(host, port, user, password, contentPath);
66+
return authRequest.init(host, port, user, password, contentPath, secure);
6767
}, getLibraries = function() {
6868
var libraries = [];
6969
return wcmRequests.getAllLibraries().then(function(items) {

digexp-wcm-design/wcmHelperTest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
wcmHelper = require('./wcmHelper');
1212
// wcmHelper.init('gsagercf05trans.rtp.raleigh.ibm.com', 10039, '/wps/mycontenthandler', 'wpsadmin', 'wpsadmin','C:/awcm1');
13-
wcmHelper.init('gsagerwcmdesign.rtp.raleigh.ibm.com', 10039, '/wps/mycontenthandler/Gws', 'wpsadmin', 'wpsadmin','c:\awcm1').then(function(){
13+
wcmHelper.init('gsagerwcmdesign.rtp.raleigh.ibm.com', 10039, '/wps/mycontenthandler/Gws', 'wpsadmin', 'wpsadmin', false, 'c:\awcm1').then(function(){
1414
try{
1515
var libs = wcmHelper.getLibraries().then(function(){
1616
wcmHelper.pullLibrary('Web Content').then(function(count) {

digexp-wcm-design/wcmdesigns.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ var init = function() {
147147
var initWcmHelper = function(settings, dir) {
148148
dir = dir || cwd;
149149
return wcmHelper.init(settings.host, settings.port, settings.contenthandlerPath,
150-
settings.username, settings.password, dir);
150+
settings.username, settings.password, settings.secure, dir);
151151
};
152152

153153
var chooseLibraries = function(settings) {

0 commit comments

Comments
 (0)