Skip to content

aaroncroberts/gokstad

CI License: MIT .NET

Gokstad

        |
    <___|___>
     GOKSTAD

A modular .NET 8 library providing consistent, reusable patterns for common enterprise integration problems. Each module ships as an independent NuGet package — take only what you need.

Modules

Module Package Description
Configuration Gokstad.Configuration Feature flag client and encrypted credential storage
Data Gokstad.Data Database access for SQL Server, MySQL, PostgreSQL, and Oracle
DirectoryServices Gokstad.DirectoryServices LDAP client for Active Directory and OpenLDAP (users, groups, OUs)
Security Gokstad.Security AES/RSA encryption and cryptographically strong password generation
Tracing Gokstad.Tracing Structured operation tracing built on Serilog
Web Gokstad.Web HTTP, FTP, and SFTP client abstractions

Requirements

Installation

Add the GitHub Packages NuGet source once:

dotnet nuget add source "https://nuget.pkg.github.com/aaroncorberts/index.json" \
  --name github \
  --username YOUR_GITHUB_USERNAME \
  --password YOUR_GITHUB_TOKEN \
  --store-password-in-clear-text

Install individual packages:

dotnet add package Gokstad.Data
dotnet add package Gokstad.DirectoryServices
dotnet add package Gokstad.Security
dotnet add package Gokstad.Tracing
dotnet add package Gokstad.Web
dotnet add package Gokstad.Configuration

Quick Start

Data — query a database

var config = new DbConfiguration
{
    Server = "localhost", Port = 3306,
    Database = "mydb", User = "app", Password = "secret"
};

var db = serviceProvider.GetRequiredService<DbStore<MySqlDbServiceProvider>>();

var results = await db.QueryAsync<MyRecord>(
    "SELECT * FROM records WHERE active = @active",
    new DbParameter("active", true));

DirectoryServices — look up an LDAP user

var config = new LdapConfiguration
{
    Host = "ldap.corp.example.com", Port = 636, Ssl = true,
    BaseDN = "DC=corp,DC=example,DC=com",
    Username = "cn=svc-ldap,DC=corp,DC=example,DC=com",
    Password = "service-account-password"
};

var ldap = serviceProvider.GetRequiredService<LdapService>();
var user = ldap.Users.Find(new User("jsmith"));
Console.WriteLine(user?.DisplayName);

Security — encrypt a value

var provider = serviceProvider.GetRequiredService<IEncryptionProvider>();
var ciphertext = provider.Encrypt("sensitive-value");
var plaintext  = provider.Decrypt(ciphertext);

Tracing — record an operation

var trace = serviceProvider.GetRequiredService<ITrace>();
using var op = trace.Begin("ProcessInvoice");
// ... do work ...
op.Complete();

Building from Source

git clone https://github.com/aaroncorberts/gokstad.git
cd gokstad
dotnet build gokstad.sln

Testing

Unit tests (no external dependencies):

dotnet test gokstad.tests.sln

Integration tests (requires running containers):

podman-compose -f test/docker-compose.yml up -d
dotnet test gokstad.tests.sln
podman-compose -f test/docker-compose.yml down

Coverage report:

dotnet tool install -g dotnet-reportgenerator-globaltool
dotnet test gokstad.tests.sln --collect:"XPlat Code Coverage"
reportgenerator -reports:./**/TestResults/**/coverage.cobertura.xml \
  -targetdir:coverage-reports -reporttypes:Html

Contributing

See CONTRIBUTING.md.

License

MIT — see LICENSE. Copyright © 2026 Aaron C. Roberts.

About

A modular .NET 8 utility library — SFTP/FTP/HTTP clients, LDAP, database providers, cryptography, tracing, and configuration — built for enterprise integration workflows.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages