Skip to content

Commit

Permalink
Add persona to web socket authentication.
Browse files Browse the repository at this point in the history
  • Loading branch information
mtho11 committed Sep 11, 2015
1 parent 269b4fa commit c979911
Show file tree
Hide file tree
Showing 3 changed files with 10 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 @@ -758,8 +758,8 @@ var hawkularRest;
factory.performOperation = function (operation) {
ws.send('ExecuteOperationRequest=' + JSON.stringify(operation));
};
factory.performAddDeployOperation = function (resourcePath, destinationFileName, fileBinaryContent, authToken) {
var json = "DeployApplicationRequest={\"resourcePath\": \"" + resourcePath + "\",\n \"destinationFileName\":\"" + destinationFileName + "\"\n \"authentication:\"{\"token\":\"" + authToken + "\"} }";
factory.performAddDeployOperation = function (resourcePath, destinationFileName, fileBinaryContent, authToken, personaId) {
var json = "DeployApplicationRequest={\"resourcePath\": \"" + resourcePath + "\",\n \"destinationFileName\":\"" + destinationFileName + "\"\n \"authentication:\"{\"token\":\"" + authToken + "\", \"persona\":\"" + personaId + "\" } }";
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 @@ -758,8 +758,8 @@ var hawkularRest;
factory.performOperation = function (operation) {
ws.send('ExecuteOperationRequest=' + JSON.stringify(operation));
};
factory.performAddDeployOperation = function (resourcePath, destinationFileName, fileBinaryContent, authToken) {
var json = "DeployApplicationRequest={\"resourcePath\": \"" + resourcePath + "\",\n \"destinationFileName\":\"" + destinationFileName + "\"\n \"authentication:\"{\"token\":\"" + authToken + "\"} }";
factory.performAddDeployOperation = function (resourcePath, destinationFileName, fileBinaryContent, authToken, personaId) {
var json = "DeployApplicationRequest={\"resourcePath\": \"" + resourcePath + "\",\n \"destinationFileName\":\"" + destinationFileName + "\"\n \"authentication:\"{\"token\":\"" + authToken + "\", \"persona\":\"" + personaId + "\" } }";
var binaryblob = new Blob([json, fileBinaryContent], { type: 'application/octet-stream' });
console.log('DeployApplicationRequest: ' + json);
ws.send(binaryblob);
Expand Down
8 changes: 6 additions & 2 deletions src/rest/hawkRest-ops-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,14 @@ module hawkularRest {
ws.send('ExecuteOperationRequest=' + JSON.stringify(operation));
};

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

0 comments on commit c979911

Please sign in to comment.