MaksIT.Vault.Client
1.1.0
See the version list below for details.
dotnet add package MaksIT.Vault.Client --version 1.1.0
NuGet\Install-Package MaksIT.Vault.Client -Version 1.1.0
<PackageReference Include="MaksIT.Vault.Client" Version="1.1.0" />
<PackageVersion Include="MaksIT.Vault.Client" Version="1.1.0" />
<PackageReference Include="MaksIT.Vault.Client" />
paket add MaksIT.Vault.Client --version 1.1.0
#r "nuget: MaksIT.Vault.Client, 1.1.0"
#:package MaksIT.Vault.Client@1.1.0
#addin nuget:?package=MaksIT.Vault.Client&version=1.1.0
#tool nuget:?package=MaksIT.Vault.Client&version=1.1.0
MaksIT.Vault.Client
HTTP client for the MAKS-IT Vault API.
- Vault routes (
api/vault/*): API key viaX-API-KEYheader. - Identity, API key admin, key migration (
api/identity/*,api/apikey/*,api/admin/key-migration/*): JWT Bearer viaAccessToken(set manually or afterLoginAsync/RefreshTokenAsync). - Secret generation (
api/secret/generatesecret): no auth required.
Shared wire types (MaksIT.Vault.Contracts) are bundled in this NuGet package.
Features
IVaultClient/VaultClientfor vault CRUD, identity, API keys, key migration, and secret generation.- DI registration via
AddVaultClient(Microsoft.Extensions.Http). VaultApiExceptionwhen the API returns a non-success status code.
Installation
dotnet add package MaksIT.Vault.Client
Target Framework
.NET 10(net10.0)
Quick Start
Dependency injection (API key)
using MaksIT.Vault.Client;
using MaksIT.Vault.Contracts.Vault.Organization.Search;
builder.Services.AddVaultClient(opts => {
opts.BaseAddress = "https://vault.example.com";
opts.ApiKey = "<api-key>";
});
public sealed class MyService(IVaultClient vault) {
public Task DoWorkAsync(CancellationToken ct) =>
vault.SearchOrganizationsAsync(new SearchOrganizationRequest { PageNumber = 1, PageSize = 20 }, ct);
}
JWT (identity / admin)
var login = await client.LoginAsync(new LoginRequest { Username = "admin", Password = "..." });
// client.AccessToken is set automatically
var users = await client.SearchUsersAsync(new SearchUserRequest { PageNumber = 1, PageSize = 20 });
Or pass AccessToken in VaultClientOptions / Connect-Vault -AccessToken.
Use the reverse-proxy origin when Vault is deployed behind YARP or ingress (e.g. http://localhost:8080), not the internal server port.
Manual construction
var httpClient = new HttpClient();
var client = new VaultClient(httpClient, "https://vault.example.com", "<api-key>", accessToken: null);
Contract namespaces
Types moved from flat MaksIT.Vault.Contracts / MaksIT.Vault.Client.Models to nested folders:
| Area | Namespace example |
|---|---|
| Organizations | MaksIT.Vault.Contracts.Vault.Organization |
| Applications | MaksIT.Vault.Contracts.Vault.Application |
| Secrets | MaksIT.Vault.Contracts.Vault.Secret |
| Users | MaksIT.Vault.Contracts.Identity.User |
| API keys | MaksIT.Vault.Contracts.ApiKeys |
| Key migration | MaksIT.Vault.Contracts.KeyMigration |
| Shared enums | MaksIT.Vault.Contracts.Shared |
| Paging | MaksIT.Core.Webapi.Models.PagedRequest / PagedResponse<T> |
Patch DTOs use PatchRequestModelBase with Operations: Dictionary<string, PatchOperation> from MaksIT.Core.Webapi.Models.
API surface
| Area | Methods |
|---|---|
| Vault — search | SearchOrganizationsAsync, SearchApplicationsAsync, SearchSecretsAsync |
| Vault — read | GetOrganizationAsync, GetApplicationAsync, GetSecretAsync, GetSecretVersionAsync |
| Vault — write | Create*Async, Patch*Async, Delete*Async |
| Secret generation | GenerateSecretAsync |
| Identity | SearchUsersAsync, SearchUserEntityScopesAsync, GetUserAsync, CreateUserAsync, PatchUserAsync, DeleteUserAsync, LoginAsync, RefreshTokenAsync, LogoutAsync |
| API keys | SearchApiKeysAsync, SearchApiKeyEntityScopesAsync, GetApiKeyAsync, CreateApiKeyAsync, PatchApiKeyAsync, DeleteApiKeyAsync |
| Key migration | GetKeyMigrationStatusAsync, StartKeyMigrationAsync, ValidateKeyMigrationAsync, CompleteKeyMigrationAsync |
Secret version label current (case-insensitive) resolves to the lowest vN version that is not expired.
PowerShell
See MaksIT.Vault.Client.PowerShell (Connect-Vault, 38 cmdlets for vault, identity, API keys, and key migration).
Contributing
See CONTRIBUTING.md.
License
See LICENSE.md.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- MaksIT.Core (>= 1.6.7)
- Microsoft.Extensions.Http (>= 10.0.9)
- Microsoft.Extensions.Options (>= 10.0.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.