Raileasy.DataProtection.Gcs 1.0.0

Prefix Reserved
dotnet add package Raileasy.DataProtection.Gcs --version 1.0.0                
NuGet\Install-Package Raileasy.DataProtection.Gcs -Version 1.0.0                
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="Raileasy.DataProtection.Gcs" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Raileasy.DataProtection.Gcs --version 1.0.0                
#r "nuget: Raileasy.DataProtection.Gcs, 1.0.0"                
#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.
// Install Raileasy.DataProtection.Gcs as a Cake Addin
#addin nuget:?package=Raileasy.DataProtection.Gcs&version=1.0.0

// Install Raileasy.DataProtection.Gcs as a Cake Tool
#tool nuget:?package=Raileasy.DataProtection.Gcs&version=1.0.0                

Raileasy.DataProtection.Gcs

NuGet Version

This library provides a way to store and retrieve ASP.NET data protection keys in an Google Cloud Storage bucket. The keys can either be stored in the root of the bucket, or the objects can use a configurable prefix.

All GCS operations are attempted 5 times with exponential backup. If all 5 attempts fail the final exception is thrown.

Installation

A net8.0 Nuget package is available here.

Or you can install with the dotnet cli:

dotnet add package Raileasy.DataProtection.Gcs

Sample Code

Setting the persistence provider

The PersistKeysToGcs method can be used to set the storage up easily.

using Raileasy.DataProtection.Gcs;

var gcsDataProtectionConfiguration = builder.Configuration
    .GetSection("GcsDataProtection")
    .Get<GcsDataProtectionConfiguration>();
builder.Services.AddDataProtection().PersistKeysToGcs(gcsDataProtectionConfiguration);

Configuration options

GcsDataProtectionConfiguration has two properties:

  • StorageBucket: Required - the name of the GCS bucket to store the keys in
  • ObjectPrefix: Optional - the prefix to use for the key objects (for example, staging/). If this is not provided then the keys are stored in the root of the bucket.
Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.0.0 5,529 3/28/2024