Skip to content

Commit

Permalink
Refactor: swagger에 대해 권한 허가
Browse files Browse the repository at this point in the history
  • Loading branch information
qjvk2880 committed May 30, 2024
1 parent df9aac8 commit 862ccca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ protected SecurityFilterChain configure(HttpSecurity httpSecurity) throws Except
.sessionManagement((sessionManagement) ->
sessionManagement.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
.authorizeHttpRequests((authorizeHttpRequests) ->
authorizeHttpRequests.requestMatchers( "/api/oauth/**").permitAll().anyRequest().authenticated());
authorizeHttpRequests
.requestMatchers( "/api/auth/**").permitAll()
.requestMatchers( "/v3/api-docs/**").permitAll()
.requestMatchers( "/swagger-ui/**").permitAll()
.anyRequest().authenticated());

httpSecurity.addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private void setAuthentication(String accessToken) {
@Override
protected boolean shouldNotFilter(HttpServletRequest request) {
String path = request.getRequestURI();
return path.startsWith("/api/auth") || path.startsWith("/swagger-ui");
return path.startsWith("/api/auth") || path.startsWith("/v3/api-docs") || path.startsWith("/swagger-ui");
}

private String parseBearerToken(HttpServletRequest request) {
Expand Down

0 comments on commit 862ccca

Please sign in to comment.