MaksIT.CR.Client
2.3.3
dotnet add package MaksIT.CR.Client --version 2.3.3
NuGet\Install-Package MaksIT.CR.Client -Version 2.3.3
<PackageReference Include="MaksIT.CR.Client" Version="2.3.3" />
<PackageVersion Include="MaksIT.CR.Client" Version="2.3.3" />
<PackageReference Include="MaksIT.CR.Client" />
paket add MaksIT.CR.Client --version 2.3.3
#r "nuget: MaksIT.CR.Client, 2.3.3"
#:package MaksIT.CR.Client@2.3.3
#addin nuget:?package=MaksIT.CR.Client&version=2.3.3
#tool nuget:?package=MaksIT.CR.Client&version=2.3.3
MaksIT.CR.Client
HTTP client for the MAKS-IT CR API.
- CR routes (
api/cr/*, registry): JWT Bearer viaAccessToken, or HTTP Basic (Username/Password) for service users. - Identity (
api/identity/*): JWT Bearer viaAccessToken(set manually or afterLoginAsync/RefreshTokenAsync).
Shared wire types (MaksIT.CR.Contracts) are bundled in this NuGet package.
Features
ICRClient/CRClientfor organizations, applications, catalog images/charts, registry, and identity.- DI registration via
AddCRClient(Microsoft.Extensions.Http). CRApiExceptionwhen the API returns a non-success status code.
Installation
dotnet add package MaksIT.CR.Client
Target Framework
.NET 10(net10.0)
Quick Start
Dependency injection (JWT or Basic)
using MaksIT.CR.Client;
using MaksIT.CR.Contracts.CR.Organization.Search;
builder.Services.AddCRClient(opts => {
opts.BaseAddress = "https://cr.example.com";
opts.Username = "admin";
opts.Password = "...";
// or: opts.AccessToken = "<jwt>";
});
public sealed class MyService(ICRClient client) {
public Task DoWorkAsync(CancellationToken ct) =>
client.SearchOrganizationsAsync(new SearchOrganizationRequest { PageNumber = 1, PageSize = 20 }, ct);
}
JWT (identity)
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 CRClientOptions / Connect-CR -AccessToken.
Use the reverse-proxy origin when CR 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 CRClient(httpClient, "https://cr.example.com", username: "admin", password: "...", accessToken: null);
Contract namespaces
| Area | Namespace example |
|---|---|
| Organizations | MaksIT.CR.Contracts.CR.Organization |
| Applications | MaksIT.CR.Contracts.CR.Application |
| Images (catalog) | MaksIT.CR.Contracts.CR.Image |
| Charts (catalog) | MaksIT.CR.Contracts.CR.Chart |
| Users | MaksIT.CR.Contracts.Identity.User |
| Shared enums | MaksIT.CR.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 |
|---|---|
| Organizations | SearchOrganizationsAsync, GetOrganizationAsync, CreateOrganizationAsync, PatchOrganizationAsync, DeleteOrganizationAsync |
| Applications | SearchApplicationsAsync, GetApplicationAsync, CreateApplicationAsync, PatchApplicationAsync, DeleteApplicationAsync |
| Images (catalog) | SearchImagesAsync, GetImageAsync, CreateImageAsync, PatchImageAsync, DeleteImageAsync |
| Charts (catalog) | SearchChartsAsync, GetChartAsync, CreateChartAsync, PatchChartAsync, DeleteChartAsync |
| Registry | GlobalSearchAsync, BrowseChartsAsync, ListTagsAsync, ListChartVersionsAsync, GetImageAsync, ListCvesAsync, DeleteManifestAsync, … |
| Identity | SearchUsersAsync, SearchUserEntityScopesAsync, GetUserAsync, CreateUserAsync, PatchUserAsync, DeleteUserAsync, LoginAsync, RefreshTokenAsync, LogoutAsync |
Catalog chart names are short (demo-app). Helm OCI URLs use the fixed prefix: helm push … oci://host/charts → oci://host/charts/demo-app. Images stay flat (docker push host/api). The same short name may be used for an Image and a Chart; charts is reserved.
PowerShell
See MaksIT.CR.Client.PowerShell (Connect-CR and cmdlets for CR and identity).
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.