From c71614e99da78d4de6015d7689078b287f21f619 Mon Sep 17 00:00:00 2001 From: sebdet Date: Tue, 20 Apr 2021 18:04:50 +0200 Subject: Force issue in pdp dep to raise exception Force the pdpDeployment call to raise exception in case of issues to have a better view of the problem in the prod Issue-ID: POLICY-3203 Signed-off-by: sebdet Change-Id: I21ff763f9810bcfa68665f5105b0bff0e50b25ef --- .../clamp/clds/config/DefaultUserConfiguration.java | 4 +++- src/main/resources/clds/camel/rest/clamp-api-v2.xml | 16 +++++++++------- src/main/resources/clds/camel/routes/policy-flows.xml | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) (limited to 'src/main') diff --git a/src/main/java/org/onap/policy/clamp/clds/config/DefaultUserConfiguration.java b/src/main/java/org/onap/policy/clamp/clds/config/DefaultUserConfiguration.java index 74aeccda5..bb7b76af3 100644 --- a/src/main/java/org/onap/policy/clamp/clds/config/DefaultUserConfiguration.java +++ b/src/main/java/org/onap/policy/clamp/clds/config/DefaultUserConfiguration.java @@ -73,7 +73,9 @@ public class DefaultUserConfiguration extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) { try { - http.httpBasic().and().authorizeRequests().antMatchers("/restservices/clds/v1/user/**") + // Do no remove the csrf as recommended by Sonar otherwise Put/post will not work + // Moreover this default user class is only used by dev, on prod we use AAF and this code will be disabled + http.csrf().disable().httpBasic().and().authorizeRequests().antMatchers("/restservices/clds/v1/user/**") .authenticated().anyRequest().permitAll().and().sessionManagement() .maximumSessions(1); diff --git a/src/main/resources/clds/camel/rest/clamp-api-v2.xml b/src/main/resources/clds/camel/rest/clamp-api-v2.xml index fe94460c4..50e8d5850 100644 --- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml +++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml @@ -1381,12 +1381,12 @@ ${body} + uri="bean:org.onap.policy.clamp.loop.template.PolicyModelsService?method=getPolicyModelTosca(${header.policyModelType},${header.policyModelVersion})"/> - + @@ -1461,9 +1461,9 @@ - + consumes="application/json"> - false + true - + + + diff --git a/src/main/resources/clds/camel/routes/policy-flows.xml b/src/main/resources/clds/camel/routes/policy-flows.xml index f86ade5ef..4048af496 100644 --- a/src/main/resources/clds/camel/routes/policy-flows.xml +++ b/src/main/resources/clds/camel/routes/policy-flows.xml @@ -493,7 +493,7 @@ + message="Endpoint to add/remove policies in batch to PDP Group: {{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/deployments/batch"> -- cgit 1.2.3-korg