Skip to content

Commit

Permalink
docs: Security 접근 보안 설정, jwt token 필요 (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
toychip committed Feb 12, 2024
1 parent 769aa7f commit 2aa6800
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,10 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
"/favicon.ico"
, "/health"
, "/swagger-ui/**"
, "/oauth/**"
, "/login/**"
,"/api/v1/auth"
, "/**"
).permitAll()
.anyRequest().permitAll());
.anyRequest().authenticated());
http.exceptionHandling(e -> e.accessDeniedHandler(tokenErrorHandler));
http.addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ private boolean isBearer(final String authorizationHeader) {
private boolean isPublicUri(final String requestURI) {
return
requestURI.startsWith("/swagger-ui/**") ||
requestURI.startsWith("/api/health") ||
requestURI.startsWith("/health") ||
requestURI.startsWith("/favicon.ico") ||
requestURI.startsWith("/api/v1/auth/**");
requestURI.startsWith("/api/v1/auth");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,15 @@
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.stereotype.Component;

@Component
@Slf4j
@RequiredArgsConstructor
public class JwtProvider {

public static final long ACCESS_TOKEN_VALID_TIME = 15 * 60 * 1000L;
// 24시간 ToDo 개발 편의를 위해 늘려놓음 추후 수정
public static final long ACCESS_TOKEN_VALID_TIME = 24 * 60 * 60 * 1000L;
private final MemberService memberService;
@Value("${jwt.secret.key}")
private String SECRET_KEY;
Expand Down

0 comments on commit 2aa6800

Please sign in to comment.