Rkd.Scalar.Abstractions
2.12.0
See the version list below for details.
dotnet add package Rkd.Scalar.Abstractions --version 2.12.0
NuGet\Install-Package Rkd.Scalar.Abstractions -Version 2.12.0
<PackageReference Include="Rkd.Scalar.Abstractions" Version="2.12.0" />
<PackageVersion Include="Rkd.Scalar.Abstractions" Version="2.12.0" />
<PackageReference Include="Rkd.Scalar.Abstractions" />
paket add Rkd.Scalar.Abstractions --version 2.12.0
#r "nuget: Rkd.Scalar.Abstractions, 2.12.0"
#:package Rkd.Scalar.Abstractions@2.12.0
#addin nuget:?package=Rkd.Scalar.Abstractions&version=2.12.0
#tool nuget:?package=Rkd.Scalar.Abstractions&version=2.12.0
Rkd.Scalar.Abstractions
The contracts of Rkd.Scalar for the layers that implement them — Infrastructure, Application — without ASP.NET Core, Scalar, OpenAPI or API versioning. Install the whole Rkd.Scalar only in the API project, which registers what the other layers implement.
dotnet add src/MyApp.Infrastructure package Rkd.Scalar.Abstractions
dotnet add src/MyApp.Api package Rkd.Scalar
// MyApp.Infrastructure — references Rkd.Scalar.Abstractions only
public sealed class LoginValidator(AppDbContext db, IPasswordHasher hasher) : ICredentialValidator<LoginRequest>
{
public async Task<CredentialValidationResult> ValidateAsync(LoginRequest request, CancellationToken cancellationToken = default)
{
var user = await db.Users.SingleOrDefaultAsync(u => u.Username == request.Username, cancellationToken);
if (user is null || !hasher.Verify(request.Password, user.PasswordHash))
return CredentialValidationResult.Failure("Invalid username or password.");
return CredentialValidationResult.Success(
new Claim(ClaimTypes.NameIdentifier, user.Id.ToString()),
new Claim(ClaimTypes.Name, user.Username));
}
}
// MyApp.Api — references Rkd.Scalar
builder.AddRkdScalar()
.WithBearerAuth<LoginRequest, LoginValidator>();
| Area | Types |
|---|---|
| Credentials | ICredentialValidator<TCredentials>, CredentialValidationResult, BasicAuthCredentials, ApiKeyCredentials, RkdScalarAuthenticationSchemes |
| JWT | IJwtTokenService, JwtToken, JwtLoginResponse, IJwtSigner (KMS, Key Vault, HSM), IJwtSigningKeyResolver, JwtSigningKey, JwtSigningKeyContext, RkdPem |
| HTTP logging | IHttpLogSink, HttpLogEntry |
- Same types and namespace (
Rkd.Scalar) used by Rkd.Scalar: nothing to map between layers. Rkd.Scalar depends on this package, so the API project gets it automatically. - Only dependency:
Microsoft.IdentityModel.Tokens(theSecurityKeyofJwtSigningKey). - Errors thrown from any layer (
RkdError,ProblemException) are in Rkd.Scalar.Errors.
See the Rkd.Scalar documentation.
| 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
- Microsoft.IdentityModel.Tokens (>= 8.19.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Rkd.Scalar.Abstractions:
| Package | Downloads |
|---|---|
|
Rkd.Scalar
Zero-boilerplate Scalar wrapper for ASP.NET Core. Configures OpenAPI, API Versioning and Authentication (JWT with HMAC, RSA, ECDSA, OIDC/JWKS or async/KMS signing, Basic, API Key) in a few fluent lines, applies XML documentation comments automatically, standardizes errors as RFC 9457 problem details, with built-in documentation UI protection, a development login endpoint and configuration-based validators. |
GitHub repositories
This package is not used by any popular GitHub repositories.