summaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-api-handler-infra/src/main
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2020-02-10 13:38:46 +0000
committerGerrit Code Review <gerrit@onap.org>2020-02-10 13:38:46 +0000
commit5ffc3c1db37c43b559af9c6d8b14bb8d33178572 (patch)
tree2098f1942ecbd379a79a67dafba1e97dea79e83c /mso-api-handlers/mso-api-handler-infra/src/main
parent24645b6c53420b7d12a23158e39366ed37b10d86 (diff)
parent580f68b9f028d519adaeabede0f9bf03d6ea7565 (diff)
Merge "Remove unused param"
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src/main')
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java10
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/PlatformLOBValidation.java3
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/ProjectOwningEntityValidation.java3
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");
}