Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/dotnet_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
dotnet-version: 10.0.x
- name: Test
run: dotnet test --no-build --verbosity normal
run: |
dotnet test test/FileParty.Core.Tests/FileParty.Core.Tests.csproj --configuration Release --verbosity normal
dotnet test test/FileParty.Handlers.FileSystem.Tests/FileParty.Handlers.FileSystem.Tests.csproj --configuration Release --verbosity normal
dotnet test test/FileParty.Handlers.AWS.S3.Tests/FileParty.Handlers.AWS.S3.Tests.csproj --configuration Release-V3 --verbosity normal
dotnet test test/FileParty.Handlers.AWS.S3.Tests/FileParty.Handlers.AWS.S3.Tests.csproj --configuration Release-V4 --verbosity normal
env:
"fileparty_s3_region": ${{ secrets.TEST_S3_REGION }}
"fileparty_s3_bucket": ${{ secrets.TEST_S3_BUCKET }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
dotnet-version: 10.0.x
- name: Build and Publish Nuget Packages
id: csharp_nuget_publish
uses: JankwareDotCom/nuget_publish@0.4.0
Expand Down
38 changes: 30 additions & 8 deletions FileParty.sln
Original file line number Diff line number Diff line change
Expand Up @@ -27,36 +27,58 @@ Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
Debug-V4|Any CPU = Debug-V4|Any CPU
Release-V4|Any CPU = Release-V4|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F4F0963C-2998-4B87-8BFD-2CF12A5ABDA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F4F0963C-2998-4B87-8BFD-2CF12A5ABDA4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F4F0963C-2998-4B87-8BFD-2CF12A5ABDA4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F4F0963C-2998-4B87-8BFD-2CF12A5ABDA4}.Release|Any CPU.Build.0 = Release|Any CPU
{F4F0963C-2998-4B87-8BFD-2CF12A5ABDA4}.Debug-V4|Any CPU.ActiveCfg = Debug|Any CPU
{F4F0963C-2998-4B87-8BFD-2CF12A5ABDA4}.Debug-V4|Any CPU.Build.0 = Debug|Any CPU
{F4F0963C-2998-4B87-8BFD-2CF12A5ABDA4}.Release-V4|Any CPU.ActiveCfg = Release|Any CPU
{F4F0963C-2998-4B87-8BFD-2CF12A5ABDA4}.Release-V4|Any CPU.Build.0 = Release|Any CPU
{792B430A-5277-44B8-9284-2D0C256DF22D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{792B430A-5277-44B8-9284-2D0C256DF22D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{792B430A-5277-44B8-9284-2D0C256DF22D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{792B430A-5277-44B8-9284-2D0C256DF22D}.Release|Any CPU.Build.0 = Release|Any CPU
{792B430A-5277-44B8-9284-2D0C256DF22D}.Debug-V4|Any CPU.ActiveCfg = Debug|Any CPU
{792B430A-5277-44B8-9284-2D0C256DF22D}.Debug-V4|Any CPU.Build.0 = Debug|Any CPU
{792B430A-5277-44B8-9284-2D0C256DF22D}.Release-V4|Any CPU.ActiveCfg = Release|Any CPU
{792B430A-5277-44B8-9284-2D0C256DF22D}.Release-V4|Any CPU.Build.0 = Release|Any CPU
{739F3D2D-5541-47A3-9C97-5329FB8583CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{739F3D2D-5541-47A3-9C97-5329FB8583CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{739F3D2D-5541-47A3-9C97-5329FB8583CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{739F3D2D-5541-47A3-9C97-5329FB8583CE}.Release|Any CPU.Build.0 = Release|Any CPU
{E557D9D3-A8B9-4D31-BD7A-631C13025ABA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E557D9D3-A8B9-4D31-BD7A-631C13025ABA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E557D9D3-A8B9-4D31-BD7A-631C13025ABA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E557D9D3-A8B9-4D31-BD7A-631C13025ABA}.Release|Any CPU.Build.0 = Release|Any CPU
{739F3D2D-5541-47A3-9C97-5329FB8583CE}.Debug-V4|Any CPU.ActiveCfg = Debug-V4|Any CPU
{739F3D2D-5541-47A3-9C97-5329FB8583CE}.Debug-V4|Any CPU.Build.0 = Debug-V4|Any CPU
{739F3D2D-5541-47A3-9C97-5329FB8583CE}.Release-V4|Any CPU.ActiveCfg = Release-V4|Any CPU
{739F3D2D-5541-47A3-9C97-5329FB8583CE}.Release-V4|Any CPU.Build.0 = Release-V4|Any CPU
{C17D1DB1-7C20-413E-BC69-A0656720FA33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C17D1DB1-7C20-413E-BC69-A0656720FA33}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C17D1DB1-7C20-413E-BC69-A0656720FA33}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C17D1DB1-7C20-413E-BC69-A0656720FA33}.Release|Any CPU.Build.0 = Release|Any CPU
{C17D1DB1-7C20-413E-BC69-A0656720FA33}.Debug-V4|Any CPU.ActiveCfg = Debug|Any CPU
{C17D1DB1-7C20-413E-BC69-A0656720FA33}.Debug-V4|Any CPU.Build.0 = Debug|Any CPU
{C17D1DB1-7C20-413E-BC69-A0656720FA33}.Release-V4|Any CPU.ActiveCfg = Release|Any CPU
{C17D1DB1-7C20-413E-BC69-A0656720FA33}.Release-V4|Any CPU.Build.0 = Release|Any CPU
{4ADB9737-3274-4E6C-ABA0-FE214D89807D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4ADB9737-3274-4E6C-ABA0-FE214D89807D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4ADB9737-3274-4E6C-ABA0-FE214D89807D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4ADB9737-3274-4E6C-ABA0-FE214D89807D}.Release|Any CPU.Build.0 = Release|Any CPU
{22ED881A-4D94-4A4E-B908-BD1F4CCFB026}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{22ED881A-4D94-4A4E-B908-BD1F4CCFB026}.Debug|Any CPU.Build.0 = Debug|Any CPU
{22ED881A-4D94-4A4E-B908-BD1F4CCFB026}.Release|Any CPU.ActiveCfg = Release|Any CPU
{22ED881A-4D94-4A4E-B908-BD1F4CCFB026}.Release|Any CPU.Build.0 = Release|Any CPU
{4ADB9737-3274-4E6C-ABA0-FE214D89807D}.Debug-V4|Any CPU.ActiveCfg = Debug|Any CPU
{4ADB9737-3274-4E6C-ABA0-FE214D89807D}.Debug-V4|Any CPU.Build.0 = Debug|Any CPU
{4ADB9737-3274-4E6C-ABA0-FE214D89807D}.Release-V4|Any CPU.ActiveCfg = Release|Any CPU
{4ADB9737-3274-4E6C-ABA0-FE214D89807D}.Release-V4|Any CPU.Build.0 = Release|Any CPU
{E557D9D3-A8B9-4D31-BD7A-631C13025ABA}.Debug|Any CPU.ActiveCfg = Debug-V3|Any CPU
{E557D9D3-A8B9-4D31-BD7A-631C13025ABA}.Debug|Any CPU.Build.0 = Debug-V3|Any CPU
{E557D9D3-A8B9-4D31-BD7A-631C13025ABA}.Debug-V4|Any CPU.ActiveCfg = Debug-V4|Any CPU
{E557D9D3-A8B9-4D31-BD7A-631C13025ABA}.Debug-V4|Any CPU.Build.0 = Debug-V4|Any CPU
{E557D9D3-A8B9-4D31-BD7A-631C13025ABA}.Release|Any CPU.ActiveCfg = Release-V3|Any CPU
{E557D9D3-A8B9-4D31-BD7A-631C13025ABA}.Release|Any CPU.Build.0 = Release-V3|Any CPU
{E557D9D3-A8B9-4D31-BD7A-631C13025ABA}.Release-V4|Any CPU.ActiveCfg = Release-V4|Any CPU
{E557D9D3-A8B9-4D31-BD7A-631C13025ABA}.Release-V4|Any CPU.Build.0 = Release-V4|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{4ADB9737-3274-4E6C-ABA0-FE214D89807D} = {5C3F1ED6-EBB2-443C-8222-CC938FF2EB21}
Expand Down
8 changes: 5 additions & 3 deletions src/FileParty.Core/FileParty.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>1.3.0</Version>
<Version>2.0.0</Version>
<Authors>Jankware</Authors>
<Description>Agnostic File Storage, Core Project, Service Registration</Description>
<PackageProjectUrl>https://github.com/JankwareDotCom/FileParty</PackageProjectUrl>
<RepositoryUrl>https://github.com/JankwareDotCom/FileParty</RepositoryUrl>
<TargetFrameworks>net6.0;net8.0;netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks>net8.0;net10.0;netstandard2.0;netstandard2.1</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Title>Jankware FileParty</Title>
<ReadMe>https://raw.githubusercontent.com/JankwareDotCom/FileParty/main/README.md</ReadMe>
<Configurations>Debug;Release;Debug-V4;Release-V4</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>


Expand All @@ -24,7 +26,7 @@
</Target>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="[5, )" IncludeAssets="all" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="[9.0.0,)" IncludeAssets="all" />
</ItemGroup>

</Project>
5 changes: 4 additions & 1 deletion src/FileParty.Providers.AWS.S3/AWS.S3Module.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
using FileParty.Core;
using System;
using FileParty.Core;
using FileParty.Core.Registration;
using FileParty.Providers.AWS.S3.Interfaces;

namespace FileParty.Providers.AWS.S3
{
public class AWS_S3Module : BaseFilePartyModule<S3StorageProvider, S3StorageProvider>
{
public static readonly bool IsAwsSdkV4 = Type.GetType("Amazon.Runtime.Credentials.DefaultAWSCredentialsIdentityResolver, AWSSDK.Core") != null;

public AWS_S3Module()
{
this.RegisterModuleDependency<AWS_S3Module,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@ internal async Task<AWSCredentials> AssumeRoleAsync(IFilePartyAWSCredentialFacto
? nameof(FileParty) + "_" + nameof(AWS_S3Module) + "_" + _internalIdentifier
: RoleSessionName;

using (var stsClient = new AmazonSecurityTokenServiceClient(credFactory.GetAmazonCredentials(_baseConfig)))
var creds = credFactory.GetAmazonCredentials(_baseConfig);
var config = new AmazonSecurityTokenServiceConfig
{
RegionEndpoint = this.GetRegionEndpoint()
};

using (var stsClient = new AmazonSecurityTokenServiceClient(creds, config))
{
try
{
Expand Down
10 changes: 9 additions & 1 deletion src/FileParty.Providers.AWS.S3/Config/AWSSessionCredentials.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Threading.Tasks;
using Amazon;
using Amazon.Runtime;
using Amazon.SecurityToken;
using Amazon.SecurityToken.Model;
Expand Down Expand Up @@ -43,7 +44,14 @@ internal async Task<SessionAWSCredentials> GetTemporaryCredentialsAsync(
return _sessionCredentials;
}

using (var stsClient = new AmazonSecurityTokenServiceClient(credFactory.GetAmazonCredentials(_baseConfig)))
var creds = credFactory.GetAmazonCredentials(_baseConfig);

var config = new AmazonSecurityTokenServiceConfig
{
RegionEndpoint = this.GetRegionEndpoint()
};

using (var stsClient = new AmazonSecurityTokenServiceClient(creds, config))
{
var getSessionTokenRequest = new GetSessionTokenRequest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,5 @@ public AWSStoredProfileConfiguration(string profileName, string profileLocation)

public string ProfileName { get; set; } = "default";
public string ProfileLocation { get; set; }

internal StoredProfileAWSCredentials GetConfig()
{
return string.IsNullOrWhiteSpace(ProfileLocation)
? string.IsNullOrWhiteSpace(ProfileName)
? new StoredProfileAWSCredentials()
: new StoredProfileAWSCredentials(ProfileName)
: string.IsNullOrWhiteSpace(ProfileName)
? new StoredProfileAWSCredentials("default", ProfileLocation)
: new StoredProfileAWSCredentials(ProfileName, ProfileLocation);
}
}
}
35 changes: 31 additions & 4 deletions src/FileParty.Providers.AWS.S3/FileParty.Providers.AWS.S3.csproj
Original file line number Diff line number Diff line change
@@ -1,22 +1,49 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net8.0;netstandard2.0;netstandard2.1</TargetFrameworks>
<Version>1.3.0</Version>
<TargetFrameworks>net8.0;net10.0;netstandard2.0;netstandard2.1</TargetFrameworks>
<Version>2.0.0</Version>
<Description>Agnostic File Storage, AWS S3 Module</Description>
<PackageProjectUrl>https://github.com/JankwareDotCom/FileParty</PackageProjectUrl>
<RepositoryUrl>https://github.com/JankwareDotCom/FileParty</RepositoryUrl>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Configurations>Debug;Release;Debug-V3;Release-V3;Debug-V4;Release-V4</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Debug' OR '$(Configuration)' == 'Release'">
<DefineConstants>$(DefineConstants);AWS_SDK_ANY</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Debug-V3' OR '$(Configuration)' == 'Release-V3'">
<DefineConstants>$(DefineConstants);AWS_SDK_V3</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Debug-V4' OR '$(Configuration)' == 'Release-V4'">
<DefineConstants>$(DefineConstants);AWS_SDK_V4</DefineConstants>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\FileParty.Core\FileParty.Core.csproj"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="AWSSDK.S3" Version="[3.7.8,4)" IncludeAssets="all" PrivateAssets="compile"/>
<PackageReference Include="AWSSDK.SecurityToken" Version="[3.7.1,4)"/>
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.*"/>
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' == 'Debug' OR '$(Configuration)' == 'Release'">
<PackageReference Include="AWSSDK.S3" Version="[3.7.400,5)" IncludeAssets="all" PrivateAssets="compile"/>
<PackageReference Include="AWSSDK.SecurityToken" Version="[3.7.400,5)" IncludeAssets="all" PrivateAssets="compile"/>
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' == 'Debug-V3' OR '$(Configuration)' == 'Release-V3'">
<PackageReference Include="AWSSDK.S3" Version="[3.7.400.1,4)" IncludeAssets="all" PrivateAssets="compile"/>
<PackageReference Include="AWSSDK.SecurityToken" Version="[3.7.400,4)" IncludeAssets="all" PrivateAssets="compile"/>
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' == 'Debug-V4' OR '$(Configuration)' == 'Release-V4'">
<PackageReference Include="AWSSDK.S3" Version="[4.0.0,5)" IncludeAssets="all" PrivateAssets="compile"/>
<PackageReference Include="AWSSDK.SecurityToken" Version="[4.0.0,5)" IncludeAssets="all" PrivateAssets="compile"/>
</ItemGroup>

</Project>
53 changes: 51 additions & 2 deletions src/FileParty.Providers.AWS.S3/FilePartyAWSCredentialFactory.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using Amazon.Runtime;
using Amazon.Runtime.CredentialManagement;
using Amazon.Runtime.Credentials;
using Amazon.S3;
using Amazon.SecurityToken;
using FileParty.Core.Exceptions;
Expand Down Expand Up @@ -31,9 +36,27 @@ public virtual AWSCredentials GetAmazonCredentials(StorageProviderConfiguration<
.GetAwaiter()
.GetResult();
case AWSDefaultConfiguration _:
return FallbackCredentialsFactory.GetCredentials(false);
return GetDefaultCredentials();
case AWSStoredProfileConfiguration storedProfileConfiguration:
return storedProfileConfiguration.GetConfig();
{
var profileLocation = string.IsNullOrWhiteSpace(storedProfileConfiguration.ProfileLocation)
? null
: Directory.Exists(storedProfileConfiguration.ProfileLocation)
? Path.Combine(storedProfileConfiguration.ProfileLocation, "credentials")
: storedProfileConfiguration.ProfileLocation;

var profileName = string.IsNullOrWhiteSpace(storedProfileConfiguration.ProfileName)
? "default"
: storedProfileConfiguration.ProfileName;

var chain = string.IsNullOrWhiteSpace(profileLocation)
? new CredentialProfileStoreChain()
: new CredentialProfileStoreChain(profileLocation);

return chain.TryGetAWSCredentials(profileName, out var creds)
? creds
: throw Errors.InvalidConfiguration;
}
case AWSInstanceProfileConfiguration instanceConfiguration:
return new InstanceProfileAWSCredentials(instanceConfiguration.Role);
}
Expand All @@ -57,5 +80,31 @@ public virtual AWSCredentials GetAmazonCredentials(StorageProviderConfiguration<

throw Errors.InvalidConfiguration;
}

private static AWSCredentials GetDefaultCredentials()
{
return !AWS_S3Module.IsAwsSdkV4
? (AWSCredentials) V3GetCredentialsMethod
?.Invoke(null, new object[]{false})
?? throw new InvalidOperationException("Unable to get v3 credentials")
: (AWSCredentials) V4GetCredentialsMethod
?.Invoke(null, V4GetCredentialsMethod.GetParameters()
.Select(s => Convert.ChangeType(null, s.ParameterType)).ToArray())
?? throw new InvalidOperationException("Unable to get credentials");
}



private static readonly MethodInfo V4GetCredentialsMethod =
AWS_S3Module.IsAwsSdkV4
? Type.GetType("Amazon.Runtime.Credentials.DefaultAWSCredentialsIdentityResolver, AWSSDK.Core")
?.GetMethod("GetCredentials")
: null;

private static readonly MethodInfo V3GetCredentialsMethod =
!AWS_S3Module.IsAwsSdkV4
? Type.GetType("Amazon.Runtime.FallbackCredentialsFactory, AWSSDK.Core")
?.GetMethod("GetCredentials", new[]{typeof(bool)})
: null;
}
}
16 changes: 8 additions & 8 deletions src/FileParty.Providers.AWS.S3/S3StorageProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public virtual async Task<bool> ExistsAsync(string storagePointer,
using (var s3Wrapper = new FilePartyS3ClientWrapper(_s3ClientFactory))
{
var _ = await s3Wrapper.ExecuteAsync(
(s3Client) => GetInformationAsync(s3Client, storagePointer, cancellationToken));
async (s3Client) => await GetInformationAsync(s3Client, storagePointer, cancellationToken));
}

return true;
Expand All @@ -153,12 +153,12 @@ public virtual async Task<bool> ExistsAsync(string storagePointer,
}
}

public virtual Task<IDictionary<string, bool>> ExistsAsync(IEnumerable<string> storagePointers,
public virtual async Task<IDictionary<string, bool>> ExistsAsync(IEnumerable<string> storagePointers,
CancellationToken cancellationToken = default)
{
using (var s3Wrapper = new FilePartyS3ClientWrapper(_s3ClientFactory))
{
return s3Wrapper.ExecuteAsync((s3Client) =>
return await s3Wrapper.ExecuteAsync((s3Client) =>
{
IDictionary<string, bool> result = storagePointers
.ToDictionary(
Expand All @@ -170,12 +170,12 @@ public virtual Task<IDictionary<string, bool>> ExistsAsync(IEnumerable<string> s
}
}

public Task<StoredItemType?> TryGetStoredItemTypeAsync(string storagePointer,
public async Task<StoredItemType?> TryGetStoredItemTypeAsync(string storagePointer,
CancellationToken cancellationToken = default)
{
using (var s3Wrapper = new FilePartyS3ClientWrapper(_s3ClientFactory))
{
return s3Wrapper.ExecuteAsync((s3Client) =>
return await s3Wrapper.ExecuteAsync((s3Client) =>
TryGetStoredItemTypeAsync(s3Client, storagePointer, cancellationToken));
}
}
Expand Down Expand Up @@ -276,7 +276,7 @@ protected virtual async Task<StoredItemInformation> GetFileInformation(AmazonS3C

result.StoredType = StoredItemType.File;
result.Size = omInfo.ContentLength;
result.LastModifiedTimestamp = omInfo.LastModified.ToUniversalTime();
result.LastModifiedTimestamp = (omInfo.LastModified as DateTime?).GetValueOrDefault().ToUniversalTime();
result.StoragePointer = storagePointer;
return result;
}
Expand Down Expand Up @@ -452,9 +452,9 @@ protected virtual async Task DeleteAsync(AmazonS3Client s3Client, IEnumerable<st
}, cancellationToken)
.ConfigureAwait(false);

if (!directoryContents.S3Objects.Any()) break;
if (directoryContents.S3Objects is null || directoryContents.S3Objects.Count == 0) break;

await DeleteAsync(directoryContents.S3Objects.Select(s => s.Key).ToArray(), cancellationToken);
await DeleteAsync(directoryContents.S3Objects?.Select(s => s.Key).ToArray(), cancellationToken);
}
}
}
Expand Down
Loading
Loading