- You need to have the
nsctool [https://github.com/nats-io/nsc] v2.5.0 installed on your machine as generating new user-seeds is not implemented in Python yet. pip install https://github.com/rentouch/natsjwt/releases/download/0.1.0/natsjwt-0.1.0.tar.gz
Create a new user JWT
user_jwt = NJWT.new_user("user-name")
print(account_jwt.sing(b"SAAHUYE..."))
Do changes to an existing JWT
account_jwt = NJWT.from_account_jwt("eyJ0eXAiOiJ...")
account_jwt.revoke("UB5BZ7SZ...")
print(account_jwt.sing(b"SAAHUYEX..."))
More can be found in ./examples directory of this project.
Installation
- Make sure that you have poetry installed
poetry install- Set dev mode
poetry run pip install -e .
Run the tests
poetry run pytest tests
Run examples
E.g. poetry run python examples/re-issue-account-jwt.py
poetry build- tbd