Compendium.Abstractions.Storage 1.1.0-preview.4

This is a prerelease version of Compendium.Abstractions.Storage.
dotnet add package Compendium.Abstractions.Storage --version 1.1.0-preview.4
                    
NuGet\Install-Package Compendium.Abstractions.Storage -Version 1.1.0-preview.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Compendium.Abstractions.Storage" Version="1.1.0-preview.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Compendium.Abstractions.Storage" Version="1.1.0-preview.4" />
                    
Directory.Packages.props
<PackageReference Include="Compendium.Abstractions.Storage" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Compendium.Abstractions.Storage --version 1.1.0-preview.4
                    
#r "nuget: Compendium.Abstractions.Storage, 1.1.0-preview.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Compendium.Abstractions.Storage@1.1.0-preview.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Compendium.Abstractions.Storage&version=1.1.0-preview.4&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Compendium.Abstractions.Storage&version=1.1.0-preview.4&prerelease
                    
Install as a Cake Tool

Compendium — Storage Domain

Object-storage domain repo for the Compendium event-sourcing framework, assembled per ADR-0007 (repo-per-domain topology). It hosts the storage abstraction and every storage adapter in a single repository, so a change to the IObjectStore port and its adapters ships as one atomic PR and one version train.

Packages

Package Description
Compendium.Abstractions.Storage The IObjectStore port and its models: provider-agnostic object/blob storage (Put / Get / Delete / Exists / List / Presign).
Compendium.Adapters.S3 Adapter for S3-compatible object storage (AWS S3, Cloudflare R2, MinIO, Backblaze B2, Wasabi). Tenant-scoped keys, streaming uploads, multipart, SSE-S3/KMS, presigned URLs.
Compendium.Adapters.Supabase Runtime adapter for Supabase Storage (cloud and self-hosted) over the native Storage REST API. Tenant-scoped keys, streaming uploads, presigned download URLs, signed upload URLs, public URLs, image transforms, per-connection storage factory.
Compendium.Adapters.Supabase.Management Control-plane companion: stateless ISupabaseAdmin facade over the Supabase Cloud Management API (project CRUD, API keys) and the Storage admin API (buckets), plus a BYO / self-hosted attach probe.
Compendium.Storage.Encryption Envelope encryption over any IObjectStore: EncryptingObjectStore, per-object AES-256-GCM data keys wrapped by a per-tenant key-encryption key (IKeyEncryptionKeyProvider), streamed in 64 KiB blocks with constant memory.

