From 580f68b9f028d519adaeabede0f9bf03d6ea7565 Mon Sep 17 00:00:00 2001 From: "Smokowski, Steven" Date: Thu, 6 Feb 2020 11:42:53 -0500 Subject: Remove unused param Remove unused param from request parameters Issue-ID: SO-2651 Signed-off-by: Benjamin, Max (mb388a) Change-Id: I1c9a8e05aa329ee65f9910ab25319a0a61d54675 --- .../src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java | 10 ++++++++-- .../so/apihandlerinfra/validation/PlatformLOBValidation.java | 3 +-- .../validation/ProjectOwningEntityValidation.java | 3 +-- 3 files changed, 10 insertions(+), 6 deletions(-) (limited to 'mso-api-handlers/mso-api-handler-infra/src/main') diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java index e3e840bbcd..c077558301 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java @@ -85,6 +85,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -105,6 +106,9 @@ public class MsoRequest { @Autowired private ResponseBuilder builder; + @Value("${mso.enforceDLP:false}") + private boolean enforceDLP; + private static Logger logger = LoggerFactory.getLogger(MsoRequest.class); public Response buildServiceErrorResponse(int httpResponseCode, MsoException exceptionType, String errorText, @@ -179,8 +183,10 @@ public class MsoRequest { rules.add(new ModelInfoValidation()); rules.add(new CloudConfigurationValidation()); rules.add(new SubscriberInfoValidation()); - rules.add(new PlatformLOBValidation()); - rules.add(new ProjectOwningEntityValidation()); + if (!enforceDLP) { + rules.add(new PlatformLOBValidation()); + rules.add(new ProjectOwningEntityValidation()); + } rules.add(new RelatedInstancesValidation()); rules.add(new ConfigurationParametersValidation()); } diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/PlatformLOBValidation.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/PlatformLOBValidation.java index 20be2b5a8b..71405b0f63 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/PlatformLOBValidation.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/PlatformLOBValidation.java @@ -43,8 +43,7 @@ public class PlatformLOBValidation implements ValidationRule { platform = info.getSir().getRequestDetails().getPlatform(); lineOfBusiness = info.getSir().getRequestDetails().getLineOfBusiness(); - if (reqVersion >= 5 && requestScope.equalsIgnoreCase(ModelType.vnf.name()) && action == Action.createInstance - && !info.getReqParameters().getEnforceValidNfValues()) { + if (reqVersion >= 5 && requestScope.equalsIgnoreCase(ModelType.vnf.name()) && action == Action.createInstance) { if (reqVersion > 5 && platform == null) { throw new ValidationException("platform"); } diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/ProjectOwningEntityValidation.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/ProjectOwningEntityValidation.java index cebbd6389c..07641ae87b 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/ProjectOwningEntityValidation.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/ProjectOwningEntityValidation.java @@ -45,8 +45,7 @@ public class ProjectOwningEntityValidation implements ValidationRule { project = info.getSir().getRequestDetails().getProject(); owningEntity = info.getSir().getRequestDetails().getOwningEntity(); if (reqVersion >= 5 && requestScope.equalsIgnoreCase(ModelType.service.name()) - && !info.getReqParameters().getEnforceValidNfValues() && action == Action.createInstance - || action == Action.assignInstance) { + && action == Action.createInstance || action == Action.assignInstance) { if (reqVersion > 5 && owningEntity == null) { throw new ValidationException("owningEntity"); } -- cgit 1.2.3-korg