Class SecurityConfig

java.lang.Object
ru.averkiev.greenchat_auth.configs.SecurityConfig

@Configuration @EnableWebSecurity @EnableMethodSecurity public class SecurityConfig extends Object
Класс представляет собой конфигурацию безопасности для микросервиса аутентификации и авторизации. Он определяет основные настройки и компоненты, связанные с безопасностью, используемые в микросервисе.
Author:
mrGreenNV
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
    Создаёт экземпляр объекта BCryptPasswordEncoder, который будет использоваться для хеширования паролей.
    org.springframework.security.web.SecurityFilterChain
    filterChain(org.springframework.security.config.annotation.web.builders.HttpSecurity httpSecurity)
    Позволяет настроить httpSecurity
    org.springframework.web.client.RestTemplate
    Создает экземпляр объекта RestTemplate, который будет использоваться для взаимодействия с другими микросервисами через HTTP.

    Methods inherited from class java.lang.Object

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

    • SecurityConfig

      public SecurityConfig()
  • Method Details

    • restTemplate

      @Bean public org.springframework.web.client.RestTemplate restTemplate()
      Создает экземпляр объекта RestTemplate, который будет использоваться для взаимодействия с другими микросервисами через HTTP.
      Returns:
      возвращает экземпляр объекта RestTemplate.
    • bCryptPasswordEncoder

      @Bean public org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder bCryptPasswordEncoder()
      Создаёт экземпляр объекта BCryptPasswordEncoder, который будет использоваться для хеширования паролей.
      Returns:
      экземпляр объекта BCryptPasswordEncoder
    • filterChain

      @Bean public org.springframework.security.web.SecurityFilterChain filterChain(org.springframework.security.config.annotation.web.builders.HttpSecurity httpSecurity) throws Exception
      Позволяет настроить httpSecurity
      Parameters:
      httpSecurity - параметр безопасности http.
      Returns:
      объект SecurityFilterChain
      Throws:
      Exception - выбрасывает, если появляется ошибка во время выполнения фильтрации запросов