package com.quizdeck;


import com.quizdeck.filters.AuthenticationFilter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.embedded.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import javax.annotation.Resource;

@EnableSwagger2
@SpringBootApplication
public class QuizDeckApplication {
	public static void main(String[] args) {
		SpringApplication.run(QuizDeckApplication.class, args);
	}

	@Bean(name = "secretKey")
	public String secretKey() {
		return System.getProperty("SECRET_KEY", "default_key");
	}

	@Bean
	@Resource(name = "secretKey")
	public FilterRegistrationBean authFilter(String secretKey) {
		FilterRegistrationBean registration = new FilterRegistrationBean();
		registration.setFilter(new AuthenticationFilter(secretKey));
		registration.addUrlPatterns("/rest/secure/*");
		return registration;
	}

	@Bean
	public WebMvcConfigurer corsConfigurer() {
		return new WebMvcConfigurerAdapter() {
			@Override
			public void addCorsMappings(CorsRegistry registry) {
				registry
						.addMapping("/rest/**")
						.allowedOrigins("*");
			}
		};
	}
}

@@ -1479,16 +1479,99 @@
 ins(%22*%22)
+%0A%09%09%09%09%09%09.allowedMethods(%22GET%22, %22POST%22, %22PUT%22, %22DELETE%22, %22TRACE%22, %22OPTIONS%22, %22PATCH%22)
 ;%0A%09%09%09%7D%0A%09

Update QuizDeckApplication.java