/*
 * Copyright 2017 Banco Bilbao Vizcaya Argentaria, S.A..
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.bbva.arq.devops.ae.mirrorgate.config;

import org.springframework.boot.actuate.autoconfigure.security.servlet.EndpointRequest;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

/**
 * Application Configuration with basic http security
 */
@Configuration
@Profile("embedded")
@ComponentScan(basePackages = "com.bbva.arq.devops.ae.mirrorgate")
public class EmbeddedConfig  extends WebSecurityConfigurerAdapter {

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http
            .authorizeRequests()
            .requestMatchers(EndpointRequest.toAnyEndpoint()).permitAll() // Disabling actuation security
        .and()
            .httpBasic();
    }
}

@@ -1444,16 +1444,106 @@
    http%0A
+            .cors()%0A                .and()%0A            .csrf()%0A                .disable()%0A
         
@@ -1563,24 +1563,28 @@
 eRequests()%0A
+    
             
@@ -1644,16 +1644,17 @@
 mitAll()
+;
  // Disa
@@ -1686,49 +1686,9 @@
     
-    .and()%0A            .httpBasic();%0A    
 %7D
+%0A
 %0A%7D%0A

use right security definition properly for Embedded profiles which is used for testing