Skip to content

docs: key rotation and algorithm migration guide - #2

Open
GazingInSpring wants to merge 2 commits into
mainfrom
docs/key-rotation-and-algorithm-migration-guide
Open

docs: key rotation and algorithm migration guide#2
GazingInSpring wants to merge 2 commits into
mainfrom
docs/key-rotation-and-algorithm-migration-guide

Conversation

@GazingInSpring

Copy link
Copy Markdown
Owner

Adds a new docs/key-rotation.rst page covering key rotation and
algorithm migration, and a test that was missing for the
SignatureExpired short-circuit in TimedSerializer.loads.

Changes

docs/key-rotation.rst (new, 266 lines)

  • Key rotation via secret_key list: signing always uses secret_keys[-1],
    verification iterates newest→oldest
  • Algorithm migration via fallback_signers: all three entry formats,
    SHA-1→SHA-512 two-phase recipe
  • Combining both: explicit list of all accepted combinations, warning on
    signer-instance count (1 + N×M)
  • Internal mechanics of iter_unsigners and the loads loop
  • TimedSerializer expiry behaviour: SignatureExpired hard-stops the
    fallback loop; BadPayload also hard-stops
  • Version history table: SHA-1 default → yanked 1.0.0 → 1.1.0 revert →
    2.0.0 empty default_fallback_signers

docs/index.rst

  • Added key-rotation to toctree

tests/test_itsdangerous/test_timed.py

  • test_fallback_signers_not_expired: fallback path works with max_age set
  • test_fallback_signers_expired: SignatureExpired is re-raised immediately
    inside the fallback loop rather than falling through to the next signer

Verification

  • Sphinx build: 0 warnings, 0 errors (-W strict mode)
  • Full test suite: 305/305 passed

npip99 added 2 commits May 27, 2026 21:10
Adds docs/key-rotation.rst covering:
- secret_key list mechanism and three-step rotation procedure
- fallback_signers formats and SHA-1→SHA-512 migration recipe
- Combined key rotation + algorithm migration with complexity warning
- Internal iter_unsigners mechanics (primary vs fallback, BadPayload behaviour)
- TimedSerializer / SignatureExpired interaction with fallback loop
- Version history table for the SHA-512 default change (1.0.0 yanked,
  1.1.0 fallback added, 2.0.0 fallback removed)

Also adds the new page to the toctree in docs/index.rst between
encoding and license.
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