Amazon S3 (and S3-compatible) storage implementation for OwlCore.Storage.
The library currently targets netstandard2.0, net8.0, net9.0, net10.0.
S3FolderS3FileS3ReadWriteStream
- Folder semantics are represented over object keys.
- Stream writes use multipart upload when needed.
CreateCopyOfAsync/MoveFromAsyncuse server-side S3 copy when available.- If a provider rejects S3 copy semantics (for example copy-source related 400 responses), the implementation falls back to stream-copy for compatibility.
using Amazon.Runtime;
using Amazon.S3;
using OwlCore.Storage.AmazonS3;
var client = new AmazonS3Client(
new BasicAWSCredentials("accessKey", "secretKey"),
new AmazonS3Config
{
ServiceURL = "https://your-s3-endpoint",
ForcePathStyle = true,
AuthenticationRegion = "us-east-1"
});
var folder = new S3Folder(client, "my-bucket", "app-data");
var file = await folder.CreateFileAsync("hello.txt");
await file.WriteBytesAsync("Hello"u8.ToArray());dotnet restore
dotnet buildTest project:
tests/OwlCore.Storage.AmazonS3.Tests.csproj
SUPABASE_S3_ENDPOINTSUPABASE_S3_ACCESS_KEYSUPABASE_S3_SECRET_KEYSUPABASE_S3_BUCKET
Optional:
SUPABASE_S3_REGION(defaultus-east-1)SUPABASE_S3_FORCE_PATH_STYLE(defaulttrue)
A tests.runsettings file is included at repo root.
Run tests:
dotnet test tests/OwlCore.Storage.AmazonS3.Tests.csproj --settings tests.runsettingsThe test project also defines RunSettingsFilePath, so this also works:
dotnet test tests/OwlCore.Storage.AmazonS3.Tests.csprojWorkflow file:
.github/workflows/ci.yml
build runs on every push/PR to main.
test-supabase runs only when required secrets are set.
Set these repository Secrets:
SUPABASE_S3_ENDPOINTSUPABASE_S3_ACCESS_KEYSUPABASE_S3_SECRET_KEYSUPABASE_S3_BUCKET
Optional repository Variables:
SUPABASE_S3_REGION(recommendedus-east-1)SUPABASE_S3_FORCE_PATH_STYLE(truerecommended)
- folder tests are scoped under
oc-foldertests/... - file tests are scoped under
oc-filetests/... - those prefixes are cleaned before/after class execution
See LICENSE.