File tree Expand file tree Collapse file tree
src/main/java/io/papermc/fill/configuration Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121import org .jspecify .annotations .NullMarked ;
2222import org .springframework .context .annotation .Bean ;
2323import org .springframework .context .annotation .Configuration ;
24- import org .springframework .http .HttpMethod ;
2524import org .springframework .security .authentication .AuthenticationManager ;
2625import org .springframework .security .config .Customizer ;
2726import org .springframework .security .config .annotation .authentication .configuration .AuthenticationConfiguration ;
3837import org .springframework .security .provisioning .InMemoryUserDetailsManager ;
3938import org .springframework .security .web .SecurityFilterChain ;
4039import org .springframework .security .web .authentication .UsernamePasswordAuthenticationFilter ;
41- import org .springframework .web .cors .CorsConfiguration ;
42- import org .springframework .web .cors .CorsConfigurationSource ;
43- import org .springframework .web .cors .UrlBasedCorsConfigurationSource ;
4440
4541@ Configuration
4642@ EnableWebSecurity
4743@ EnableMethodSecurity
4844@ NullMarked
4945public class SecurityConfiguration {
50- @ Bean
51- public CorsConfigurationSource corsConfigurationSource () {
52- final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource ();
53- final CorsConfiguration openapi = new CorsConfiguration ();
54- openapi .addAllowedMethod (HttpMethod .GET );
55- openapi .addAllowedOrigin ("*" );
56- source .registerCorsConfiguration ("/openapi.yaml" , openapi );
57- return source ;
58- }
59-
6046 @ Bean
6147 public PasswordEncoder passwordEncoder () {
6248 return PasswordEncoderFactories .createDelegatingPasswordEncoder ();
You can’t perform that action at this time.
0 commit comments