Custom token lifecyle and rotation in Redis
Made for authorization flows that use internal refresh tokens. Implements token generation, validation, rotation and token reuse detection, using an async Redis client.
Clone the repository and install the package:
$ git clone https://github.com/iivek/redis-token-rotation.git
$ pip install -e ./
First, let's provision a local redis instance, using terraform. From project root:
$ export PROJECT_ROOT=$(pwd)
$ cd $PROJECT_ROOT/examples/terraform && \
terraform init && \
terraform plan && \
terraform apply -auto-approve # provision a local redis instance
Next, we can run the example python script:
$ cd $PROJECT_ROOT/examples && \
PYTHONPATH=$PROJECT_ROOT python main.py # run the example