diff options
Diffstat (limited to 'nokiav2/driver/src/main/java/org')
5 files changed, 25 insertions, 8 deletions
diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/core/SelfRegistrationManager.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/core/SelfRegistrationManager.java index 6d569e2a..92064b16 100644 --- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/core/SelfRegistrationManager.java +++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/core/SelfRegistrationManager.java @@ -139,7 +139,7 @@ public class SelfRegistrationManager { microServiceInfo.setVisualRange(INTERNAL_SERVICE); microServiceInfo.setServiceName(SERVICE_NAME); microServiceInfo.setVersion(DRIVER_VERSION); - microServiceInfo.setEnable_ssl(true); + microServiceInfo.setEnable_ssl(false); Node node = new Node(); microServiceInfo.setNodes(new HashSet<>()); microServiceInfo.getNodes().add(node); diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/LcmApi.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/LcmApi.java index 5a7bd749..be78aa0a 100644 --- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/LcmApi.java +++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/LcmApi.java @@ -65,8 +65,6 @@ public class LcmApi { @ResponseBody public VnfInstantiateResponse instantiateVnf(@RequestBody VnfInstantiateRequest request, @PathVariable("vnfmId") String vnfmId, HttpServletResponse httpResponse) { logger.info("REST: Instantiate VNF"); - //FIXME - VnfInstantiateResponse response = lifecycleManager.createAndInstantiate(vnfmId, request, httpResponse); httpResponse.setStatus(SC_CREATED); return response; diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/spring/RealConfig.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/spring/RealConfig.java index ddf7df31..f9b2e394 100644 --- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/spring/RealConfig.java +++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/spring/RealConfig.java @@ -16,6 +16,7 @@ package org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.spring; import org.springframework.boot.autoconfigure.http.HttpMessageConverters; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.json.GsonHttpMessageConverter; @@ -36,11 +37,10 @@ public class RealConfig { * * @return the message converter */ - //FIXME? @Bean + @Bean public HttpMessageConverters customConverters() { Collection<HttpMessageConverter<?>> messageConverters = new ArrayList<>(); GsonHttpMessageConverter gsonHttpMessageConverter = new GsonHttpMessageConverter(); - //FIXME gsonHttpMessageConverter.setGson(new ApiClient().getAdapterBuilder().build()..getJSON().getGson()); messageConverters.add(gsonHttpMessageConverter); return new HttpMessageConverters(true, messageConverters); } diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/spring/SecurityConfig.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/spring/SecurityConfig.java index e3dd0714..708376d1 100644 --- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/spring/SecurityConfig.java +++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/spring/SecurityConfig.java @@ -18,6 +18,7 @@ package org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.spring; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.builders.WebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; @@ -45,4 +46,18 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { .permitAll(); } + /** + * Does not configure security, but solves the https://pivotal.io/security/cve-2017-4995 + * "The fix ensures that by default only explicitly mapped classes will be deserialized. + * The effect of using explicitly mapped classes is to create a whitelist which works with all + * supported versions of Jackson. If users explicitly opt into global default typing, the previous + * potentially dangerous configuration is restored." + * + * @param web the web security configuration + */ + @Override + public void configure(WebSecurity web) throws Exception { + web.ignoring().anyRequest(); + } + } diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/JobManager.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/JobManager.java index 085231f6..0d078d0b 100644 --- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/JobManager.java +++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/JobManager.java @@ -22,6 +22,7 @@ import com.google.gson.JsonElement; import com.nokia.cbam.lcm.v32.api.OperationExecutionsApi; import com.nokia.cbam.lcm.v32.api.VnfsApi; import com.nokia.cbam.lcm.v32.model.OperationExecution; +import com.nokia.cbam.lcm.v32.model.OperationType; import com.nokia.cbam.lcm.v32.model.VnfInfo; import org.apache.http.HttpStatus; import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.onap.core.SelfRegistrationManager; @@ -284,14 +285,17 @@ public class JobManager { } private boolean isCurrentOperationTriggeredByJob(String jobId, OperationExecutionsApi cbamOperationExecutionApi, OperationExecution operationExecution) { - + if(OperationType.MODIFY_INFO.equals(operationExecution.getOperationType())){ + //the modify info is never triggered by an external job + return false; + } try { Object operationParams = cbamOperationExecutionApi.operationExecutionsOperationExecutionIdOperationParamsGet(operationExecution.getId(), NOKIA_LCM_API_VERSION).blockingFirst(); if (extractOnapJobId(operationParams).equals(jobId)) { return true; } } catch (Exception e) { - throw buildFatalFailure(logger, "Unable to retrieve operation parameters", e); + throw buildFatalFailure(logger, "Unable to retrieve operation parameters of operation with " + operationExecution.getId() + " identifier", e); } return false; } @@ -312,7 +316,7 @@ public class JobManager { return of(cbamLcmApi.vnfsVnfInstanceIdGet(vnfId, NOKIA_LCM_API_VERSION).blockingFirst()); } } catch (Exception e) { - throw buildFatalFailure(logger, "Unable to retrieve VNF", e); + throw buildFatalFailure(logger, "Unable to retrieve VNF with " + vnfId + " identifier", e); } } } |