Skip to content

Commit

Permalink
Merge pull request #242 from sopt-makers/sohyeon_#227
Browse files Browse the repository at this point in the history
[FIX] 테스트 경로 추가
  • Loading branch information
thguss authored Feb 15, 2024
2 parents 292ef02 + b821922 commit b8ed04a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public SecurityFilterChain filterChainProd(HttpSecurity http) throws Exception {
setHttp(http);
return http.build();
}

private void setHttp(HttpSecurity http) throws Exception {
http.httpBasic().disable()
.csrf().disable()
Expand All @@ -58,6 +59,7 @@ private void setHttp(HttpSecurity http) throws Exception {
.authorizeHttpRequests(authorizeHttpRequests ->
authorizeHttpRequests
.requestMatchers(new AntPathRequestMatcher("/api/v1/auth/*")).permitAll()
.requestMatchers(new AntPathRequestMatcher("/api/v1/test/**")).permitAll()
.requestMatchers(new AntPathRequestMatcher("/error")).permitAll()
.anyRequest().authenticated())
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter {
public void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException {
val uri = request.getRequestURI();

if ((uri.startsWith("/api/v1")) && !uri.contains("auth")) {
if ((uri.startsWith("/api/v1")) && !uri.contains("auth") && !uri.contains("test")) {
val token = jwtTokenProvider.resolveToken(request);

val jwtTokenType = validateTokenType(request);
Expand Down
4 changes: 2 additions & 2 deletions scripts/health_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ else
fi


echo "> Start health check of WAS at 'http://127.0.0.1:${TARGET_PORT}' ..."
echo "> Start health check of WAS at 'http://127.0.0.1:${TARGET_PORT}/api/v1/test' ..."

for RETRY_COUNT in {1..10}
do
echo "> #${RETRY_COUNT} trying..."
RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:${TARGET_PORT})
RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:${TARGET_PORT}/api/v1/test)

if [ ${RESPONSE_CODE} -eq 200 ]; then
echo "> New WAS successfully running"
Expand Down

0 comments on commit b8ed04a

Please sign in to comment.