Class SecurityConfig
java.lang.Object
ru.averkiev.greenchat_auth.configs.SecurityConfig
Класс представляет собой конфигурацию безопасности для микросервиса аутентификации и авторизации.
Он определяет основные настройки и компоненты, связанные с безопасностью, используемые в микросервисе.
- Author:
- mrGreenNV
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
Создаёт экземпляр объекта BCryptPasswordEncoder, который будет использоваться для хеширования паролей.org.springframework.security.web.SecurityFilterChain
filterChain
(org.springframework.security.config.annotation.web.builders.HttpSecurity httpSecurity) Позволяет настроить httpSecurityorg.springframework.web.client.RestTemplate
Создает экземпляр объекта RestTemplate, который будет использоваться для взаимодействия с другими микросервисами через HTTP.
-
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
- выбрасывает, если появляется ошибка во время выполнения фильтрации запросов
-