Skip to main content

For developers

Pre-requisites

  • Python 3.9
  • Pip (Python package manager)
  • Python-VENV (Python virtual environment management)
  • OpenSSL CLI

Setup a development environment

  1. Create a Python environment:
python3 -m venv venv
  1. Switch the shell to the created environment:
source venv/bin/activate
  1. Setup dependencies
pip install -r requirements.txt
  1. Generate self-signed certification authority
# Generate storage
mkdir storage

# Create a CA private key
openssl genrsa -out storage/ca-privkey.pem 4096

# Create a CA signing key
openssl req -new -key storage/ca-privkey.pem -x509 -days 1000 -out storage/ca-pubkey.pem -subj "/C=FR/ST=Loire/L=StEtienne/O=Global Security/OU=IT Department/CN=example.com"
  1. Run the server
uvicorn src.server:app --reload

Unit testing

Simply run the following command:

pytest

Code formatting

Check for coding style issues:

pylint /*

Fix all coding style issues at once using black:

black src/* test/*