Skip to main content

Platform-Agnostic Security Tokens for Python

Project description

python-paseto

Platform-Agnostic Security Tokens for Python

Build Status ci-workflow Coverage Status Language grade: Python Code style: black

Installation

Clone the repository, in the future a pip install will be available.

poetry is used to manage project dependencies / build / test / publish.

Install dependencies with

poetry install

Run tests

pytest

To check code coverage run

coverage run -m pytest
coverage report

Low level API

Initial implementation of the V2 encrypt / decrypt functions. Alpha version. Low level API focuses on solid, high quality, production ready primitives as specified directly in the PASETO protocol.

from paseto.protocol.version2 import Version2

key = b"0" * 32
message = b"foo"
footer = b"sample_footer"

token = Version2.encrypt(message, key, footer)
plain_text = Version2.decrypt(token, key, footer)

assert plain_text == message

High level API

In the future a high level API will provide developer friendly access to low level API and support easy integration into other projects.

Code formatting is managed by black. To format run

black .

Supported by

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