Skip to content

Latest commit

 

History

History
67 lines (52 loc) · 2.29 KB

File metadata and controls

67 lines (52 loc) · 2.29 KB

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Development

This documentation is dedicated for contributors who would like to add new vulnerable features to the project.

Configuring the project

The project is developed with the following frameworks and technologies:

Configuring a development environment is a straightforward process assuming that Python>=3.10, pip and Docker are already installed:

  1. Install psycopg2 prerequisites as described in the official documentation. For "*nix" distributions, the following command can be used:

    sudo apt install python3-dev libpq-dev
  2. Clone the repository and change directory to the project root:

    git clone https://github.com/theowni/Damn-Vulnerable-RESTaurant-API-Game.git
    cd Damn-Vulnerable-RESTaurant-API-Game
  3. Install Poetry:

    pip3 install poetry
  4. Install project dependencies and spawn shell within the created environment:

    poetry install
    poetry shell
  5. Setup pre-commit:

    pre-commit install
  6. Validate that tests are passing locally:

    pytest .
  7. Develop vulnerable API endpoints by following already existing files structure.

Running Tests

docker compose build
docker compose run web pytest .

Generating Alembic Migrations

Changes in database models need to be reflected in migrations via Alembic. Migrations can be created via:

docker compose build
docker compose run web alembic revision --autogenerate -m 'changes description'