Class WebSecurityConfig

java.lang.Object
ru.skypro.homework.config.WebSecurityConfig

@Configuration @EnableGlobalMethodSecurity(prePostEnabled=true) public class WebSecurityConfig extends Object
Конфигурационный класс безопасности приложения. Используется для настройки Spring Security, включая аутентификацию, авторизацию и CORS.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.security.authentication.AuthenticationManager
    authenticationManager(org.springframework.security.config.annotation.web.builders.HttpSecurity http)
    Конфигурация менеджера аутентификации.
    org.springframework.security.web.SecurityFilterChain
    filterChain(org.springframework.security.config.annotation.web.builders.HttpSecurity http)
    Настройка цепочки фильтров безопасности.
    org.springframework.security.crypto.password.PasswordEncoder
    Конфигурация кодировщика паролей.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • WebSecurityConfig

      public WebSecurityConfig()
  • Method Details

    • filterChain

      @Bean public org.springframework.security.web.SecurityFilterChain filterChain(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws Exception
      Настройка цепочки фильтров безопасности.
      Parameters:
      http - объект конфигурации безопасности
      Returns:
      сконфигурированный SecurityFilterChain
      Throws:
      Exception - в случае ошибки конфигурации
    • authenticationManager

      @Bean public org.springframework.security.authentication.AuthenticationManager authenticationManager(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws Exception
      Конфигурация менеджера аутентификации.
      Parameters:
      http - объект конфигурации безопасности
      Returns:
      сконфигурированный AuthenticationManager
      Throws:
      Exception - в случае ошибки конфигурации
    • passwordEncoder

      @Bean public org.springframework.security.crypto.password.PasswordEncoder passwordEncoder()
      Конфигурация кодировщика паролей. Используется BCrypt для безопасного хеширования паролей.
      Returns:
      экземпляр PasswordEncoder