From 5a0703ffad1492ec6b6c78143f63dca83ee030d2 Mon Sep 17 00:00:00 2001 From: "andre.schmid" Date: Mon, 23 Aug 2021 19:41:50 +0100 Subject: Dynamically load CSAR validators for models Change-Id: I88ece0936e8a2814ef13dfa23eecda56de3dc6fe Issue-ID: SDC-3683 Signed-off-by: andre.schmid --- .../vsp/rest/services/OrchestrationTemplateCandidateImpl.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'openecomp-be/api') diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java index eb78bf0059..23930ed640 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java @@ -152,7 +152,9 @@ public class OrchestrationTemplateCandidateImpl implements OrchestrationTemplate } @Override - public Response upload(final String vspId, final String versionId, final Attachment fileToUpload, final String user) { + public Response upload(String vspId, String versionId, final Attachment fileToUpload, final String user) { + vspId = ValidationUtils.sanitizeInputString(vspId); + versionId = ValidationUtils.sanitizeInputString(versionId); final byte[] fileToUploadBytes; final var filename = ValidationUtils.sanitizeInputString(fileToUpload.getDataHandler().getName()); ArtifactInfo artifactInfo = null; @@ -193,8 +195,8 @@ public class OrchestrationTemplateCandidateImpl implements OrchestrationTemplate return Response.ok(uploadFileResponseDto) .build(); } - final var version = new Version(ValidationUtils.sanitizeInputString(versionId)); - final var vspDetails = new VspDetails(ValidationUtils.sanitizeInputString(vspId), version); + final var version = new Version(versionId); + final var vspDetails = vendorSoftwareProductManager.getVsp(vspId, version); return processOnboardPackage(onboardPackageInfo, vspDetails, errorMessages); } -- cgit 1.2.3-korg