aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/api/openecomp-sdc-rest-webapp
diff options
context:
space:
mode:
authorandre.schmid <andre.schmid@est.tech>2021-08-23 19:41:50 +0100
committerandre.schmid <andre.schmid@est.tech>2021-08-26 09:55:34 +0100
commit5a0703ffad1492ec6b6c78143f63dca83ee030d2 (patch)
tree202acfe75f4975051bd0b18d55b962ecd148fe7c /openecomp-be/api/openecomp-sdc-rest-webapp
parent0c2661a7dfd1de644c7a3f9f42fc1883d3ceff78 (diff)
Dynamically load CSAR validators for models
Change-Id: I88ece0936e8a2814ef13dfa23eecda56de3dc6fe Issue-ID: SDC-3683 Signed-off-by: andre.schmid <andre.schmid@est.tech>
Diffstat (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp')
-rw-r--r--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.java8
1 files changed, 5 insertions, 3 deletions
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);
}