For developers
Pre-requisites
- Python 3.9
- Pip (Python package manager)
- Python-VENV (Python virtual environment management)
- OpenSSL CLI
Setup a development environment
- Create a Python environment:
python3 -m venv venv
- Switch the shell to the created environment:
source venv/bin/activate
- Setup dependencies
pip install -r requirements.txt
- 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"
- 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/*