2025-12-10 19:12:54 +07:00
|
|
|
package ru.soune.nocopy.configuration;
|
2025-11-24 12:29:32 +07:00
|
|
|
|
2026-01-13 13:28:09 +07:00
|
|
|
import com.vrt.fileprotection.FileProtector;
|
2026-01-08 03:22:32 +07:00
|
|
|
import lombok.AllArgsConstructor;
|
2025-11-24 12:29:32 +07:00
|
|
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
|
|
|
|
import org.springframework.security.crypto.password.PasswordEncoder;
|
|
|
|
|
|
2026-01-08 03:22:32 +07:00
|
|
|
import java.util.Collections;
|
|
|
|
|
|
2025-11-24 12:29:32 +07:00
|
|
|
@Configuration
|
|
|
|
|
@EnableAutoConfiguration
|
2026-01-08 03:22:32 +07:00
|
|
|
@AllArgsConstructor
|
2025-11-24 12:29:32 +07:00
|
|
|
public class ApplicationConfig {
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
|
PasswordEncoder passwordEncoder() {
|
|
|
|
|
return new BCryptPasswordEncoder();
|
|
|
|
|
}
|
2026-01-08 03:22:32 +07:00
|
|
|
|
|
|
|
|
@Bean
|
2026-01-13 13:28:09 +07:00
|
|
|
public com.vrt.NoCopyFileService noCopyFileService(
|
|
|
|
|
FileProtector.FileProvider fileProvider,
|
|
|
|
|
FileProtector.ProcessingListener processingListener) {
|
2026-01-08 03:22:32 +07:00
|
|
|
|
2026-01-13 13:28:09 +07:00
|
|
|
return new com.vrt.NoCopyFileService(
|
|
|
|
|
Collections.emptyList(),
|
|
|
|
|
fileProvider,
|
|
|
|
|
processingListener
|
|
|
|
|
);
|
2026-01-08 03:22:32 +07:00
|
|
|
}
|
2025-11-24 12:29:32 +07:00
|
|
|
}
|
2026-01-13 13:28:09 +07:00
|
|
|
|