Skip to main content

Safely pass data to untrusted environments and back.

Project description

… so better sign this

Various helpers to pass data to untrusted environments and to get it back safe and sound. Data is cryptographically signed to ensure that a token has not been tampered with.

It’s possible to customize how data is serialized. Data is compressed as needed. A timestamp can be added and verified automatically while loading a token.

Installing

Install and update using pip:

pip install -U itsdangerous

A Simple Example

Here’s how you could generate a token for transmitting a user’s id and name between web requests.

from itsdangerous import URLSafeSerializer
auth_s = URLSafeSerializer("secret key", "auth")
token = auth_s.dumps({"id": 5, "name": "itsdangerous"})

print(token)
# eyJpZCI6NSwibmFtZSI6Iml0c2Rhbmdlcm91cyJ9.6YP6T0BaO67XP--9UzTrmurXSmg

data = auth_s.loads(token)
print(data["name"])
# itsdangerous

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

itsdangerous-2.1.1.tar.gz (56.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

itsdangerous-2.1.1-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file itsdangerous-2.1.1.tar.gz.

File metadata

  • Download URL: itsdangerous-2.1.1.tar.gz
  • Upload date:
  • Size: 56.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for itsdangerous-2.1.1.tar.gz
Algorithm Hash digest
SHA256 7b7d3023cd35d9cb0c1fd91392f8c95c6fa02c59bf8ad64b8849be3401b95afb
MD5 15e829937c594a5d58974ee2253a7713
BLAKE2b-256 9d8639f81e23f49eaf62d22248d48771dbf3bce7c52dfdf566e3d8d4c0657f15

See more details on using hashes here.

File details

Details for the file itsdangerous-2.1.1-py3-none-any.whl.

File metadata

  • Download URL: itsdangerous-2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for itsdangerous-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 935642cd4b987cdbee7210080004033af76306757ff8b4c0a506a4b6e06f02cf
MD5 0c5cc38a686012ee81d19bce3021cbaf
BLAKE2b-256 769b88ac47681ba6af8ee994c9e83ecdfc0048df59f8f6df5c2f766998fe87e7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page