package com.ryanpmartz.booktrackr.config;

import org.springframework.boot.autoconfigure.security.SecurityProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
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.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

@Configuration
@EnableWebSecurity
@Order(SecurityProperties.ACCESS_OVERRIDE_ORDER)
public class SecurityConfig extends WebSecurityConfigurerAdapter {

    @Bean
    public PasswordEncoder bcryptEncoder() {
        return new BCryptPasswordEncoder();
    }

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http
                .csrf().disable()
                .authorizeRequests()
                .antMatchers("/**").permitAll();
    }
}

@@ -1133,27 +1133,464 @@
     
-.antMatchers(%22/**%22)
+// allow anonymous access access to Swagger docs%0A                .antMatchers(%22/v2/api-docs%22, %22/**/swagger-ui.html%22, %22/webjars/**%22, %22/swagger-resources/**%22).permitAll()%0A                // anonymous users need to be able to log in%0A                .antMatchers(%22/authenticate%22).permitAll()%0A                // all other request paths are protected%0A                .anyRequest().authenticated()%0A                .and()%0A                .logout()%0A                
 .per

update security config