You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Preserve caller cancellation through metadata-based token verification #50
At commit f44587f6317f886a2b7e1cbe081270ed55d6f8d8, caller cancellation during metadata discovery is converted into a token-validation failure.
VerifyAuthTokenWithJwksAsync() and VerifyWithJwksAsync() both pass the caller's cancellation token to metadata.FetchAsync(), then catch every Exception and wrap it in TokenVerificationException. These first and second catches include caller-triggered OperationCanceledException. Cancellation during the subsequent key fetch is outside those blocks, so the exception contract depends on the stage being cancelled.
Expected behavior: when the supplied caller token is cancelled, cancellation propagates consistently through both verification methods and the delivery validator. An application can distinguish an abandoned operation from invalid credentials.
Suggested regression tests: use a valid token fixture and an already-cancelled token, then repeat with an in-process metadata fetch whose wait is cancelled. Check both public verification methods and ValidateAsync(). The shared discovery fetch can retain its own bounded lifetime; preserving caller cancellation does not require cancelling work shared with other callers.
Suggested fix: exclude caller-requested cancellation from the error translation, while preserving the intended classification of actual discovery and verification failures.
Review basis: source inspection against the draft-10 SDK; this is an asynchronous API behavior issue, not a claim that a malformed token is accepted. No local .NET execution was available.
Activity