The default transport for IAltchaVerifier / IAltchaChallengeProvider —
calls a self-hosted altcha service over gRPC.
Wire contract
- Protos/altcha.proto defines svrnty.cqrs.altcha.v1.AltchaService with
CreateChallenge + VerifyChallenge RPCs. Shipped in this package as
source-of-truth; Go (and other) implementations vendor a copy.
- Challenge.challenge_hash is named (not "challenge") to avoid a C#
property/class name collision; the MinimalApi widget JSON remaps.
Runtime
- AltchaGrpcVerifier maps RpcException → AltchaVerifyResult.Fail with
a diagnostic reason ("verify-timeout", "service-unavailable", etc.)
so the auth check surfaces a clean Unauthorized without leaking
transport detail.
- AltchaGrpcChallengeProvider lets create-challenge failures bubble
(challenge endpoint should 5xx if altcha is down — clients retry).
- AltchaGrpcOptions.TokenProvider hook for consumer-supplied HMAC
service-token minting (plan-b will plug in ServiceTokenIssuer).
- AddGrpcClient<AltchaServiceClient> registered with HttpClientFactory.
AddSvrntyAltchaGrpcVerifier(Action<...>) and overload binding from
IConfiguration cover both wiring styles.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
48 lines
1.8 KiB
XML
48 lines
1.8 KiB
XML
<Project Sdk="Microsoft.NET.Sdk">
|
|
<PropertyGroup>
|
|
<TargetFramework>net10.0</TargetFramework>
|
|
<IsAotCompatible>false</IsAotCompatible>
|
|
<LangVersion>14</LangVersion>
|
|
<Nullable>enable</Nullable>
|
|
<ImplicitUsings>enable</ImplicitUsings>
|
|
|
|
<Company>Svrnty</Company>
|
|
<Authors>David Lebee, Mathias Beaulieu-Duncan</Authors>
|
|
<PackageIcon>icon.png</PackageIcon>
|
|
<PackageReadmeFile>README.md</PackageReadmeFile>
|
|
<RepositoryUrl>https://git.openharbor.io/svrnty/dotnet-cqrs</RepositoryUrl>
|
|
<RepositoryType>git</RepositoryType>
|
|
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
|
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
|
|
|
<DebugType>portable</DebugType>
|
|
<DebugSymbols>true</DebugSymbols>
|
|
<IncludeSymbols>true</IncludeSymbols>
|
|
<IncludeSource>true</IncludeSource>
|
|
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<None Include="..\icon.png" Pack="true" PackagePath="" CopyToOutputDirectory="Always" />
|
|
<None Include="..\README.md" Pack="true" PackagePath="" CopyToOutputDirectory="Always" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<PackageReference Include="Google.Protobuf" Version="3.30.2" />
|
|
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.71.0" />
|
|
<PackageReference Include="Grpc.Tools" Version="2.71.0">
|
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
|
<PrivateAssets>all</PrivateAssets>
|
|
</PackageReference>
|
|
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="10.0.0" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<ProjectReference Include="..\Svrnty.CQRS.Altcha.Abstractions\Svrnty.CQRS.Altcha.Abstractions.csproj" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<Protobuf Include="Protos\altcha.proto" GrpcServices="Client" />
|
|
</ItemGroup>
|
|
</Project>
|