All packages version together from git tags (MinVer, tag prefix v). The primary feed is GitHub Packages (https://nuget.pkg.github.com/SCOJH/index.json); releases are mirrored to nuget.org when a publish key is configured.

Layout

src/
  Compendium.Abstractions.Storage/          # the port — adapters reference it via ProjectReference
  Compendium.Adapters.S3/
  Compendium.Adapters.Supabase/
  Compendium.Adapters.Supabase.Management/
  Compendium.Storage.Encryption/            # envelope-encryption decorator over IObjectStore
tests/
  Unit/                                     # one test project per source project, no I/O
  Integration/                              # Testcontainers-based, [RequiresDocker]-gated

The abstraction is consumed in-repo via ProjectReference — the atomic-PR benefit of the domain repo. Consumers outside this repo keep referencing the published Compendium.Abstractions.Storage package. Compendium base packages (Compendium.Abstractions, Compendium.Core, Compendium.Multitenancy) remain nuget.org PackageReference pins, managed centrally in Directory.Packages.props.

Envelope encryption

Compendium.Storage.Encryption encrypts objects before they reach the underlying store. Each object gets a fresh random AES-256 data key (DEK); the DEK is wrapped by the current tenant's key-encryption key (KEK) through the IKeyEncryptionKeyProvider port, which the application implements (KMS, keys table wrapped by a master key, ...). The ports (IKeyEncryptionKeyProvider, IEncryptedObjectStore) live in Compendium.Abstractions.Storage.Encryption.

services.AddCompendiumS3(configuration);                       // the IObjectStore holding ciphertext
services.AddSingleton<IKeyEncryptionKeyProvider, MyKeyProvider>();
services.AddCompendiumStorageEncryption();                     // IEncryptedObjectStore

var put = await encrypted.PutAsync("files/f_123", upload);     // Result<EncryptedObject>
// Persist put.Value.StorageKey, put.Value.WrappedDek and put.Value.KekId with your own record.
var open = await encrypted.OpenReadAsync(storageKey, wrappedDek, kekId);
await using var file = open.Value;                             // plaintext stream, verified block by block

The wrapped DEK is returned to the caller and never stored in the object, so rotating a KEK re-wraps DEKs without rewriting objects. The object is bound to its tenant but not to its storage key: the caller's record (storage key, wrapped DEK, KEK identifier) is what ties an object to its key. Metadata passed to PutAsync is stored in clear by the underlying store. IKeyEncryptionKeyProvider implementations must bind the tenant and KEK identifier to the wrapped DEK (AES-GCM associated data, KMS encryption context).

Format, version 1:

  • Header: "CPSE", version byte 0x01, KEK-identifier length (1 byte, 1 to 255), KEK identifier (UTF-8), 7-byte random nonce prefix. No key material.
  • Blocks: 64 KiB of plaintext each (the last one 0 to 64 KiB, always present), AES-256-GCM, each followed by its 16-byte tag. Nonce = prefix (7 bytes) + block index (4 bytes, big endian) + last-block flag (1 byte); every block authenticates, as associated data, the whole header followed by the tenant identifier (4-byte big-endian length, then UTF-8), so an object and its DEK replayed under another tenant fail verification.

Reads verify each block before returning any of its bytes. A wrong key, a foreign object or an altered header fail OpenReadAsync; a modified, removed, reordered, duplicated or truncated later block, or appended data, makes the read throw CryptographicException (and every later read too), which a consumer must treat as the whole object being invalid. Only the BCL AesGcm is used; key buffers are wiped after use and nothing key-related is logged.

Building

Every package targets net9.0 and net10.0 (both until .NET 9 leaves support on 2026-11-10). global.json asks for the .NET 10 SDK, which builds both targets; to run the net9.0 half of the tests you also need the .NET 9 runtime, which the .NET 9 SDK brings. Consuming the packages from a net9.0 project needs only the .NET 9 SDK.

dotnet build -c Release
dotnet test -c Release --filter "FullyQualifiedName!~IntegrationTests"   # unit tests, once per target
dotnet test -c Release                                                    # + integration (requires Docker)

CI enforces a 90% line-coverage gate on the unit-testable surface (currently ~96%).

Releasing

Push a tag v* (e.g. v1.1.0-preview.2). The Release workflow builds, runs unit tests, packs all five packages, publishes to GitHub Packages, then to nuget.org (through Trusted Publishing, or NUGET_API_KEY as a fallback; the release fails otherwise), and creates a GitHub Release.

Provenance

Assembled from three source repositories — see MIGRATION.md for the component → source-repo → SHA map.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Compendium.Abstractions.Storage:

Package Downloads
Compendium.Adapters.S3

Compendium adapter for S3-compatible object storage (AWS S3, Cloudflare R2, MinIO, Backblaze B2, Wasabi). Implements the IObjectStore port with tenant-scoped keys, streaming uploads, multipart, SSE-S3/KMS, and presigned URLs.

Compendium.Storage.Encryption

Envelope encryption for Compendium object storage: an EncryptingObjectStore decorator over any IObjectStore. Per-object data keys wrapped by a per-tenant key-encryption key (IKeyEncryptionKeyProvider), streamed AES-256-GCM in 64 KiB blocks, constant-memory verified reads, truncation and reordering detected.

Compendium.Adapters.Supabase

Compendium adapter for Supabase Storage (cloud and self-hosted). Implements the IObjectStore port over the native Supabase Storage REST API with tenant-scoped keys, streaming uploads, presigned download URLs, signed upload URLs, public URLs, and image transforms. Ships a per-connection storage factory and a redacting credential model for multi-project platforms.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0-preview.4 7,122 10/31/2026
1.0.5-preview.4 103 7/24/2026
1.0.5-preview.3 77 7/24/2026
1.0.5-preview.2 88 7/24/2026
1.0.5-preview.1 91 7/20/2026
1.0.4 181 6/11/2026
1.0.3 216 5/21/2026
1.0.2 133 5/18/2026