dotnet-cqrs/Svrnty.Sample
Mathias Beaulieu-Duncan ede9548cba test(altcha): runtime validation of check pipeline in Svrnty.Sample
Adds a [Altcha]-decorated ProtectedActionCommand with IHasAltchaSolution
and a StubAltchaVerifier that treats the literal "valid-solution" as
passing PoW. Exercises both the HTTP MinimalApi and gRPC pipelines
without requiring an external altcha service.

Validated 4 scenarios on each transport (8 total, all pass):

  HTTP /api/command/protectedAction          POST 6001    gRPC :6000
  -------------------------------------------------------------------
  no AltchaSolution                          401          Unauthenticated
  AltchaSolution = "wrong"                   401          Unauthenticated
  AltchaSolution = "valid-solution"          200 result   OK + result
  addUser (no [Altcha])                      200 result   OK + result

The last row confirms backward compatibility: a request type that
isn't decorated with [Altcha] bypasses the check entirely — the
AltchaAuthorizationCheck self-applies and no-ops, and any consumer
that doesn't call AddSvrntyAltcha() sees zero behavior change.

Generated CommandServiceImpl.g.cs verified to include the
ICommandAuthorizationCheck loop after validation, before handler
invocation, with the materialized command instance in ctx.Command.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 16:46:10 -04:00
..
Protos test(altcha): runtime validation of check pipeline in Svrnty.Sample 2026-05-12 16:46:10 -04:00
AddUserCommand.cs yessir 2025-11-03 07:44:17 -05:00
appsettings.Development.json yessir 2025-11-03 07:44:17 -05:00
appsettings.json yessir 2025-11-03 07:44:17 -05:00
FetchUserQuery.cs yessir 2025-11-03 07:44:17 -05:00
InternalCommand.cs yessir 2025-11-03 07:44:17 -05:00
Program.cs test(altcha): runtime validation of check pipeline in Svrnty.Sample 2026-05-12 16:46:10 -04:00
ProtectedActionCommand.cs test(altcha): runtime validation of check pipeline in Svrnty.Sample 2026-05-12 16:46:10 -04:00
RemoveUserCommand.cs yessir 2025-11-03 07:44:17 -05:00
SimpleAsyncQueryableService.cs Apply dotnet format with new editorconfig rules 2026-03-12 03:30:50 -04:00
Svrnty.Sample.csproj test(altcha): runtime validation of check pipeline in Svrnty.Sample 2026-05-12 16:46:10 -04:00
UserQueryableProvider.cs added dynamic queries for minimal api 2025-11-03 09:50:03 -05:00