From aa60945d2903ff60c4cdeebae76fbf569c91e444 Mon Sep 17 00:00:00 2001 From: Patrick Brady Date: Thu, 26 Mar 2020 16:14:17 -0700 Subject: Revert "Authentication support for cdt" There appear to be problems with some fields saving in cdt caused by this change. This reverts commit 0141df20b1f533cd2acabdf7ea986aebab8d6868. Change-Id: Iee40058de9870afdac608db7851fcfc206102822 Signed-off-by: Patrick Brady Issue-ID: APPC-1854 --- .../appc/cdt/service/controller/CdtController.java | 36 ++++----- .../src/main/resources/application.properties | 2 + src/app/admin/admin.component.ts | 14 ++-- .../admin/view-edit/ansible-server.component.ts | 4 +- .../navigation/navigation.component.spec.ts | 6 +- .../components/navigation/navigation.component.ts | 12 +-- .../shared/services/httpUtil/http-util.service.ts | 25 +----- .../services/utilityService/utility.service.ts | 12 +-- src/app/test/test.component.ts | 10 +-- src/app/vnfs/GCAuthGuard/gcauth.guard.spec.ts | 4 +- .../vnfs/LoginGuardService/Login-guard-service.ts | 6 +- .../LoginGuardService/LoginGuardService.spec.ts | 4 +- .../parameter-definition.service.ts | 8 +- .../parameter-definitions/parameter.component.ts | 6 +- .../reference-dataform.component.ts | 4 +- .../param-name-value/param-name-value.component.ts | 8 +- .../template-configuration.component.ts | 6 +- src/app/vnfs/myvnfs/myvnfs.component.ts | 10 +-- .../userlogin-form/userlogin-form.component.html | 8 +- .../userlogin-form.component.spec.ts | 6 +- .../userlogin-form/userlogin-form.component.ts | 89 +++------------------- 21 files changed, 93 insertions(+), 187 deletions(-) diff --git a/CdtProxyService/src/main/java/org/onap/appc/cdt/service/controller/CdtController.java b/CdtProxyService/src/main/java/org/onap/appc/cdt/service/controller/CdtController.java index bdb12e5..78a94f6 100644 --- a/CdtProxyService/src/main/java/org/onap/appc/cdt/service/controller/CdtController.java +++ b/CdtProxyService/src/main/java/org/onap/appc/cdt/service/controller/CdtController.java @@ -1,7 +1,7 @@ /* ============LICENSE_START========================================== =================================================================== -Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved. +Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. =================================================================== Unless otherwise specified, all software contained herein is licensed @@ -41,7 +41,6 @@ import org.springframework.web.client.RestTemplate; import java.net.UnknownHostException; import java.util.Base64; -import java.util.List; /** * Created by Amaresh Kumar on 09/May/2018. @@ -63,6 +62,11 @@ public class CdtController { @Value("${restConf.backend.port}") private String restConfPort; + @Value("${restConf.username}") + private String restConfUsername; + + @Value("${restConf.password}") + private String restConfPassword; @ApiOperation(value = "Return All Test Data for a given user", response = CdtController.class) @ApiResponses(value = { @@ -83,8 +87,8 @@ public class CdtController { }) @RequestMapping(value = "/getDesigns", method = RequestMethod.POST) @CrossOrigin(origins = "*", allowedHeaders = "*") - public String getDesigns(@RequestBody String getDesignsRequest, @RequestHeader HttpHeaders requestHeader) throws UnknownHostException { - HttpEntity entity = getStringHttpEntity(getDesignsRequest, requestHeader); + public String getDesigns(@RequestBody String getDesignsRequest) throws UnknownHostException { + HttpEntity entity = getStringHttpEntity(getDesignsRequest); HttpClient httpClient = HttpClientBuilder.create().build(); ClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory(httpClient); restTemplate.setRequestFactory(factory); @@ -99,8 +103,8 @@ public class CdtController { }) @RequestMapping(value = "/testVnf", method = RequestMethod.POST) @CrossOrigin(origins = "*", allowedHeaders = "*") - public String testVnf(@RequestParam String urlAction, @RequestBody String testVnf, @RequestHeader HttpHeaders requestHeader) throws UnknownHostException { - HttpEntity entity = getStringHttpEntity(testVnf, requestHeader); + public String testVnf(@RequestParam String urlAction, @RequestBody String testVnf) throws UnknownHostException { + HttpEntity entity = getStringHttpEntity(testVnf); String testVnfResponse = restTemplate.postForObject(getUrl("testVnf")+urlAction, entity, String.class); return testVnfResponse; } @@ -112,8 +116,8 @@ public class CdtController { }) @RequestMapping(value = "/checkTestStatus", method = RequestMethod.POST) @CrossOrigin(origins = "*", allowedHeaders = "*") - public String checkTestStatus(@RequestBody String checkTestStatusRequest, @RequestHeader HttpHeaders requestHeader) throws UnknownHostException { - HttpEntity entity = getStringHttpEntity(checkTestStatusRequest, requestHeader); + public String checkTestStatus(@RequestBody String checkTestStatusRequest) throws UnknownHostException { + HttpEntity entity = getStringHttpEntity(checkTestStatusRequest); String checkTestStatusResponse = restTemplate.postForObject(getUrl("checkTestStatus"), entity, String.class); return checkTestStatusResponse; } @@ -125,23 +129,19 @@ public class CdtController { }) @RequestMapping(value = "/validateTemplate", method = RequestMethod.POST) @CrossOrigin(origins = "*", allowedHeaders = "*") - public String validateTemplate(@RequestBody String validateTemplateRequest, @RequestHeader HttpHeaders requestHeader) throws UnknownHostException { - HttpEntity entity = getStringHttpEntity(validateTemplateRequest, requestHeader); + public String validateTemplate(@RequestBody String validateTemplateRequest) throws UnknownHostException { + HttpEntity entity = getStringHttpEntity(validateTemplateRequest); String validateTemplateResponse = restTemplate.postForObject(getUrl("validateTemplate"), entity, String.class); return validateTemplateResponse; } - private HttpEntity getStringHttpEntity(@RequestBody String getDesignsRequest, @RequestHeader HttpHeaders requestHeader) { - + private HttpEntity getStringHttpEntity(@RequestBody String getDesignsRequest) { HttpHeaders headers = new HttpHeaders(); - if(requestHeader.containsKey("authorization")) { - List headerAuthValue = requestHeader.get("authorization"); - if(headerAuthValue != null && headerAuthValue.size() > 0) { - headers.set("authorization", headerAuthValue.get(0)); - } - } headers.setAccessControlAllowCredentials(true); headers.setContentType(MediaType.APPLICATION_JSON); + String planCredentials = restConfUsername + ":" + restConfPassword; + String base64Credentails = Base64.getEncoder().encodeToString(planCredentials.getBytes()); + headers.set("Authorization", "Basic " + base64Credentails); return new HttpEntity(getDesignsRequest, headers); } diff --git a/CdtProxyService/src/main/resources/application.properties b/CdtProxyService/src/main/resources/application.properties index 3b21458..d33188a 100644 --- a/CdtProxyService/src/main/resources/application.properties +++ b/CdtProxyService/src/main/resources/application.properties @@ -13,6 +13,8 @@ Djavax.net.debug=ssl; #=========RestConf Backend properties START================== restConf.backend.hostname=localhost restConf.backend.port=8181 +restConf.username=admin +restConf.password=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U #=========RestConf Backend properties END================== #====Allowed origins====================== diff --git a/src/app/admin/admin.component.ts b/src/app/admin/admin.component.ts index 4bde5b5..74fe86a 100644 --- a/src/app/admin/admin.component.ts +++ b/src/app/admin/admin.component.ts @@ -1,7 +1,7 @@ /* ============LICENSE_START========================================== =================================================================== -Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved. +Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. =================================================================== Unless otherwise specified, all software contained herein is licensed @@ -70,8 +70,8 @@ export class AdminComponent implements OnInit { } ngOnInit() { - const apiToken = sessionStorage['apiToken']; - this.currentUser = sessionStorage['userId']; + const apiToken = localStorage['apiToken']; + this.currentUser = localStorage['userId']; if(this.paramShareService.ansibleServerData) { this.ansibleServerData = this.paramShareService.ansibleServerData; @@ -92,14 +92,14 @@ export class AdminComponent implements OnInit { const input = { "input":{ "design-request":{ - "request-id":sessionStorage['apiToken'], + "request-id":localStorage['apiToken'], "action":"getArtifact", "payload":"{\"vnf-type\":\"NULL\",\"vnfc-type\":\"NULL\",\"protocol\":\"\",\"incart\":\"N\",\"action\":\"NULL\",\"artifact-name\":\""+this.fileName+"\",\"artifact-type\":\"APPC-CONFIG\",\"userID\":\"admin\"}" } } }; //const x = JSON.parse(data.input['design-request']['payload']); - //x.userID = sessionStorage['userId']; + //x.userID = localStorage['userId']; //data.input['design-request']['payload'] = JSON.stringify(x); console.log("input to payload====", JSON.stringify(input)); @@ -215,7 +215,7 @@ export class AdminComponent implements OnInit { let input = { "input": { "design-request": { - "request-id": sessionStorage['apiToken'], + "request-id": localStorage['apiToken'], "action": "uploadAdminArtifact", "payload": "{\"userID\": \"admin\",\"vnf-type\" : \"NULL \",\"action\" : \"NULL\",\"artifact-name\" : \""+this.fileName+"\",\"artifact-type\" : \"APPC-CONFIG\",\"artifact-version\" : \"0.1\",\"artifact-contents\":\""+artifactContent+"\"}", } @@ -244,4 +244,4 @@ export class AdminComponent implements OnInit { } } -} +} \ No newline at end of file diff --git a/src/app/admin/view-edit/ansible-server.component.ts b/src/app/admin/view-edit/ansible-server.component.ts index 6691092..b629b65 100644 --- a/src/app/admin/view-edit/ansible-server.component.ts +++ b/src/app/admin/view-edit/ansible-server.component.ts @@ -1,7 +1,7 @@ /* ============LICENSE_START========================================== =================================================================== -Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved. +Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. =================================================================== Unless otherwise specified, all software contained herein is licensed @@ -78,7 +78,7 @@ export class AnsibleServerComponent implements OnInit { } ngOnInit() { - this.currentUser = sessionStorage['userId']; + this.currentUser = localStorage['userId']; this.item = JSON.parse(sessionStorage.getItem("ansibleserver")); this.updateIndex = parseInt(sessionStorage.getItem("updateIndex")); console.log("index===>"+this.updateIndex); diff --git a/src/app/shared/components/navigation/navigation.component.spec.ts b/src/app/shared/components/navigation/navigation.component.spec.ts index ead4b78..2d4aafe 100644 --- a/src/app/shared/components/navigation/navigation.component.spec.ts +++ b/src/app/shared/components/navigation/navigation.component.spec.ts @@ -1,7 +1,7 @@ /* ============LICENSE_START========================================== =================================================================== -Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved. +Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. =================================================================== Unless otherwise specified, all software contained herein is licensed @@ -91,7 +91,7 @@ describe('NavigationComponent', () => { it('should go to /vnfs/list if url = vnfs and userId is not null or undefined', inject([Router],(router: Router) => { let navigateSpy = spyOn(router, 'navigate'); - sessionStorage['userId'] = 'testingId'; + localStorage['userId'] = 'testingId'; let testUrl = 'vnfs'; component.gotoDetail(testUrl); @@ -99,7 +99,7 @@ describe('NavigationComponent', () => { it('should go to /vnfs if url = vnfs and userId is null or undefined', inject([Router],(router: Router) => { let navigateSpy = spyOn(router, 'navigate'); - sessionStorage['userId'] = ''; + localStorage['userId'] = ''; let testUrl = 'vnfs'; component.gotoDetail(testUrl); diff --git a/src/app/shared/components/navigation/navigation.component.ts b/src/app/shared/components/navigation/navigation.component.ts index 424a002..7271bb1 100644 --- a/src/app/shared/components/navigation/navigation.component.ts +++ b/src/app/shared/components/navigation/navigation.component.ts @@ -1,7 +1,7 @@ /* ============LICENSE_START========================================== =================================================================== -Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved. +Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. Copyright (C) 2018 IBM Intellectual Property. All rights reserved. =================================================================== @@ -36,7 +36,7 @@ export class NavigationComponent implements OnInit { //@ViewChild(GoldenConfigurationComponent) goldenConfig: GoldenConfigurationComponent; @Input() id: string; userLoggedIn = false; - userId: string = sessionStorage['userId']; + userId: string = localStorage['userId']; subscription: Subscription; constructor(private router: Router) { @@ -49,7 +49,7 @@ export class NavigationComponent implements OnInit { if (value != null && value != '' && value != undefined && value != 'undefined') { this.userId = value; this.userLoggedIn = true; - sessionStorage['userId'] = this.userId; + localStorage['userId'] = this.userId; } else { this.logout(); } @@ -58,7 +58,7 @@ export class NavigationComponent implements OnInit { } ngOnInit() { - this.userId = sessionStorage['userId']; + this.userId = localStorage['userId']; if (this.userId != undefined && this.userId != '') { this.userLoggedIn = true; } @@ -99,7 +99,7 @@ export class NavigationComponent implements OnInit { gotoDetail(url) { if (url == 'vnfs') { - if (sessionStorage['userId'] != undefined && sessionStorage['userId'] != '' && sessionStorage['userId'] != null) { + if (localStorage['userId'] != undefined && localStorage['userId'] != '' && localStorage['userId'] != null) { this.router.navigate(['/vnfs/list']); } else { this.router.navigate(url); @@ -122,4 +122,4 @@ export class NavigationComponent implements OnInit { } -} +} \ No newline at end of file diff --git a/src/app/shared/services/httpUtil/http-util.service.ts b/src/app/shared/services/httpUtil/http-util.service.ts index 40c1518..fc9c327 100644 --- a/src/app/shared/services/httpUtil/http-util.service.ts +++ b/src/app/shared/services/httpUtil/http-util.service.ts @@ -1,7 +1,7 @@ /* ============LICENSE_START========================================== =================================================================== -Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved. +Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. =================================================================== Unless otherwise specified, all software contained herein is licensed @@ -54,28 +54,5 @@ export class HttpUtilService { .post(req.url, req.data, this.options) .map((res: Response) => res.json()) } - - postWithAuth(req) { - var authString = sessionStorage['auth']; - if(authString === undefined || authString === null || authString.length === 0){ - this.options = new RequestOptions({ - headers: new Headers({ - 'Content-Type': 'application/json' - }) - }); - } else { - this.options = new RequestOptions({ - headers: new Headers({ - 'Content-Type': 'application/json', - 'Authorization': 'Basic ' + authString - }) - }); - } - - return this - .http - .post(req.url, req.data, this.options) - .map((res: Response) => res.json()) - } } diff --git a/src/app/shared/services/utilityService/utility.service.ts b/src/app/shared/services/utilityService/utility.service.ts index 54ea76b..6b29a2e 100644 --- a/src/app/shared/services/utilityService/utility.service.ts +++ b/src/app/shared/services/utilityService/utility.service.ts @@ -1,7 +1,7 @@ /* ============LICENSE_START========================================== =================================================================== -Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved. +Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. =================================================================== Copyright (C) 2018 IBM. =================================================================== @@ -131,8 +131,8 @@ export class UtilityService { public createPayLoadForSave(artifactType,vnfType,action,fileName, versionNo, artifactContent) { - let userId=sessionStorage['userId']; - let apiToken=sessionStorage['apiToken'] + let userId=localStorage['userId']; + let apiToken=localStorage['apiToken'] let newPayload:any; switch(artifactType) { @@ -187,14 +187,14 @@ export class UtilityService { let payload:any; if(isReference) { payload=JSON.parse(sessionStorage.getItem('updateParams')); - payload['userID'] = sessionStorage['userId']; + payload['userID'] = localStorage['userId']; payload = JSON.stringify(payload); } - else payload = '{"userID": "' + sessionStorage['userId'] + '","action": "' + action + '", "vnf-type" : "' + vnfType + '", "artifact-type":"APPC-CONFIG", "artifact-name":"' + fileName + '"}'; + else payload = '{"userID": "' + localStorage['userId'] + '","action": "' + action + '", "vnf-type" : "' + vnfType + '", "artifact-type":"APPC-CONFIG", "artifact-name":"' + fileName + '"}'; let data = { 'input': { 'design-request': { - 'request-id': sessionStorage['apiToken'], + 'request-id': localStorage['apiToken'], 'action': 'getArtifact', 'payload': payload } diff --git a/src/app/test/test.component.ts b/src/app/test/test.component.ts index d1dd0c4..347bde6 100644 --- a/src/app/test/test.component.ts +++ b/src/app/test/test.component.ts @@ -1,7 +1,7 @@ /* ============LICENSE_START========================================== =================================================================== -Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved. +Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. =================================================================== Copyright (C) 2018 IBM. =================================================================== @@ -102,7 +102,7 @@ export class TestComponent implements OnInit { public pollCounter = 0; public enableCounterDiv: boolean = false; public enableDownload: boolean = false; - private userId = sessionStorage['userId']; + private userId = localStorage['userId']; timeStampInt: number; AppcTimeStampInt: number; AppcTimeDiff: number; @@ -395,7 +395,7 @@ export class TestComponent implements OnInit { this.ngProgress.start(); this.apiRequest = JSON.stringify(this.constructRequest()); - this.httpUtil.postWithAuth( + this.httpUtil.post( { url: environment.testVnf + "?urlAction=" + this.getUrlEndPoint(this.action), data: this.apiRequest @@ -440,7 +440,7 @@ export class TestComponent implements OnInit { } }; console.log('getAppcTimestamp: sending httpUtil.post...'); - this.httpUtil.postWithAuth( + this.httpUtil.post( { url: environment.getDesigns, data: data }) @@ -536,7 +536,7 @@ export class TestComponent implements OnInit { 'payload': '{"request-id":' + this.requestId + '}' } }; - this.httpUtil.postWithAuth( + this.httpUtil.post( { url: environment.checkTestStatus, data: data diff --git a/src/app/vnfs/GCAuthGuard/gcauth.guard.spec.ts b/src/app/vnfs/GCAuthGuard/gcauth.guard.spec.ts index 216a4df..440993d 100644 --- a/src/app/vnfs/GCAuthGuard/gcauth.guard.spec.ts +++ b/src/app/vnfs/GCAuthGuard/gcauth.guard.spec.ts @@ -51,7 +51,7 @@ describe('LogginGuard', () => { }); it('be able to return true when referenceNameObjects is defined', inject([GCAuthGuardService, MappingEditorService], (service: GCAuthGuardService, mapService: MappingEditorService) => { - sessionStorage['userId'] = 'abc@xyz.com'; + localStorage['userId'] = 'abc@xyz.com'; mapService.referenceNameObjects = { data : 'data'}; let route : ActivatedRouteSnapshot; let state: RouterStateSnapshot; @@ -61,7 +61,7 @@ describe('LogginGuard', () => { })); it('stop routing if referenceNameObjects is not defined', inject([GCAuthGuardService, MappingEditorService, NgbModal], (service: GCAuthGuardService, mapService: MappingEditorService, ngbModal: NgbModal) => { - sessionStorage['userId'] = 'abc@xyz.com'; + localStorage['userId'] = 'abc@xyz.com'; mapService.referenceNameObjects = undefined; let spy = spyOn(NgbModal.prototype, 'open').and.returnValue(Promise.resolve(true)); let route : ActivatedRouteSnapshot; diff --git a/src/app/vnfs/LoginGuardService/Login-guard-service.ts b/src/app/vnfs/LoginGuardService/Login-guard-service.ts index 1938030..1e7e752 100644 --- a/src/app/vnfs/LoginGuardService/Login-guard-service.ts +++ b/src/app/vnfs/LoginGuardService/Login-guard-service.ts @@ -1,7 +1,7 @@ /* ============LICENSE_START========================================== =================================================================== -Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved. +Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. Copyright (C) 2018 IBM. =================================================================== @@ -35,7 +35,7 @@ export class LoginGuardService implements CanActivate { canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean { - let userId = sessionStorage['userId']; + let userId = localStorage['userId']; if (userId != null && userId != undefined && userId != '') { return true; } else { @@ -44,4 +44,4 @@ export class LoginGuardService implements CanActivate { } } -} +} \ No newline at end of file diff --git a/src/app/vnfs/LoginGuardService/LoginGuardService.spec.ts b/src/app/vnfs/LoginGuardService/LoginGuardService.spec.ts index a2e26b8..1c57478 100644 --- a/src/app/vnfs/LoginGuardService/LoginGuardService.spec.ts +++ b/src/app/vnfs/LoginGuardService/LoginGuardService.spec.ts @@ -51,14 +51,14 @@ describe('LogginGuard', () => { }); it('be able to hit route when user is logged in', inject([LoginGuardService], (service: LoginGuardService) => { - sessionStorage['userId'] = 'abc@xyz.com'; + localStorage['userId'] = 'abc@xyz.com'; let route : ActivatedRouteSnapshot; let state: RouterStateSnapshot; expect(service.canActivate(route, state)).toBe(true); })); it('be able to navigate to login page when user is not logged in', inject([LoginGuardService], (service: LoginGuardService) => { - sessionStorage['userId'] = ''; + localStorage['userId'] = ''; let route : ActivatedRouteSnapshot; let mockSnapshot:any = jasmine.createSpyObj("RouterStateSnapshot", ['toString']); expect(service.canActivate(route, mockSnapshot)).toBe(false); diff --git a/src/app/vnfs/build-artifacts/parameter-definitions/parameter-definition.service.ts b/src/app/vnfs/build-artifacts/parameter-definitions/parameter-definition.service.ts index add5b5e..ae4aec4 100644 --- a/src/app/vnfs/build-artifacts/parameter-definitions/parameter-definition.service.ts +++ b/src/app/vnfs/build-artifacts/parameter-definitions/parameter-definition.service.ts @@ -1,7 +1,7 @@ /* ============LICENSE_START========================================== =================================================================== -Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved. +Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. Copyright (C) 2018 IBM. =================================================================== @@ -63,8 +63,8 @@ export class ParameterDefinitionService { public myKeyFileName = null; public myPdFileName = null; private selectedActionReference: any; - private apiToken = sessionStorage['apiToken']; - private userId = sessionStorage['userId']; + private apiToken = localStorage['apiToken']; + private userId = localStorage['userId']; public versionNoForApiCall=require('../../../../cdt.application.properties.json').versionNoForApiCall; constructor(private mappingEditorService: MappingEditorService, @@ -556,4 +556,4 @@ export class ParameterDefinitionService { this.populatePD(fileModel); return this.displayParamObjects; } -} +} \ No newline at end of file diff --git a/src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.ts b/src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.ts index 7686839..64f1159 100644 --- a/src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.ts +++ b/src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.ts @@ -1,7 +1,7 @@ /* ============LICENSE_START========================================== =================================================================== -Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved. +Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. Copyright (C) 2018 IBM Intellectual Property. All rights reserved. =================================================================== @@ -72,8 +72,8 @@ export class ParameterComponent implements OnInit { public confirmation: boolean; public showConfirmation: boolean; public test: boolean; - apiToken = sessionStorage['apiToken']; - userId = sessionStorage['userId']; + apiToken = localStorage['apiToken']; + userId = localStorage['userId']; public initialData: any; public intialData: any; public initialAction: any; diff --git a/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.ts b/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.ts index ac89a2d..a3ef4f7 100644 --- a/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.ts +++ b/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.ts @@ -1,7 +1,7 @@ /* ============LICENSE_START========================================== =================================================================== -Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved. +Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. =================================================================== Unless otherwise specified, all software contained herein is licensed @@ -939,7 +939,7 @@ export class ReferenceDataformComponent implements OnInit { let payload = this.utilityService.createPayLoadForSave("reference_data", dataJson['scope']['vnf-type'], "AllAction", fileName, this.versionNoForApiCall, slashedPayload); this.ngProgress.start(); - this.httpUtils.postWithAuth({ + this.httpUtils.post({ url: environment.getDesigns, data: payload }).subscribe((resp) => { diff --git a/src/app/vnfs/build-artifacts/template-holder/param-name-value/param-name-value.component.ts b/src/app/vnfs/build-artifacts/template-holder/param-name-value/param-name-value.component.ts index ab1a7b3..f18fe6c 100644 --- a/src/app/vnfs/build-artifacts/template-holder/param-name-value/param-name-value.component.ts +++ b/src/app/vnfs/build-artifacts/template-holder/param-name-value/param-name-value.component.ts @@ -1,7 +1,7 @@ /* ============LICENSE_START========================================== =================================================================== -Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved. +Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. =================================================================== Copyright (C) 2018 IBM Intellectual Property. All rights reserved. =================================================================== @@ -77,8 +77,8 @@ export class GoldenConfigurationMappingComponent implements OnInit, OnDestroy { action: any = ''; artifactName: any = ''; enableMerge: boolean = false; - apiToken = sessionStorage['apiToken']; - userId = sessionStorage['userId']; + apiToken = localStorage['apiToken']; + userId = localStorage['userId']; identifier: any; public uploadTypes = [ @@ -435,4 +435,4 @@ export class GoldenConfigurationMappingComponent implements OnInit, OnDestroy { } } -} +} \ No newline at end of file diff --git a/src/app/vnfs/build-artifacts/template-holder/template-configuration/template-configuration.component.ts b/src/app/vnfs/build-artifacts/template-holder/template-configuration/template-configuration.component.ts index 913e5e9..cee9629 100644 --- a/src/app/vnfs/build-artifacts/template-holder/template-configuration/template-configuration.component.ts +++ b/src/app/vnfs/build-artifacts/template-holder/template-configuration/template-configuration.component.ts @@ -1,7 +1,7 @@ /* ============LICENSE_START========================================== =================================================================== -Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved. +Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. =================================================================== Unless otherwise specified, all software contained herein is licensed @@ -75,7 +75,7 @@ export class GoldenConfigurationComponent implements OnInit { enableBrowse: boolean = true; enableMerge: boolean = false; uploadValidationSuccess: boolean = false; - apiToken = sessionStorage['apiToken']; + apiToken = localStorage['apiToken']; public appDataObject: any; public downloadDataObject: any; public checkNameEntered: boolean = true; @@ -130,7 +130,7 @@ export class GoldenConfigurationComponent implements OnInit { public fileType: any = ''; public actionType: any; public myfileName: any; - userId = sessionStorage['userId']; + userId = localStorage['userId']; public artifactRequest: ArtifactRequest = new ArtifactRequest(); public showUploadStatus: boolean = false; public uploadStatus: boolean = false; diff --git a/src/app/vnfs/myvnfs/myvnfs.component.ts b/src/app/vnfs/myvnfs/myvnfs.component.ts index 696e601..49f4f42 100644 --- a/src/app/vnfs/myvnfs/myvnfs.component.ts +++ b/src/app/vnfs/myvnfs/myvnfs.component.ts @@ -1,7 +1,7 @@ /* ============LICENSE_START========================================== =================================================================== -Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved. +Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. =================================================================== Copyright (C) 2018 IBM. =================================================================== @@ -63,7 +63,7 @@ export class MyvnfsComponent implements OnInit, OnDestroy { sessionStorage.setItem('updateParams', undefined); this.mappingEditorService.latestAction = undefined; - const apiToken = sessionStorage['apiToken']; + const apiToken = localStorage['apiToken']; const data = { 'input': { @@ -75,7 +75,7 @@ export class MyvnfsComponent implements OnInit, OnDestroy { } }; const x = JSON.parse(data.input['design-request']['payload']); - x.userID = sessionStorage['userId']; + x.userID = localStorage['userId']; data.input['design-request']['payload'] = JSON.stringify(x); // console.log("input to payload====", JSON.stringify(data)); this.getArtifacts(data); @@ -89,7 +89,7 @@ export class MyvnfsComponent implements OnInit, OnDestroy { getArtifacts(data) { let tempObj: any; this.ngProgress.start(); - this.httpUtil.postWithAuth({ + this.httpUtil.post({ url: environment.getDesigns, data: data }) @@ -233,4 +233,4 @@ export class MyvnfsComponent implements OnInit, OnDestroy { } -} +} \ No newline at end of file diff --git a/src/app/vnfs/userlogin-form/userlogin-form.component.html b/src/app/vnfs/userlogin-form/userlogin-form.component.html index 069583e..3f18b72 100644 --- a/src/app/vnfs/userlogin-form/userlogin-form.component.html +++ b/src/app/vnfs/userlogin-form/userlogin-form.component.html @@ -1,7 +1,7 @@