Skip to content

Commit

Permalink
Code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
abh1navv committed Oct 9, 2024
1 parent 2ed24d1 commit 8858700
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,25 @@
import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer;
import org.springframework.security.web.SecurityFilterChain;


@Configuration
@EnableWebSecurity
public class SecurityConfig {

@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {

http.authorizeHttpRequests(authorizeRequests ->
authorizeRequests
.requestMatchers("/swagger-ui/**").permitAll()
.requestMatchers("/v3/api-docs/**").permitAll()
);
http.authorizeHttpRequests(authorizeRequests -> authorizeRequests.requestMatchers("/swagger-ui/**")
.permitAll()
.requestMatchers("/v3/api-docs/**")
.permitAll());

return http.build();
}

@Bean
public WebSecurityCustomizer webSecurityCustomizer() {
return (web) -> web.ignoring().requestMatchers("/swagger-ui/**", "/v3/api-docs/**");
return (web) -> web.ignoring()
.requestMatchers("/swagger-ui/**", "/v3/api-docs/**");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ public class SwaggerConfig {
@Bean
public GroupedOpenApi publicApi() {
return GroupedOpenApi.builder()
.group("public")
.pathsToMatch("/**")
.build();
.group("public")
.pathsToMatch("/**")
.build();
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.baeldung.swagger.controller;


import io.swagger.v3.oas.annotations.Operation;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

Expand Down

0 comments on commit 8858700

Please sign in to comment.