@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);
<simple>${body}</simple>
</setProperty>
<to
- uri="bean:org.onap.policy.clamp.loop.template.PolicyModelsService?method=getPolicyModelTosca(${header.policyModelType},${header.policyModelVersion})"/>
+ uri="bean:org.onap.policy.clamp.loop.template.PolicyModelsService?method=getPolicyModelTosca(${header.policyModelType},${header.policyModelVersion})"/>
<setBody>
<method ref="org.onap.policy.clamp.policy.PolicyPayload"
method="createPolicyPayload(${header.policyModelType}, ${header.policyModelVersion},
${header.policyName}, ${header.policyVersion}, ${exchangeProperty[policyProperties]}, ${body})"/>
- </setBody>
+ </setBody>
<to uri="direct:create-policy"/>
<to
uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()"/>
</route>
</delete>
- <put uri="/v2/policies/pdpDeployment/"
+ <put uri="/v2/policies/pdpDeployment"
type="com.google.gson.JsonElement"
- consumes="application/json" >
+ consumes="application/json">
<route>
<doTry>
<to
<log loggingLevel="INFO"
message="PDP Group DEPLOY request payload: ${body}"/>
<setProperty name="raiseHttpExceptionFlag">
- <simple resultType="java.lang.Boolean">false</simple>
+ <simple resultType="java.lang.Boolean">true</simple>
</setProperty>
<to uri="direct:add-multiple-policies-to-pdp-group"/>
<to
<get uri="/v2/clampInformation" outType="org.onap.policy.clamp.clds.model.ClampInformation"
produces="application/json">
- <to
- uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=getClampInformation()"/>
+ <route>
+ <to
+ uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=getClampInformation()"/>
+ </route>
</get>
</rest>
</rests>
</simple>
</setHeader>
<log loggingLevel="INFO"
- message="Endpoint to add policies to PDP Group: {{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/deployments/batch"></log>
+ message="Endpoint to add/remove policies in batch to PDP Group: {{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/deployments/batch"></log>
<toD
uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/deployments/batch?bridgeEndpoint=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&useSystemProperties=true&authUsername={{clamp.config.policy.pap.userName}}&authPassword={{clamp.config.policy.pap.password}}&authenticationPreemptive=true&connectionClose=true"/>
<doFinally>