Skip to content

Commit

Permalink
Add Web socket authentication to deployment add.
Browse files Browse the repository at this point in the history
  • Loading branch information
mtho11 committed Sep 11, 2015
1 parent bbf721f commit 3802536
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions dist/hawkular-ui-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -757,8 +757,8 @@ var hawkularRest;
factory.performOperation = function (operation) {
ws.send('ExecuteOperationRequest=' + JSON.stringify(operation));
};
factory.performAddDeployOperation = function (resourcePath, destinationFileName, fileBinaryContent) {
var json = 'DeployApplicationRequest={\"resourcePath\": \"' + resourcePath + '\", \"destinationFileName\":\"' + destinationFileName + '\" }';
factory.performAddDeployOperation = function (resourcePath, destinationFileName, fileBinaryContent, authToken) {
var json = "DeployApplicationRequest={\"resourcePath\": \"" + resourcePath + "\",\n \"destinationFileName\":\"" + destinationFileName + "\"\n \"authentication:\"{\"token\":\"" + authToken + "\"} }";
var binaryblob = new Blob([json, fileBinaryContent], { type: 'application/octet-stream' });
console.log('DeployApplicationRequest: ' + json);
ws.send(binaryblob);
Expand Down
4 changes: 2 additions & 2 deletions dist/hawkular-ui-service.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -757,8 +757,8 @@ var hawkularRest;
factory.performOperation = function (operation) {
ws.send('ExecuteOperationRequest=' + JSON.stringify(operation));
};
factory.performAddDeployOperation = function (resourcePath, destinationFileName, fileBinaryContent) {
var json = 'DeployApplicationRequest={\"resourcePath\": \"' + resourcePath + '\", \"destinationFileName\":\"' + destinationFileName + '\" }';
factory.performAddDeployOperation = function (resourcePath, destinationFileName, fileBinaryContent, authToken) {
var json = "DeployApplicationRequest={\"resourcePath\": \"" + resourcePath + "\",\n \"destinationFileName\":\"" + destinationFileName + "\"\n \"authentication:\"{\"token\":\"" + authToken + "\"} }";
var binaryblob = new Blob([json, fileBinaryContent], { type: 'application/octet-stream' });
console.log('DeployApplicationRequest: ' + json);
ws.send(binaryblob);
Expand Down
6 changes: 4 additions & 2 deletions src/rest/hawkRest-ops-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,10 @@ module hawkularRest {
ws.send('ExecuteOperationRequest=' + JSON.stringify(operation));
};

factory.performAddDeployOperation = function (resourcePath, destinationFileName, fileBinaryContent) {
var json = 'DeployApplicationRequest={\"resourcePath\": \"' + resourcePath + '\", \"destinationFileName\":\"' + destinationFileName + '\" }';
factory.performAddDeployOperation = function (resourcePath, destinationFileName, fileBinaryContent, authToken) {
var json = `DeployApplicationRequest={"resourcePath": "${resourcePath}",
"destinationFileName":"${destinationFileName}"
"authentication:"{"token":"${authToken}"} }`;
var binaryblob = new Blob([json, fileBinaryContent], {type: 'application/octet-stream'});
console.log('DeployApplicationRequest: ' + json);
ws.send(binaryblob);
Expand Down

0 comments on commit 3802536

Please sign in to comment.