Class SecurityConfiguration

java.lang.Object
ru.gentoos.products.configs.SecurityConfiguration

@Configuration public class SecurityConfiguration extends Object
Конфигурация безопасности Spring Security. Включает HTTP Basic Auth для всех запросов, отключает CORS и CSRF (REST API без сессий).
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.security.web.SecurityFilterChain
    filterChain(org.springframework.security.config.annotation.web.builders.HttpSecurity http)
    Настраивает цепочку фильтров безопасности.

    Methods inherited from class java.lang.Object

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

    • SecurityConfiguration

      public SecurityConfiguration()
  • Method Details

    • filterChain

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