vmware-archive / repository-editor-for-tuf

Command line tool for editing and maintaining a TUF repository
Apache License 2.0
5 stars 3 forks source link

cli.py: split key generation from delegated bin files creation #54

Closed MVrachev closed 2 years ago

MVrachev commented 2 years ago

Fixes #41

The current succinct delegation process has three parts:

  1. create a delegation
  2. create a delegation key (store it for each delegated role)
  3. initialize metadata for each delegated role

but only two commands:

  1. tufrepo edit demo add-delegation --succinct 256 demo-bin
  2. tufrepo init-succinct-roles demo

This works, but the key generation happens internally and is magic for our users. This is a problem as the user doesn't have control over the key generation process (for example how many keys does he want to use for succinct hash bin delegation) and it's not a good practice given how important is the key generation step.

As a solution, remove the key generation logic from the second command "init-succinct-roles" and instead move it to "add-key".

Now the full succinct process can be achieved with three commands:

  1. tufrepo edit demo add-delegation --succinct 256 demo-bin
  2. tufrepo edit demo add-key
  3. tufrepo init-succinct-roles demo

Signed-off-by: Martin Vrachev mvrachev@vmware.com

MVrachev commented 2 years ago

I think I have addressed all comments.