Cedric
Reviewed against merge-base 2d36b31 using the original checkout's master because no master upstream is configured. dotnet test --verbosity minimal passed all 77 tests, but factor validation, SMTP timeout handling, and outage classification remain defective.
Full review comments:
-
[P1] Bind challenge decisions to the configured push factor — C:/Users/fives/AppData/Local/Temp/council-seat/rc-15fa2897-4e27f97addb742dba25e117027969b75/src/Forge.Approvals.Twilio/TwilioProvider.cs:72-77 When an entity has multiple push factors, or
FactorSidchanges during device rotation, an approved challenge from another factor still passes validation.FactorSidis used for creation but never checked when polling; onlyfactor_typeis checked. Validate the response'sfactor_sidagainst the configured factor before accepting approval, so a different or previously configured device cannot authorize the request. -
[P2] Bound asynchronous SMTP delivery with a timeout — C:/Users/fives/AppData/Local/Temp/council-seat/rc-15fa2897-4e27f97addb742dba25e117027969b75/src/Forge.Approvals.Notify/Notifications.cs:60-60 If the SMTP server accepts a connection but stops responding, this await has no deadline: the CLI supplies no cancellation token, and
SmtpClient.Timeoutdoes not bound asynchronous sends.RequestAsyncawaits notification delivery before the CLI saves the request or prints its JTI, so an informational email can indefinitely block access to an otherwise valid challenge. Apply a bounded linked cancellation token, as the Pavlok notifier already does. -
[P2] Preserve provider-unavailable results during evaluation — C:/Users/fives/AppData/Local/Temp/council-seat/rc-15fa2897-4e27f97addb742dba25e117027969b75/src/Forge.Approvals.Core/ApprovalGate.cs:40-42 On HTTP failures, timeouts, or missing credentials,
TwilioProviderreturnsProviderUnavailablewith an empty hash and no challenge ID. These binding checks therefore convert every such result intoInvalid, misreporting a provider outage as an invalid request. An offline invocation confirmedprovider decision=ProviderUnavailablefollowed bygate decision=Invalid. Handle this non-authorizing result before requiring successful-response bindings, while retaining strict checks for approval.