<commit_before>package equipo.once.elizabeth.richard.wilson.seguridad;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
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.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

/**
 * Created on 4/11/2018.
 */
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {

    @Autowired
    private UserDetailsService userDetailsService;

    @Autowired
    private SagloAccessDeniedHandler sagloAccessDeniedHandler;

    @Bean
    public BCryptPasswordEncoder bCryptPasswordEncoder(){
        return new BCryptPasswordEncoder();
    }

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.authorizeRequests()
                .antMatchers("/js/**","/webjars/**","/static/**","/registro","/registrado","/403","/acerca" ).permitAll()
                .antMatchers("/admin/**").hasAuthority ("ROLE_ADMIN")

                .antMatchers("/inquilino/**").hasAuthority("ROLE_INQUILINO")

                .antMatchers("/tecnico/**").hasAuthority("ROLE_TECNICO")

                .anyRequest().authenticated()
                .and()
                .formLogin()
                    .loginPage("/login")
                    .permitAll()
                .and().logout()
                    .invalidateHttpSession(true)
                    .clearAuthentication(true)
                .permitAll()
        .and().exceptionHandling().accessDeniedHandler(sagloAccessDeniedHandler);<commit_msg>acerca de y errores<commit_after>package equipo.once.elizabeth.richard.wilson.seguridad;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
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.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

/**
 * Created on 4/11/2018.
 */
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {

    @Autowired
    private UserDetailsService userDetailsService;

    @Autowired
    private SagloAccessDeniedHandler sagloAccessDeniedHandler;

    @Bean
    public BCryptPasswordEncoder bCryptPasswordEncoder(){
        return new BCryptPasswordEncoder();
    }

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.authorizeRequests()
                .antMatchers("/js/**","/webjars/**","/static/**","/registro","/registrado","/403","/acerca" ).permitAll()
                /*.antMatchers("/admin/**").hasAuthority ("ROLE_ADMIN")

                .antMatchers("/inquilino/**").hasAuthority("ROLE_INQUILINO")

                .antMatchers("/tecnico/**").hasAuthority("ROLE_TECNICO")

                .anyRequest().authenticated() */
                .and()
                .formLogin()
                    .loginPage("/login")
                    .permitAll()
                .and().logout()
                    .invalidateHttpSession(true)
                    .clearAuthentication(true)
                .permitAll()
        .and().exceptionHandling().accessDeniedHandler(sagloAccessDeniedHandler);
{'fraction_non_alphanumeric': 0.11226711831599323, 'fraction_numerical': 0.004839099927413501, 'mean_word_length': 3.365364308342133, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4048568', 'n_tokens_mistral': 1089, 'n_tokens_neox': 1040, 'n_words': 140}