aboutsummaryrefslogtreecommitdiffstats
path: root/adapters
diff options
context:
space:
mode:
Diffstat (limited to 'adapters')
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql22
-rw-r--r--adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/configuration/SecurityConfiguration.java29
-rw-r--r--adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/SubscriberService.java18
-rw-r--r--adapters/mso-ve-vnfm-adapter/src/main/resources/application.yaml2
-rw-r--r--adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTask.java11
5 files changed, 74 insertions, 8 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql
index f5c7cd65c2..ede499f9ee 100644
--- a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql
@@ -873,3 +873,25 @@ VALUES
UPDATE vnf_recipe
SET ORCHESTRATION_URI = '/mso/async/services/WorkflowActionBB'
WHERE NF_ROLE = 'GR-API-DEFAULT' AND ACTION = 'inPlaceSoftwareUpdate';
+
+INSERT INTO rainy_day_handler_macro (FLOW_NAME, SERVICE_TYPE, VNF_TYPE, ERROR_CODE, WORK_STEP, POLICY, SECONDARY_POLICY, REG_EX_ERROR_MESSAGE, SERVICE_ROLE)
+VALUES
+('VNFCheckPserversLockedFlagActivity','*','*','*','*','Manual','Abort','*', '*'),
+('VNFCheckInMaintFlagActivity','*','*','*','*','Manual','Abort','*', '*'),
+('VNFSetInMaintFlagActivity','*','*','*','*','Manual','Abort','*', '*'),
+('VNFCheckClosedLoopDisabledFlagActivity','*','*','*','*','Manual','Abort','*', '*'),
+('VNFSetClosedLoopDisabledFlagActivity','*','*','*','*','Manual','Abort','*', '*'),
+('VNFLockActivity','*','*','*','*','Manual','Abort','*', '*'),
+('VNFUpgradePreCheckActivity','*','*','*','*','Manual','Abort','*', '*'),
+('VNFQuiesceTrafficActivity','*','*','*','*','Manual','Abort','*', '*'),
+('VNFStopActivity','*','*','*','*','Manual','Abort','*', '*'),
+('VNFSnapShotActivity','*','*','*','*','Manual','Abort','*', '*'),
+('VNFStartActivity','*','*','*','*','Manual','Abort','*', '*'),
+('VNFUpgradeBackupActivity','*','*','*','*','Manual','Abort','*', '*'),
+('VNFUpgradeSoftwareActivity','*','*','*','*','Manual','Abort','*', '*'),
+('VNFUpgradePostCheckActivity','*','*','*','*','Manual','Abort','*', '*'),
+('VNFResumeTrafficActivity','*','*','*','*','Manual','Abort','*', '*'),
+('VNFUnlockActivity','*','*','*','*','Manual','Abort','*', '*'),
+('SDNOVnfHealthCheckBB','*','*','*','*','Manual','Abort','*', '*'),
+('VNFUnsetInMaintFlagActivity','*','*','*','*','Manual','Abort','*', '*'),
+('VNFUnsetClosedLoopDisabledActivity','*','*','*','*','Manual','Abort','*', '*');
diff --git a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/configuration/SecurityConfiguration.java b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/configuration/SecurityConfiguration.java
index 32c2559d7b..cc56048262 100644
--- a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/configuration/SecurityConfiguration.java
+++ b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/configuration/SecurityConfiguration.java
@@ -21,15 +21,38 @@
package org.onap.so.adapters.vevnfm.configuration;
import org.onap.so.security.SoBasicWebSecurityConfigurerAdapter;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
+import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.security.crypto.password.PasswordEncoder;
@Configuration
+@EnableWebSecurity
public class SecurityConfiguration extends SoBasicWebSecurityConfigurerAdapter {
+ @Value("${notification.url}")
+ private String notificationUrl;
+
+ @Value("${notification.username}")
+ private String notificationUsername;
+
+ @Value("${notification.password}")
+ private String notificationPassword;
+
+ @Autowired
+ private PasswordEncoder passwordEncoder;
+
+ @Override
+ protected void configure(final HttpSecurity https) throws Exception {
+ https.csrf().disable().authorizeRequests().antMatchers(notificationUrl).authenticated().and().httpBasic();
+ }
+
@Override
- protected void configure(final HttpSecurity http) throws Exception {
- http.authorizeRequests().antMatchers().permitAll().and().requestMatchers().antMatchers("/").and()
- .authorizeRequests().anyRequest().authenticated();
+ protected void configure(final AuthenticationManagerBuilder auth) throws Exception {
+ auth.inMemoryAuthentication().withUser(notificationUsername)
+ .password(passwordEncoder.encode(notificationPassword)).authorities("ROLE_USER");
}
}
diff --git a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/SubscriberService.java b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/SubscriberService.java
index e413124b4b..aa07ed65a2 100644
--- a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/SubscriberService.java
+++ b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/SubscriberService.java
@@ -20,6 +20,7 @@
package org.onap.so.adapters.vevnfm.service;
+import java.util.Collections;
import org.onap.so.adapters.vevnfm.subscription.SubscribeSender;
import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.LccnSubscriptionRequest;
import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.SubscriptionsAuthentication;
@@ -33,14 +34,20 @@ public class SubscriberService {
private static final char COLON = ':';
- @Value("${notification.url}")
- private String notificationUrl;
+ @Value("${system.url}")
+ private String systemUrl;
@Value("${server.port}")
private String serverPort;
- @Value("${system.url}")
- private String systemUrl;
+ @Value("${notification.url}")
+ private String notificationUrl;
+
+ @Value("${notification.username}")
+ private String notificationUsername;
+
+ @Value("${notification.password}")
+ private String notificationPassword;
@Autowired
private SubscribeSender sender;
@@ -55,6 +62,9 @@ public class SubscriberService {
request.callbackUri(getCallbackUri());
final SubscriptionsAuthenticationParamsBasic paramsBasic = new SubscriptionsAuthenticationParamsBasic();
final SubscriptionsAuthentication authentication = new SubscriptionsAuthentication();
+ paramsBasic.setUserName(notificationUsername);
+ paramsBasic.setPassword(notificationPassword);
+ authentication.setAuthType(Collections.singletonList(SubscriptionsAuthentication.AuthTypeEnum.BASIC));
authentication.setParamsBasic(paramsBasic);
request.authentication(authentication);
diff --git a/adapters/mso-ve-vnfm-adapter/src/main/resources/application.yaml b/adapters/mso-ve-vnfm-adapter/src/main/resources/application.yaml
index 12197d737d..b16fa6348f 100644
--- a/adapters/mso-ve-vnfm-adapter/src/main/resources/application.yaml
+++ b/adapters/mso-ve-vnfm-adapter/src/main/resources/application.yaml
@@ -22,6 +22,8 @@ system:
notification:
url: /lcm/v1/vnf/instances/notifications
+ username: admin
+ password: a4b3c2d1
mso:
key: 07a7159d3bf51a0e53be7a8f89699be7
diff --git a/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTask.java b/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTask.java
index 181d114cc0..db70a6b5cb 100644
--- a/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTask.java
+++ b/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTask.java
@@ -4,6 +4,7 @@ import org.camunda.bpm.client.task.ExternalTask;
import org.camunda.bpm.client.task.ExternalTaskService;
import org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerCallback;
import org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerSupport;
+import org.onap.so.adapters.appc.orchestrator.client.StatusCategory;
import org.onap.so.appc.orchestrator.service.beans.ApplicationControllerTaskRequest;
import org.onap.so.externaltasks.logging.AuditMDCSetup;
import org.onap.so.utils.ExternalTaskUtils;
@@ -42,8 +43,16 @@ public class ApplicationControllerTask extends ExternalTaskUtils {
try {
status = applicationControllerTaskImpl.execute(msoRequestId, request, listener);
+ if (status != null && status.getCode() != 0
+ && !applicationControllerSupport.getCategoryOf(status).equals(StatusCategory.NORMAL)) {
+ logger.error("The External Task Id: {} Failed locally with status {}", externalTask.getId(),
+ status.getMessage());
+ externalTaskService.handleBpmnError(externalTask, "MSOWorkflowException", status.getMessage());
+ }
} catch (Exception e) {
- logger.error("Error while calling appc", e.getMessage());
+ logger.error("The External Task Id: {} Failed while calling appc with exception", externalTask.getId(),
+ e.getMessage());
+ externalTaskService.handleBpmnError(externalTask, "MSOWorkflowException", e.getMessage());
}
}