Browse Source
Handle null in Region/ServiceURL setters and tighten nullable hints
- Clear configuration entry when Region or ServiceURL is set to null
- Annotate DeleteObjectsAsync prefix and continuationToken as nullable
- Replace vague Region placeholder in aws.md example
pull/22962/head
maliming
2 months ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
3 changed files with
21 additions and
5 deletions
docs/en/framework/infrastructure/blob-storing/aws.md
framework/src/Volo.Abp.BlobStoring.Aws/Volo/Abp/BlobStoring/Aws/AwsBlobProviderConfiguration.cs
framework/test/Volo.Abp.BlobStoring.Aws.Tests/Volo/Abp/BlobStoring/Aws/AbpBlobStoringAwsTestModule.cs
@ -41,7 +41,7 @@ Configure<AbpBlobStoringOptions>(options =>
Aws.UseTemporaryFederatedCredentials = "set true to use temporary federated credentials";
Aws.ProfileName = "the name of the profile to get credentials from";
Aws.ProfilesLocation = "the path to the aws credentials file to look at";
Aws.Region = "the system name of the service ";
Aws.Region = "the AWS region system name, e.g. us-east-1 ";
Aws.ServiceURL = "custom service URL for S3-compatible APIs (optional)";
Aws.Name = "the name of the federated user";
Aws.Policy = "policy";
@ -64,7 +64,15 @@ public class AwsBlobProviderConfiguration
/// </summary>
public string? Region {
get = > _ containerConfiguration . GetConfigurationOrDefault < string > ( AwsBlobProviderConfigurationNames . Region ) ;
set = > _ containerConfiguration . SetConfiguration ( AwsBlobProviderConfigurationNames . Region , value ) ;
set
{
if ( value = = null )
{
_ containerConfiguration . ClearConfiguration ( AwsBlobProviderConfigurationNames . Region ) ;
return ;
}
_ containerConfiguration . SetConfiguration ( AwsBlobProviderConfigurationNames . Region , value ) ;
}
}
/// <summary>
@ -74,7 +82,15 @@ public class AwsBlobProviderConfiguration
/// </summary>
public string? ServiceURL {
get = > _ containerConfiguration . GetConfigurationOrDefault < string > ( AwsBlobProviderConfigurationNames . ServiceURL ) ;
set = > _ containerConfiguration . SetConfiguration ( AwsBlobProviderConfigurationNames . ServiceURL , value ) ;
set
{
if ( value = = null )
{
_ containerConfiguration . ClearConfiguration ( AwsBlobProviderConfigurationNames . ServiceURL ) ;
return ;
}
_ containerConfiguration . SetConfiguration ( AwsBlobProviderConfigurationNames . ServiceURL , value ) ;
}
}
/// <summary>
@ -139,9 +139,9 @@ public class AbpBlobStoringAwsTestModule : AbpModule
}
}
private async Task DeleteObjectsAsync ( AmazonS3Client client , string prefix )
private async Task DeleteObjectsAsync ( AmazonS3Client client , string? prefix )
{
string continuationToken = null ;
string? continuationToken = null ;
do
{
var listResponse = await client . ListObjectsV2Async ( new ListObjectsV2Request