<commit_before>package com.dstevens.config;

import org.springframework.beans.factory.annotation.Autowired;
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.config.annotation.web.servlet.configuration.EnableWebMvcSecurity;

import com.dstevens.users.ElysiumUserDetailsService;
 
@Configuration
@EnableWebSecurity
@EnableWebMvcSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
 
	@Autowired private ElysiumUserDetailsService userDetailService;
	@Autowired private ElysiumAuthenticationSuccessHandler successHandler;

	@Autowired
	public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
		auth.userDetailsService(userDetailService);
	}
 
	@Override
	protected void configure(HttpSecurity http) throws Exception {
	    http.
	    	formLogin().loginPage("/login").successHandler(successHandler).failureUrl("/login?error").permitAll().and().
	    	logout().logoutUrl("/logout").permitAll().and().
	    	authorizeRequests().anyRequest().permitAll().and().
		    csrf().disable(); 
 
	}
}<commit_msg>Added stateless configuration.<commit_after>package com.dstevens.config;

import org.springframework.beans.factory.annotation.Autowired;
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.config.annotation.web.servlet.configuration.EnableWebMvcSecurity;
import org.springframework.security.config.http.SessionCreationPolicy;

import com.dstevens.users.ElysiumUserDetailsService;
 
@Configuration
@EnableWebSecurity
@EnableWebMvcSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
 
	@Autowired private ElysiumUserDetailsService userDetailService;
	@Autowired private ElysiumAuthenticationSuccessHandler successHandler;

	@Autowired
	public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
		auth.userDetailsService(userDetailService);
	}
 
	@Override
	protected void configure(HttpSecurity http) throws Exception {
	    http.
	         sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and().
	    	 formLogin().loginPage("/login").successHandler(successHandler).failureUrl("/login?error").permitAll().and().
	    	 logout().logoutUrl("/logout").permitAll().and().
	    	 authorizeRequests().anyRequest().permitAll().and().
		     csrf().disable(); 
 
	}
}
{'fraction_non_alphanumeric': 0.097319719208679, 'fraction_numerical': 0.0, 'mean_word_length': 7.038461538461538, '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': '3100443', 'n_tokens_mistral': 792, 'n_tokens_neox': 774, 'n_words': 113}