test badNonce retry exhaustion and RFC 8555 violation paths - #85
Draft
toddr-bot wants to merge 1 commit into
Draft
test badNonce retry exhaustion and RFC 8555 violation paths#85toddr-bot wants to merge 1 commit into
toddr-bot wants to merge 1 commit into
Conversation
Two untested edge cases in HTTP.pm's badNonce handling: - retry exhaustion: when all retries are consumed, the error must be re-thrown with a warning, not loop or silently fail - missing Replay-Nonce: when the server omits the nonce header from a badNonce error response (violating RFC 8555/6.5), the client must warn and give up, not retry without a nonce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add tests for two untested edge cases in HTTP.pm's badNonce retry logic.
Why
The retry mechanism had two unexercised branches — retry exhaustion and
RFC 8555/6.5 violation (missing Replay-Nonce on error response). Both are
production failure modes: a misbehaving ACME server could trigger either
path, and bugs here would be invisible until that happened.
How
_retries_leftto 0, send a badNonce error,verify the warning fires and the error is re-thrown (not looped or swallowed).
Replay-Nonceheader, verify the RFC 8555/6.5 warning fires, no retry is attempted, and
the error is re-thrown.
Both tests capture warnings via
$SIG{__WARN__}(same pattern as theexisting badNonce retry test).
Testing
Full suite: 382 tests pass. HTTP test file: 60 assertions (was 50), 10 new.
Quality Report
Changes: 1 file changed, 167 insertions(+)
Code scan: clean
Tests: passed (OK)
Branch hygiene: clean
Generated by Kōan