RatelKey.Burrow.Sdk 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package RatelKey.Burrow.Sdk --version 1.0.0
                    
NuGet\Install-Package RatelKey.Burrow.Sdk -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="RatelKey.Burrow.Sdk" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RatelKey.Burrow.Sdk" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="RatelKey.Burrow.Sdk" />
                    
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 RatelKey.Burrow.Sdk --version 1.0.0
                    
#r "nuget: RatelKey.Burrow.Sdk, 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.
#:package RatelKey.Burrow.Sdk@1.0.0
                    
#: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=RatelKey.Burrow.Sdk&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=RatelKey.Burrow.Sdk&version=1.0.0
                    
Install as a Cake Tool

Burrow SDK for .NET

Read secrets from a self-hosted RatelKey Burrow with a machine identity.

  • Single and structured secrets, and individual fields of a structured secret.
  • The machine's own access map (ListProjectsAsync, ListSecretsAsync).
  • Certificate pinning, or standard CA trust (TlsMode).
  • An OIDC token instead of a key (Burrow.Oidc).
  • Verifying the Burrow's signed webhooks (BurrowWebhooks.Verify).

Requirements

  • .NET 8+.
  • One dependency: BouncyCastle.Cryptography, for Ed25519.

Install

dotnet add package RatelKey.Burrow.Sdk

Bootstrap a machine

From the Burrow dashboard, Machines → Add machine, and run the install it gives you on the target host. The identity lands at ~/.burrow/burrows/<slug>/identity.json.

Quick start

using RatelKey.Burrow;

// The single machine identity on this host (under ~/.burrow, or $BURROW_HOME).
using var burrow = Burrow.Open();

// A single-value secret:
var apiKey = (await burrow.GetSecretAsync("payments/prod/API_KEY")).Value;

// A structured secret, one read, projected locally with no re-fetch:
var db = await burrow.GetSecretAsync("payments/prod/DATABASE");
var all = db.ToDictionary();                            // every field, name to value
var host = db.GetField("host");                         // one field
var fields = db.GetFields("username", "password");      // in the order given

// What this machine can read:
foreach (var p in await burrow.ListProjectsAsync())
    Console.WriteLine($"{p.Project}: {string.Join(", ", p.Categories)}");

Point it at a specific identity by selector or path:

Burrow.Open("burrow-a1b2c3d4e5f60718");                          // slug / name / machine id / URL
Burrow.Open("/home/you/.burrow/burrows/burrow-a1b2c3d4e5f60718"); // path (a burrow dir or identity.json)

Without ~/.burrow

For an app that manages its own key material:

using var burrow = Burrow.Connect(
    burrowUrl: "https://burrow.internal:12010",
    machineId: "...",
    privateKeyPem: Environment.GetEnvironmentVariable("BURROW_MACHINE_KEY")!); // PKCS#8 PEM

OIDC

using var burrow = Burrow.Oidc(
    burrowUrl: "https://burrow.example.com",
    fingerprint: Environment.GetEnvironmentVariable("BURROW_FINGERPRINT")); // omit for a publicly-trusted certificate

var apiKey = (await burrow.GetSecretAsync("payments/prod/API_KEY")).Value;

audience defaults to burrowUrl. GitHub Actions currently requires permissions: id-token: write.

Certificate trust

using var burrow = Burrow.Open(tls: TlsMode.SystemTrust);

Without an explicit tls, the SDK uses the trust chosen when the machine was added: encrypted by default (works everywhere), or verified against the Burrow's own key or a CA if that was selected.

  • TlsMode.Pinned: trust-on-first-use, stored at ~/.burrow/burrows/<slug>/known_cert.
  • TlsMode.PinnedTo("aa:bb:..."): a fixed fingerprint (from the Burrow's network settings).
  • TlsMode.SystemTrust: CA and hostname verification, for a Burrow on a custom domain or Let's Encrypt.
  • TlsMode.Insecure: no verification; accepts any certificate. Opt-in only, for a network you already trust. Shortcut: Burrow.Open().InsecureTls().

Webhooks

Verify a delivery from a Burrow's Signed webhook. Needs only the webhook's signing secret, not a machine identity.

app.MapPost("/hooks/burrow", async (HttpRequest request) =>
{
    using var body = new MemoryStream();
    await request.Body.CopyToAsync(body);
    var e = BurrowWebhooks.Verify(body.ToArray(), request.Headers[BurrowWebhooks.SignatureHeader],
        Environment.GetEnvironmentVariable("BURROW_WEBHOOK_SECRET")!);
    Console.WriteLine($"{e.Event} {e.Data.Summary}");
    return Results.NoContent();
});

Pass the raw body, before JSON parsing. A retry of the same event carries the same e.Id, so keep the ids you've handled to ignore repeats.

Errors

Every failure is a BurrowException: BurrowAuthException (401), BurrowForbiddenException (403, no grant), BurrowNotFoundException (404), BurrowServerException (5xx), BurrowCertificateException (pin mismatch), BurrowTransportException (unreachable or unparsable), BurrowIdentityException (no, ambiguous or invalid identity), plus two projection errors on the result: SecretShapeException (e.g. Value on a structured secret) and FieldNotFoundException. The message carries the Burrow's own reason. BurrowWebhooks.Verify throws BurrowWebhookException for a missing or wrong signature.

Build

dotnet test tests/RatelKey.Burrow.Tests
scripts/build-bundle.sh
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.  net9.0 was computed.  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. 
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.3.1 111 10/24/2026
1.3.0 110 10/19/2026
1.2.0 108 10/15/2026
1.1.1 100 10/10/2026
1.1.0 111 10/2/2026
1.0.1 111 9/27/2026
1.0.0 109 9/27/2026