diff options
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src/main')
3 files changed, 10 insertions, 6 deletions
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"); } |