Page 461 - MDP2022-3
P. 461
.antMatchers("/api/{userNickname}/profileImageUp").access("hasAnyRole('USER','ADMIN')")
.antMatchers("/api/friend/friendMatch/{postFriendNickname}").access("hasAnyRole('USER','ADM
IN')")
.antMatchers("/api/friend/printAll/{userNickName}").access("hasAnyRole('USER','ADMIN')")
.antMatchers("/api/friend/friendDelete/{postFriendNickname}").access("hasAnyRole('USER','ADM
IN')")
.antMatchers("/api/commentUpload").access("hasAnyRole('USER','ADMIN')")
.antMatchers("signup/{userNickname}/{authKey}").permitAll()
.anyRequest().authenticated()
.and()
.apply(new JwtSecurityConfig(jwtTokenProvider));
return http.build();
}
}
com.webmister.semicolon.config.WebConfig
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
@EnableWebMvc
public class WebConfig implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("http://127.0.0.1:8080")
.allowedOrigins("http://localhost:8080");
}
}
com.webmister.semicolon.controller.CommentController
import com.webmister.semicolon.request.CommentRequest;
import com.webmister.semicolon.service.CommentService;