diff options
author | vasraz <vasyl.razinkov@est.tech> | 2021-07-27 11:19:48 +0100 |
---|---|---|
committer | Vasyl Razinkov <vasyl.razinkov@est.tech> | 2021-08-06 09:42:46 +0000 |
commit | 84aa83e9203d6f890cc5f425a00ac748d47c5c8f (patch) | |
tree | c64d6fe5494e52781fdec406f7f521d6ddd082d5 /openecomp-be | |
parent | 36ff777984fbd728737b264d7aa3933794716519 (diff) |
Fix Security Hotspot
Fix for https://sonarcloud.io/project/security_hotspots?id=onap_sdc&hotspots=AXrLK9lDm75TRpHZ3DAu
Change-Id: I6427d02bb76618a4b7383e427ce9f762adf73e97
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech>
Issue-ID: SDC-3657
Diffstat (limited to 'openecomp-be')
2 files changed, 7 insertions, 4 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 19f2c5df87..eb78bf0059 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 @@ -132,9 +132,10 @@ public class OrchestrationTemplateCandidateImpl implements OrchestrationTemplate final var commonConfigurationManager = CommonConfigurationManager.getInstance(); final List<String> foldersToStrip = commonConfigurationManager.getConfigValue(EXTERNAL_CSAR_STORE, "foldersToStrip", new ArrayList<>()); final int sizeLimit = commonConfigurationManager.getConfigValue(EXTERNAL_CSAR_STORE, "sizeLimit", 1000000); + final int thresholdEntries = commonConfigurationManager.getConfigValue(EXTERNAL_CSAR_STORE, "thresholdEntries", 10000); LOGGER.info("Folders to strip: '{}'", String.join(", ", foldersToStrip)); final Set<Path> foldersToStripPathSet = foldersToStrip.stream().map(Path::of).collect(Collectors.toSet()); - return new CsarPackageReducerConfiguration(foldersToStripPathSet, sizeLimit); + return new CsarPackageReducerConfiguration(foldersToStripPathSet, sizeLimit, thresholdEntries); } private ArtifactStorageConfig readArtifactStorageConfiguration() { @@ -173,7 +174,7 @@ public class OrchestrationTemplateCandidateImpl implements OrchestrationTemplate fileToUploadBytes = packageSizeReducer.reduce(artifactInfo.getPath()); } catch (final BusinessException e) { return Response.status(INTERNAL_SERVER_ERROR).entity(buildUploadResponseWithError( - new ErrorMessage(ErrorLevel.ERROR, ERROR_HAS_OCCURRED_WHILE_REDUCING_THE_ARTIFACT_SIZE.formatMessage(artifactInfo.getPath())))) + new ErrorMessage(ErrorLevel.ERROR, ERROR_HAS_OCCURRED_WHILE_REDUCING_THE_ARTIFACT_SIZE.formatMessage(artifactInfo.getPath())))) .build(); } } else { @@ -189,7 +190,8 @@ public class OrchestrationTemplateCandidateImpl implements OrchestrationTemplate if (onboardPackageInfo == null) { final UploadFileResponseDto uploadFileResponseDto = buildUploadResponseWithError( new ErrorMessage(ErrorLevel.ERROR, PACKAGE_PROCESS_ERROR.formatMessage(filename))); - return Response.ok(uploadFileResponseDto).build(); + return Response.ok(uploadFileResponseDto) + .build(); } final var version = new Version(ValidationUtils.sanitizeInputString(versionId)); final var vspDetails = new VspDetails(ValidationUtils.sanitizeInputString(vspId), version); diff --git a/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/chef-repo/cookbooks/sdc-onboard-backend/templates/default/configuration.yaml.erb b/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/chef-repo/cookbooks/sdc-onboard-backend/templates/default/configuration.yaml.erb index 56951377ec..d2c3d10805 100644 --- a/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/chef-repo/cookbooks/sdc-onboard-backend/templates/default/configuration.yaml.erb +++ b/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/chef-repo/cookbooks/sdc-onboard-backend/templates/default/configuration.yaml.erb @@ -59,4 +59,5 @@ externalCsarStore: fullPath: "/home/onap/temp/" foldersToStrip: - Files/images - sizeLimit: 10000000
\ No newline at end of file + sizeLimit: 10000000 + thresholdEntries: 10000
\ No newline at end of file |