package org.octopus.internal.config.security
//
//import org.octopus.lorca_core.repositories.UserAuthRepository
//import org.springframework.context.annotation.Bean
//import org.springframework.context.annotation.Configuration
//import org.springframework.security.authentication.AuthenticationManager
//import org.springframework.security.authentication.AuthenticationProvider
//import org.springframework.security.authentication.dao.DaoAuthenticationProvider
//import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration
//import org.springframework.security.core.userdetails.UserDetailsService
//import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
//
//
//@Configuration
class JwtAuthConfiguration(
//    val userAuthRepository: UserAuthRepository
) {
//
//    @Bean
//    fun userDetailsService(): UserDetailsService {
//        return UserDetailsService { username: String? ->
//            userAuthRepository.getByUsername(username ?: "")
//        }
//    }
//
//    @Bean
//    fun passwordEncoder(): BCryptPasswordEncoder {
//        return BCryptPasswordEncoder()
//    }
//
//    @Bean
//    @Throws(Exception::class)
//    fun authenticationManager(config: AuthenticationConfiguration): AuthenticationManager {
//        return config.authenticationManager
//    }
//
//    @Bean
//    fun authenticationProvider(): AuthenticationProvider {
//        val authProvider = DaoAuthenticationProvider()
//
//        authProvider.setUserDetailsService(userDetailsService())
//        authProvider.setPasswordEncoder(passwordEncoder())
//
//        return authProvider
//    }
}