Skip to content

r202639: typed rate-limit error on registration - #208

Merged
cayossarian merged 4 commits into
prerelease/3.8from
feat/register-rate-limit
Oct 9, 2026
Merged

cayossarian merged 4 commits into
prerelease/3.8from
feat/register-rate-limit

Conversation

@cayossarian

Copy link
Copy Markdown
Member

r202639: a typed error for rate-limited registration. Ports Don's (@dcj) acceptance tests for registration rate limits onto this line unchanged: tests/test_register_rate_limit.py. Thanks, Don.

  • register_v2 raises the new SpanPanelRateLimitError (a SpanPanelAPIError, not an auth error) on HTTP 429 and does not retry. retry_after_s is the wait the panel asked for, in seconds: Retry-After delta-seconds as given, an HTTP-date as the seconds until then; None when absent, negative, infinite or neither form. The body and the passphrase stay out of the message.
  • The CA download's 429 backoff reads Retry-After through the same parser, so it now takes an HTTP-date and no longer waits on an infinite value.
  • The passphrase rotation docstring names a 504, beside a 500, as an unknown outcome.
  • tests/expected_failures.py lists two of Don's tests as divergent: they read the delay as retry_after and expect None for an HTTP-date. A strict xfail stops at its first failing line, so tests/test_register_rate_limit_companions.py pins the delay in seconds and the statuses around 429. Don's file is never edited. The registry now also finds methods of test classes.

Registry rows

Test Kind Flips when
test_raises_the_rate_limit_class_with_its_status divergent stays: the delay is retry_after_s, in seconds
test_retry_after_is_none_without_a_usable_header (all cases) divergent stays: an HTTP-date Retry-After reads as the seconds until then

Checks

  • pytest tests -q: 1520 passed, 7 skipped, 27 xfailed (before: 1504 passed, 7 skipped, 21 xfailed); each commit passes on its own
  • pre-commit run --all-files: all hooks pass, mypy included
  • Merged with the current prerelease/3.8 locally (no conflicts, not committed): 1639 passed, 7 skipped, 20 xfailed

cayossarian and others added 4 commits October 9, 2026 00:24
register_v2 raises SpanPanelRateLimitError, a SpanPanelAPIError, when the
panel answers HTTP 429, and does not retry. retry_after_s carries the
wait the panel asked for in seconds, from Retry-After: delta-seconds as
given, an HTTP-date as the seconds until that time, and None when the
header is absent, negative, infinite or neither form. The body and the
passphrase stay out of the message, as for every other refusal.

The CA download's 429 retry reads Retry-After through the same parser,
so it now honours an HTTP-date and no longer waits on an infinite value.
The passphrase rotation docstring names 504 beside 500 as an unknown
outcome. SpanPanelRateLimitError is exported.

Part of the spanos3/r202639/03 batch 2 work.
Two acceptance tests read the delay as retry_after and expect None for an
HTTP-date Retry-After. This library names it retry_after_s, in seconds,
and reads an HTTP-date as the seconds until that time, so both are known
divergences. The rows are inert until the tests land. A row may now name
a method of a Test class.

Part of the spanos3/r202639/03 batch 2 work.
Don's acceptance tests, ported unchanged from his work: test_register_rate_limit.py. Tests this line does not pass yet are listed in tests/expected_failures.py.

Part of the spanos3/r202639/03 batch 2 work.
Companions to the registration acceptance tests, in their own file so
those stay unchanged: Retry-After as delta-seconds and as an HTTP-date,
future or passed, read as seconds; negative, infinite, NaN and
unparseable values read as None; a rejected credential is still an auth
error and another 4xx is not a rate limit; and the CA download backoff
takes an HTTP-date and never waits forever. They pin what the two
divergent acceptance tests check after their divergent line.

Part of the spanos3/r202639/03 batch 2 work.
@cayossarian
cayossarian merged commit 8d24a15 into prerelease/3.8 Oct 9, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants