jku / tuf-demo

An automated TUF repository demo
https://jku.github.io/tuf-demo/metadata/
6 stars 3 forks source link

Add succinct delegation, test it with client #29

Closed jku closed 2 years ago

jku commented 2 years ago

Once https://github.com/vmware-labs/repository-editor-for-tuf/pull/39 is in, we should add succinct delegations to this repo: not in top-level targets though so that old clients keep working as long as they don't ask for succinctly delegated targets.

# create delegation structure
tufrepo edit demo add-delegation --succinct 32 demo-bin
tufrepo init-succinct-roles demo
git commit -a -m "Create succinct delegation metadata"

# create some content files and add them to repository
mkdir ../targets/demo/
for i in $(seq 10); do
    TARGETPATH="demo/succinctly-delegated-${i}.txt"
    echo "succinctly delegated content $i" >  ../targets/${TARGETPATH}
    tufrepo add-target ${TARGETPATH} ../targets/${TARGETPATH}
done
git commit -a -m "Add 10 target files to succinctly delegated metadata"

That should work?

Then manual test that downloading these targets with ngclient (as described in README) works.

jku commented 2 years ago

This seems to work just fine -- although the succinct key is now in my possession, in a real use case it would have to be in the repository.

Maybe there is a way to test that as well here? modify snapshot process so that it notices changes to any targets roles it has keys for and and tries to sign them before snapshot?