- Added endpoints for sending and confirming email verification, enhancing user account security. - Integrated two-factor authentication (2FA) with TOTP support, including enabling, verifying, and disabling 2FA. - Implemented social login functionality for Google and Facebook, allowing users to authenticate using their existing accounts. - Updated dependency injection to include services for email, 2FA, and social login. - Enhanced documentation to reflect new features and usage examples for email verification and 2FA.
70 lines
2.6 KiB
C#
70 lines
2.6 KiB
C#
namespace StorageService.Infrastructure.Configuration;
|
|
|
|
/// <summary>
|
|
/// EN: Storage settings for MinIO and Aliyun OSS.
|
|
/// VI: Cấu hình storage cho MinIO và Aliyun OSS.
|
|
/// </summary>
|
|
public class StorageSettings
|
|
{
|
|
public const string SectionName = "Storage";
|
|
|
|
/// <summary>EN: Active storage provider (minio or aliyun) / VI: Provider storage đang dùng (minio hoặc aliyun)</summary>
|
|
public string Provider { get; set; } = "minio";
|
|
|
|
/// <summary>EN: Default bucket name / VI: Tên bucket mặc định</summary>
|
|
public string DefaultBucket { get; set; } = "storage";
|
|
|
|
/// <summary>EN: Pre-signed URL expiration in seconds / VI: Thời gian hết hạn pre-signed URL (giây)</summary>
|
|
public int PreSignedUrlExpirationSeconds { get; set; } = 3600;
|
|
|
|
/// <summary>EN: Maximum file size in bytes / VI: Kích thước file tối đa (bytes)</summary>
|
|
public long MaxFileSizeBytes { get; set; } = 104857600; // 100MB
|
|
|
|
/// <summary>EN: MinIO configuration / VI: Cấu hình MinIO</summary>
|
|
public MinioSettings MinIO { get; set; } = new();
|
|
|
|
/// <summary>EN: Aliyun OSS configuration / VI: Cấu hình Aliyun OSS</summary>
|
|
public AliyunOssSettings AliyunOSS { get; set; } = new();
|
|
}
|
|
|
|
/// <summary>
|
|
/// EN: MinIO-specific settings.
|
|
/// VI: Cấu hình riêng cho MinIO.
|
|
/// </summary>
|
|
public class MinioSettings
|
|
{
|
|
/// <summary>EN: MinIO endpoint (host:port) / VI: Endpoint MinIO (host:port)</summary>
|
|
public string Endpoint { get; set; } = "localhost:9000";
|
|
|
|
/// <summary>EN: Access key / VI: Access key</summary>
|
|
public string AccessKey { get; set; } = string.Empty;
|
|
|
|
/// <summary>EN: Secret key / VI: Secret key</summary>
|
|
public string SecretKey { get; set; } = string.Empty;
|
|
|
|
/// <summary>EN: Use SSL/HTTPS / VI: Sử dụng SSL/HTTPS</summary>
|
|
public bool UseSSL { get; set; } = false;
|
|
|
|
/// <summary>EN: Region (optional) / VI: Region (tùy chọn)</summary>
|
|
public string? Region { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// EN: Aliyun OSS-specific settings.
|
|
/// VI: Cấu hình riêng cho Aliyun OSS.
|
|
/// </summary>
|
|
public class AliyunOssSettings
|
|
{
|
|
/// <summary>EN: OSS endpoint / VI: Endpoint OSS</summary>
|
|
public string Endpoint { get; set; } = string.Empty;
|
|
|
|
/// <summary>EN: Access key ID / VI: Access key ID</summary>
|
|
public string AccessKeyId { get; set; } = string.Empty;
|
|
|
|
/// <summary>EN: Access key secret / VI: Access key secret</summary>
|
|
public string AccessKeySecret { get; set; } = string.Empty;
|
|
|
|
/// <summary>EN: Region / VI: Region</summary>
|
|
public string Region { get; set; } = string.Empty;
|
|
}
|