Some changes
This commit is contained in:
@@ -6,20 +6,18 @@ namespace Musify.Application.Configuration
|
||||
{
|
||||
public const string SectionName = "Storage";
|
||||
|
||||
public string BucketName { get; set; } = string.Empty;
|
||||
|
||||
public string ServiceUrl { get; set; } = string.Empty;
|
||||
|
||||
public string AccessKey { get; set; } = string.Empty;
|
||||
|
||||
public string SecretAccessKey { get; set; } = string.Empty;
|
||||
|
||||
public string BucketName { get; set; } = string.Empty;
|
||||
|
||||
public bool ForcePathStyle { get; set; }
|
||||
|
||||
public bool UseHttp { get; set; }
|
||||
|
||||
public StorageRoutes Routes { get; set; } = new StorageRoutes();
|
||||
|
||||
public static StorageConfiguration Load(IConfiguration configuration)
|
||||
{
|
||||
var section = configuration.GetSection(SectionName).Get<StorageConfiguration>()
|
||||
@@ -32,8 +30,6 @@ namespace Musify.Application.Configuration
|
||||
static void Validate(StorageConfiguration configuration)
|
||||
{
|
||||
EnsureValue(configuration.BucketName, nameof(BucketName));
|
||||
EnsureValue(configuration.Routes.Uploads, $"{SectionName}:Route:Upload");
|
||||
|
||||
EnsureValue(configuration.ServiceUrl, nameof(ServiceUrl));
|
||||
EnsureValue(configuration.AccessKey, nameof(AccessKey));
|
||||
EnsureValue(configuration.SecretAccessKey, nameof(SecretAccessKey));
|
||||
@@ -45,9 +41,4 @@ namespace Musify.Application.Configuration
|
||||
throw new InvalidOperationException($"{name} configuration value not found.");
|
||||
}
|
||||
}
|
||||
|
||||
public class StorageRoutes
|
||||
{
|
||||
public string Uploads { get; set; } = "Uploads";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user