ApricotFramework.ObjectStore
0.1.0
Prefix Reserved
dotnet add package ApricotFramework.ObjectStore --version 0.1.0
NuGet\Install-Package ApricotFramework.ObjectStore -Version 0.1.0
<PackageReference Include="ApricotFramework.ObjectStore" Version="0.1.0" />
<PackageVersion Include="ApricotFramework.ObjectStore" Version="0.1.0" />
<PackageReference Include="ApricotFramework.ObjectStore" />
paket add ApricotFramework.ObjectStore --version 0.1.0
#r "nuget: ApricotFramework.ObjectStore, 0.1.0"
#:package ApricotFramework.ObjectStore@0.1.0
#addin nuget:?package=ApricotFramework.ObjectStore&version=0.1.0
#tool nuget:?package=ApricotFramework.ObjectStore&version=0.1.0
ApricotFramework.ObjectStore
Object storage from .NET, configured the way a connection string is: named stores in one settings section, each binding one bucket and a key prefix. AWS S3 and any S3-compatible server work today, and a provider is a package, so adding another changes nothing about the stores you already have.
Callers address objects by key alone. The bucket, the endpoint, the prefix and the credentials stay in configuration, so moving a store to another bucket is a settings change.
ApricotFramework.ObjectStore is the zero-dependency core, and nothing here needs ASP.NET Core — the
integration package depends only on Microsoft.Extensions.*, so a worker host can use it too.
Install
dotnet add package ApricotFramework.ObjectStore
dotnet add package ApricotFramework.ObjectStore.S3
dotnet add package ApricotFramework.ObjectStore.DependencyInjection
dotnet add package ApricotFramework.ObjectStore.ErrorDefinitions # optional
Usage
builder.Services.AddObjectStores(builder.Configuration);
builder.Services.AddS3ObjectStoreProvider();
"ObjectStore": {
"DefaultStore": "uploads",
"Stores": {
"uploads": {
"Provider": "s3",
"Settings": { "Bucket": "acme-uploads", "Region": "eu-west-1", "Prefix": "svc-a" }
},
"local": {
"Provider": "s3",
"Settings": { "Bucket": "dev", "ServiceUrl": "http://localhost:9000" }
// Credentials come from the environment, never from this file:
// ObjectStore__Stores__local__Settings__AccessKeyId
// ObjectStore__Stores__local__Settings__SecretAccessKey
}
}
}
Any setting can be overridden from the environment (ObjectStore__Stores__uploads__Settings__Bucket). With
no keys set, a store uses the AWS default credential chain, so a role or workload identity needs no
configuration at all.
// the default store
app.MapPut("/files/{**key}", (IObjectStore store, string key, Stream body, CancellationToken ct) =>
store.PutAsync(key, body, new ObjectPutOptions { ContentType = "text/plain" }, ct));
// a named store
app.MapGet("/avatar", ([FromKeyedServices("avatars")] IObjectStore avatars) => ...);
// or by name at runtime
var store = factory.GetStore("uploads");
A browser or a mobile app can upload and download without credentials or a trip through your service:
var upload = await store.CreateUploadUrlAsync("reports/q3.pdf", new PresignedUploadOptions { ContentType = "application/pdf" });
// hand upload.Url and upload.RequiredHeaders to the client; it sends them exactly as given
var form = await store.CreateUploadFormAsync("avatars/42.png", new PresignedPostOptions { MaximumSize = 1_000_000, ContentType = "image/png" });
// the only presigned upload the store itself holds to a size
Failures are exceptions of this library's own, with the vendor's error kept inside:
try { await store.GetAsync("missing.txt"); }
catch (ObjectNotFoundException) { /* ... */ }
catch (ObjectStoreException e) when (e.IsTransient()) { /* throttled, unreachable or timed out: retry */ }
With ApricotFramework.ErrorDefinitions in the host, services.AddObjectStoreErrorDefinitions() reports
them as RFC 9457 problem+json — a missing object is a 404, a throttled store a 503 — without naming a
bucket, an endpoint or a key.
Full documentation: https://projectapricot.dev/docs/object-store
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
NuGet packages (3)
Showing the top 3 NuGet packages that depend on ApricotFramework.ObjectStore:
| Package | Downloads |
|---|---|
|
ApricotFramework.ObjectStore.S3
AWS S3 and S3-compatible storage (MinIO, Ceph, R2 and others) for ApricotFramework.ObjectStore, built on the AWS SDK: bucket, prefix, endpoint and credentials read from the store's settings, presigned URLs and forms, multipart upload, and SDK errors translated into the library's own exceptions. |
|
|
ApricotFramework.ObjectStore.ErrorDefinitions
Reports ApricotFramework.ObjectStore failures as RFC 9457 problem+json: an exception mapper that turns a missing object, a conflicting write or an unavailable store into a classified error, without leaking buckets, endpoints or keys. |
|
|
ApricotFramework.ObjectStore.DependencyInjection
Dependency-injection integration for ApricotFramework.ObjectStore: stores bound from configuration with environment-variable overrides, startup validation of every store against the registered providers, keyed and default store resolution, and the registration seam for definitions held in a database or a secrets store. Depends only on Microsoft.Extensions.*, so a worker or console host can use it. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 120 | 11/16/2026 |