notation
notation copied to clipboard
`notation policy init` command is necessary for user experiences
What is the areas you would like to add the new feature to?
Notation CLI
Is your feature request related to a problem?
In version 1.0.0-rc.4, notation policy
only supports import
and show
. Thus, to use notation CLI for artifact verification, a beginner has to follow the workflow below:
- Search for an example of notation trust policy either from specs or online docs.
- Create a trust policy file, copy and paste the example they found from step 1 into it.
- Change the values of the trust policy based on user's needs.
- Call
notation policy import <path-of-the-file-from-step3>
to actually configure Notation trust policy. Errors are highly possible because steps 1~3 are completed manually by the user. - Set up trust store based on trust policy with
notation cert add
. - Finally start doing verification with
notation verify
.
The workflow above is not user friendly and error prone. IMO, learning cost for a new user of Notation is too high.
What solution do you propose?
Introduce notation policy init
command. The command should prompt step by step with detailed descriptions on each field of the trust policy and ask users to type in values accordingly. On success, the command gathers answers from the user and configure Notation's trust policy within a single command.
For example,
provide "name" of your trust policy statement [Required]: <user-input>
provide "registryScopes" of your trust policy statement, it is an array of fully qualified repository URIs of the artifacts, valid examples "["registry.hello-world.io/software/hello-world"]", "["*"]" [Required]: <user-input>
...
Now, the workflow for a beginner using Notation verification becomes:
- Call
notation policy init
- Call
notation cert add
- Call
notation verify
What alternatives have you considered?
An alternative could be:
notation policy init
creates a default trustpolicy.json for the user.
If the user needs a more formal trust policy configuration, then they could do notation policy show
, change trust policy fields, and notation policy import
to update the default trustpolicy.json.
Any additional context?
No response