notaryproject / notary

Notary is a project that allows anyone to have trust over arbitrary collections of data
Apache License 2.0
3.23k stars 511 forks source link

Proposal: notary inspect <gun> [target] #1041

Open cyli opened 7 years ago

cyli commented 7 years ago

Not sure if this would be useful, just wanted to mention it. It might be useful to surface GetAllTargetMetadataByName on the CLI somewhere, that basically lists all the details about a target as well as all of the roles it is signed into and as what hash.

Maybe the same output as list repo, but all for the same target. Something like:

NAME         DIGEST                                                              SIZE (BYTES)    ROLE
----         ------                                                              ------------    ----
README       6d22dd5be123534310cc2ff22d1dbc1d4eeb53f6861b2dcdf061e26138d2f24c    4668            targets/delegation
README       23dcb5c7effbe121293a81eec2ad6d51110894d5a466e48959de5a4fd5bcc2de    6886            targets

I vaguely remember @HuKeping asking if something like this existed (please correct me if I was wrong - I mainly remember someone asking for it previously, but have forgotten who).

Might also be useful for debugging purposes, if list or verify is not returning an expected result for instance.

cc @mbentley

endophage commented 7 years ago

I wonder if the syntax of the command should be notary inspect <gun> (--role|--target) <object name> where only one of role or target would be valid for a given invocation. Then we don't have to come up with a different command to get detailed info on a role.

HuKeping commented 7 years ago

This is from a special use case:

  1. the admin creates several delegation roles to mange resources respectively .
  2. one day the user who owns the admin role happened to publish a resources which should be usually done by delegation roleX .
  3. As per the implementation of notary at present, the outside world will never get the roleX's update for that resources any more. Which means even if roleX update the resources, notary list/verify will always get the admin's update as a valid one not the roleX's.

I don't feel very strong about this use case, just considered that we could not prevent people to do anything, like we can not guarantee that people will not forget their passphrase or delete their keys by accident. To customers , nothing is impossible.

I'm +1 for change the syntax of the command, it looks like more clear. We can add a default value to it if the role was not provided explicitly