heddn / php-tuf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PHP-TUF

Running the tests

  1. Ensure you have all required dependencies by running composer install.
  2. Run composer test at the project's root.

Code Style

Run composer code-sniff to check for code style compliance.

Environment Setup for Python TUF CLI

  1. Install Python 3.8+ and PIP 19+ (not tested on earlier but may work).

  2. Set up a virtual environment:

    python3 -m venv venv
    source venv/bin/activate
    
  3. Install dependencies and TUF:

    pip install -r requirements.txt
    

Test Fixtures Setup

  1. Start a fixtures directory:

    mkdir fixtures
    
  2. Initialize the repository and add/sign a target:

    repo.py --path=fixtures/ --init --consistent  # Defaults to Ed25519
    echo "Test File" > testtarget.txt
    repo.py --path=fixtures/ --add testtarget.txt
    

Using Test Fixtures

  1. From fixtures/tufrepo:

    python3 -m http.server 8001
    
  2. From fixtures/tufclient:

    mkdir -p tuftargets
    curl http://localhost:8001/targets/testtarget.txt > tuftargets/testtarget.txt
    client.py --repo http://localhost:8001 testtarget.txt  # A 404 is expected for N.root.json unless a key has been rotated.
    

Resources

About

License:MIT License


Languages

Language:PHP 100.0%