Skip to content

Login for JWT tokens to use across Safe Services (following ERC-4361)

License

Notifications You must be signed in to change notification settings

safe-global/safe-auth-service

Repository files navigation

Python CI Coverage Status pre-commit Python 3.13 Docker Image Version (latest semver)

Safe Auth Service

Grants JWT tokens to be used across the Safe Core{API} infrastructure. It supports ERC-4361 authentication.

Configuration

cp .env.sample .env

Execution

docker compose build
docker compose up

Then go to http://localhost:8888 to see the service documentation.

Setup for development

Use a virtualenv if possible:

python -m venv venv

Then enter the virtualenv and install the dependencies:

source venv/bin/activate
pip install -r requirements.txt
pre-commit install -f
cp .env.sample .env

Handle migrations

This projects is using Alembic to manage database migrations. To create a new migration based on changes made to the model code, run the following command:

alembic revision --autogenerate -m "MIGRATION TITLE"

Querying the database via Python Shell in Docker

To open an interactive Python shell within a Docker container and query the database, use the following command:

 docker exec -it safe-decoder-service-web-1 python -m IPython -i ./scripts/db_profile.py

Example usage:

contracts = await Contract.get_all()
contracts[0].address
b'J\xdb\xaa\xc7\xbc#\x9e%\x19\xcb\xfd#\x97\xe0\xf7Z\x1d\xe3U\xc8'

Call await restore_session() to reopen a new session.

Contributors

See contributors

About

Login for JWT tokens to use across Safe Services (following ERC-4361)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •