Skip to content

Commit

Permalink
fix: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaVetnic committed Jun 24, 2024
1 parent 765f6b7 commit 09ff4d9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ public static void AddBlobStorage(this IServiceCollection services, BlobStorageO
{
services.Configure<IonosS3Options>(opt =>
{
opt.ServiceUrl = options.IonosS3Config!.ServiceUrl!;
opt.AccessKey = options.IonosS3Config!.AccessKey!;
opt.SecretKey = options.IonosS3Config!.SecretKey!;
opt.BucketName = options.IonosS3Config!.BucketName!;
opt.ServiceUrl = options.IonosS3Config!.ServiceUrl;
opt.AccessKey = options.IonosS3Config!.AccessKey;
opt.SecretKey = options.IonosS3Config!.SecretKey;
opt.BucketName = options.IonosS3Config!.BucketName;
});

services.AddSingleton<IonosS3ClientFactory>();
Expand Down Expand Up @@ -71,9 +71,9 @@ public class BlobStorageOptions

public class IonosS3Config
{
public string? ServiceUrl { get; set; }
public string? AccessKey { get; set; }
public string? SecretKey { get; set; }
public string? BucketName { get; set; }
public required string ServiceUrl { get; set; } = string.Empty;
public required string AccessKey { get; set; } = string.Empty;
public required string SecretKey { get; set; } = string.Empty;
public required string BucketName { get; set; } = string.Empty;
}

15 changes: 11 additions & 4 deletions Modules/Files/src/Files.ConsumerApi/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,17 @@ public class SqlDatabaseConfiguration

public class IonosS3Config
{
public string? ServiceUrl { get; set; }
public string? AccessKey { get; set; }
public string? SecretKey { get; set; }
public string? BucketName { get; set; }
[Required]
public string ServiceUrl { get; set; } = string.Empty;

[Required]
public string AccessKey { get; set; } = string.Empty;

[Required]
public string SecretKey { get; set; } = string.Empty;

[Required]
public string BucketName { get; set; } = string.Empty;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,15 @@ public class BlobStorageConfiguration

public class IonosS3Config
{
public string? ServiceUrl { get; set; }
public string? AccessKey { get; set; }
public string? SecretKey { get; set; }
public string? BucketName { get; set; }
[Required]
public string ServiceUrl { get; set; } = string.Empty;

[Required]
public string AccessKey { get; set; } = string.Empty;

[Required]
public string SecretKey { get; set; } = string.Empty;

[Required]
public string BucketName { get; set; } = string.Empty;
}

0 comments on commit 09ff4d9

Please sign in to comment.