ValiBlob.OCI
1.0.0
Error en el nombre de paquete.
dotnet add package ValiBlob.OCI --version 1.0.0
NuGet\Install-Package ValiBlob.OCI -Version 1.0.0
<PackageReference Include="ValiBlob.OCI" Version="1.0.0" />
<PackageVersion Include="ValiBlob.OCI" Version="1.0.0" />
<PackageReference Include="ValiBlob.OCI" />
paket add ValiBlob.OCI --version 1.0.0
#r "nuget: ValiBlob.OCI, 1.0.0"
#:package ValiBlob.OCI@1.0.0
#addin nuget:?package=ValiBlob.OCI&version=1.0.0
#tool nuget:?package=ValiBlob.OCI&version=1.0.0
Vali-Blob.OCI
Oracle Cloud Infrastructure (OCI) Object Storage provider for Vali-Blob — the unified cloud storage abstraction library for .NET.
Implements IStorageProvider over OCI Object Storage with Pre-Authenticated Request (PAR) URL generation, resumable multipart uploads, and seamless DI registration.
OCI specifics:
- Presigned URLs use Pre-Authenticated Requests (PARs) — each URL requires an API call to OCI (no local signing like AWS/GCP).
- Metadata can only be set at upload time — in-place metadata updates require re-uploading the object.
Compatibility
| Target Framework | Supported |
|---|---|
netstandard2.0 |
Yes |
netstandard2.1 |
Yes |
net6.0 |
Yes |
net7.0 |
Yes |
net8.0 |
Yes |
net9.0 |
Yes |
Installation
dotnet add package ValiBlob.Core
dotnet add package ValiBlob.OCI
Configuration
{
"ValiBlob": {
"DefaultProvider": "OCI"
},
"ValiBlob:OCI": {
"Namespace": "my-tenancy-namespace",
"Bucket": "my-bucket",
"Region": "us-ashburn-1",
"TenancyId": "ocid1.tenancy.oc1...",
"UserId": "ocid1.user.oc1...",
"Fingerprint": "xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx",
"PrivateKeyPath": "/run/secrets/oci_api_key.pem"
}
}
Alternatively, provide the private key content directly:
{
"ValiBlob:OCI": {
"Namespace": "my-tenancy-namespace",
"Bucket": "my-bucket",
"Region": "us-ashburn-1",
"TenancyId": "ocid1.tenancy.oc1...",
"UserId": "ocid1.user.oc1...",
"Fingerprint": "xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx",
"PrivateKeyContent": "-----BEGIN RSA PRIVATE KEY-----\n..."
}
}
Security: Store
PrivateKeyPathorPrivateKeyContentvia OCI Vault, environment variables, or a secrets manager. Never commit private keys to source control.
Registration
using ValiBlob.Core.DependencyInjection;
using ValiBlob.OCI.Extensions;
builder.Services
.AddValiBlob(opts => opts.DefaultProvider = "OCI")
.UseOCI();
With pipeline
builder.Services
.AddValiBlob(opts => opts.DefaultProvider = "OCI")
.UseOCI()
.WithPipeline(p => p
.UseValidation(v =>
{
v.AllowedExtensions = new[] { ".pdf", ".docx", ".xlsx" };
v.MaxFileSizeBytes = 200 * 1024 * 1024; // 200 MB
})
);
Usage
Upload
public class DocumentService(IStorageProvider storage)
{
public async Task<string> UploadAsync(Stream content, string fileName)
{
var result = await storage.UploadAsync(new UploadRequest
{
Path = StoragePath.From("documents", fileName),
Content = content,
ContentType = "application/pdf",
Metadata = new Dictionary<string, string>
{
["uploaded-by"] = "api-service",
["env"] = "production"
}
});
if (!result.IsSuccess)
throw new Exception(result.ErrorMessage);
return result.Value!.Url;
}
}
Download
var result = await storage.DownloadAsync(new DownloadRequest
{
Path = StoragePath.From("documents", "contract.pdf")
});
if (result.IsSuccess)
await result.Value!.CopyToAsync(outputStream);
Pre-Authenticated Request (PAR) URL
// Download PAR — each call creates a new PAR in OCI
var url = await storage.GetPresignedDownloadUrlAsync(new PresignedUrlRequest
{
Path = StoragePath.From("reports", "q4-2024.pdf"),
ExpiresIn = TimeSpan.FromHours(24)
});
if (url.IsSuccess)
return Ok(new { downloadUrl = url.Value });
Resumable (multipart) upload
var session = await resumable.StartUploadAsync(new ResumableUploadRequest
{
FileName = "large-archive.zip",
ContentType = "application/zip",
TotalSize = totalBytes
});
for (int i = 0; i < chunks.Count; i++)
{
await resumable.UploadChunkAsync(new ResumableChunkRequest
{
SessionId = session.SessionId,
ChunkIndex = i,
Data = chunks[i]
});
}
await resumable.CompleteUploadAsync(session.SessionId);
Features
| Feature | Supported |
|---|---|
| Upload / Download / Delete / List | Yes |
| Exists check | Yes |
| Copy / Move | Yes |
| Metadata (set at upload time) | Yes |
| In-place metadata update | No — re-upload required |
| Presigned URLs (via OCI PARs) | Yes |
| Resumable chunked uploads | Yes |
| BucketOverride per request | Yes |
| Polly retry resilience | Yes |
Options reference
| Property | Default | Description |
|---|---|---|
Namespace |
— | OCI tenancy namespace (required) |
Bucket |
— | Object Storage bucket name (required) |
Region |
— | OCI region identifier (e.g. us-ashburn-1) |
TenancyId |
— | OCID of the tenancy |
UserId |
— | OCID of the API user |
Fingerprint |
— | API key fingerprint |
PrivateKeyPath |
— | Path to the PEM private key file |
PrivateKeyContent |
— | PEM private key as a string |
ParExpiryMinutes |
60 |
Default expiry for generated PARs |
Documentation
- OCI Object Storage provider docs
- Pre-Authenticated Requests (PARs)
- Resumable uploads
- Full documentation
Links
Donations
If Vali-Blob is useful to you, consider supporting its development:
- Latin America — MercadoPago
- International — PayPal
License
Contributions
Issues and pull requests are welcome on GitHub.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. 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 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.0)
- OCI.DotNetSDK.Objectstorage (>= 103.0.0)
- ValiBlob.Core (>= 1.0.0)
-
.NETStandard 2.1
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.0)
- OCI.DotNetSDK.Objectstorage (>= 103.0.0)
- ValiBlob.Core (>= 1.0.0)
-
net6.0
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.0)
- OCI.DotNetSDK.Objectstorage (>= 103.0.0)
- ValiBlob.Core (>= 1.0.0)
-
net7.0
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.0)
- OCI.DotNetSDK.Objectstorage (>= 103.0.0)
- ValiBlob.Core (>= 1.0.0)
-
net8.0
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.0)
- OCI.DotNetSDK.Objectstorage (>= 103.0.0)
- ValiBlob.Core (>= 1.0.0)
-
net9.0
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.0)
- OCI.DotNetSDK.Objectstorage (>= 103.0.0)
- ValiBlob.Core (>= 1.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|
See CHANGELOG.md at https://github.com/UBF21/Vali-Blob/blob/main/CHANGELOG.md