How pallets/itsdangerous works
ItsDangerous is a Python library for safely passing data through untrusted environments: it serializes values into tokens, signs them, and verifies and loads them later. Users can choose ordinary signing, timestamp-based expiration, or URL-safe serialization with optional compression. The sampled sources show the main implementation layers and their dependencies; the README documents the user workflow. The graph omits uncertain internal calls where the excerpts do not show them.
Main entry points: serializer.py Serializer · url_safe.py URL-Safe Serializer · encoding.py Encoding · timed.py Timestamp Signer
Components 9
Token Formats
- URL-Safe Serializer
src/itsdangerous/url_safe.py - Timed Serializer
src/itsdangerous/timed.py - Serializer
src/itsdangerous/serializer.py
Signing
- Timestamp Signer
src/itsdangerous/timed.py - Signer
src/itsdangerous/signer.py
Shared Support
- Encoding
src/itsdangerous/encoding.py - Compact JSON
src/itsdangerous/_json.py - Data Exceptions
src/itsdangerous/exc.py
Other components
- Library User
Connections 16
- Library User → URL-Safe Serializer: creates and loads tokens
README.md - URL-Safe Serializer → Serializer: extends serialization
src/itsdangerous/url_safe.py - URL-Safe Serializer → Timed Serializer: extends timed serialization
src/itsdangerous/url_safe.py - URL-Safe Serializer → Compact JSON: uses default JSON
src/itsdangerous/url_safe.py - URL-Safe Serializer → Encoding: encodes payloads
src/itsdangerous/url_safe.py - Timed Serializer → Serializer: extends serialization
src/itsdangerous/timed.py - Timed Serializer → Timestamp Signer: selects default signer
src/itsdangerous/timed.py - Timestamp Signer → Signer: extends signing
src/itsdangerous/timed.py - Timestamp Signer → Serializer: loads payloads
src/itsdangerous/timed.py - Timestamp Signer → Encoding: encodes timestamps
src/itsdangerous/timed.py - Serializer → Signer: creates signers
src/itsdangerous/serializer.py - Serializer → Encoding: normalizes bytes
src/itsdangerous/serializer.py - Signer → Encoding: encodes signatures
src/itsdangerous/signer.py - Serializer → Data Exceptions: raises data errors
src/itsdangerous/serializer.py - Signer → Data Exceptions: raises signature errors
src/itsdangerous/signer.py - Encoding → Data Exceptions: raises decode errors
src/itsdangerous/encoding.py