diff --git a/src/main/java/com/example/onomatopoeiaback/controller/EmployeeController.java b/src/main/java/com/example/onomatopoeiaback/controller/EmployeeController.java index 12451fb..e3f23e7 100644 --- a/src/main/java/com/example/onomatopoeiaback/controller/EmployeeController.java +++ b/src/main/java/com/example/onomatopoeiaback/controller/EmployeeController.java @@ -9,6 +9,7 @@ import com.example.onomatopoeiaback.service.EmployeeService; import com.example.onomatopoeiaback.service.VisitService; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; +import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import java.util.List; diff --git a/src/main/java/com/example/onomatopoeiaback/security/CustomAuthenticationProvider.java b/src/main/java/com/example/onomatopoeiaback/security/CustomAuthenticationProvider.java new file mode 100644 index 0000000..78044c5 --- /dev/null +++ b/src/main/java/com/example/onomatopoeiaback/security/CustomAuthenticationProvider.java @@ -0,0 +1,19 @@ +package com.example.onomatopoeiaback.security; + +import org.springframework.security.authentication.AuthenticationProvider; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.AuthenticationException; +import org.springframework.stereotype.Component; + +@Component +public class CustomAuthenticationProvider implements AuthenticationProvider { + @Override + public Authentication authenticate(Authentication authentication) throws AuthenticationException { + return null; + } + + @Override + public boolean supports(Class authentication) { + return false; + } +} diff --git a/src/main/java/com/example/onomatopoeiaback/security/SecurityConfig.java b/src/main/java/com/example/onomatopoeiaback/security/SecurityConfig.java new file mode 100644 index 0000000..e7971f6 --- /dev/null +++ b/src/main/java/com/example/onomatopoeiaback/security/SecurityConfig.java @@ -0,0 +1,16 @@ +package com.example.onomatopoeiaback.security; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Configurable; +import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.core.userdetails.UserDetailsService; + +@Configurable +@EnableWebSecurity +public class SecurityConfig { + @Autowired + private UserDetailsService userDetailsService; + + +} diff --git a/src/main/java/com/example/onomatopoeiaback/security/SwaggerConfig.java b/src/main/java/com/example/onomatopoeiaback/security/SwaggerConfig.java new file mode 100644 index 0000000..a070c56 --- /dev/null +++ b/src/main/java/com/example/onomatopoeiaback/security/SwaggerConfig.java @@ -0,0 +1,13 @@ +package com.example.onomatopoeiaback.security; + +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.security.SecurityScheme; +import org.springframework.context.annotation.Configuration; + +@Configuration +@SecurityScheme( + type = SecuritySchemeType.HTTP, + name = "basicAuth", + scheme = "basic") +public class SwaggerConfig { +}