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.0.0rc1.tar.gz (58.9 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.0.0rc1-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

Details for the file itsdangerous-2.0.0rc1.tar.gz.

File metadata

  • Download URL: itsdangerous-2.0.0rc1.tar.gz
  • Upload date:
  • Size: 58.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

File hashes

Hashes for itsdangerous-2.0.0rc1.tar.gz
Algorithm Hash digest
SHA256 743456d13b108af70259b3867e14e2f426e663c056dbe7b0070f0cb201de6753
MD5 3be11739b2aaf2be8305c8f833b1d07d
BLAKE2b-256 ef183571cc261291e6cfe01e2ca1f8e2937d07232bb4e1496200dd022129488a

See more details on using hashes here.

File details

Details for the file itsdangerous-2.0.0rc1-py3-none-any.whl.

File metadata

  • Download URL: itsdangerous-2.0.0rc1-py3-none-any.whl
  • Upload date:
  • Size: 18.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

File hashes

Hashes for itsdangerous-2.0.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 55398d354327a1af9eeab0917ffa926985bf88dbd2b051f2cc9fe3f69e9f11d6
MD5 8232d54088246ac4de8475fb21407bd1
BLAKE2b-256 68150ebb21ca835515e06f90f7553e851103525dabd76e1af15503e56d7f0777

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