Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions specs/commandline/verify.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,39 @@ export NOTATION_EXPERIMENTAL=1
# The value of --scope should be set base on the trust policy configuration
notation verify --oci-layout --scope "local/hello-world" hello-world:v1
```

### Verify signatures on an OCI artifact with json output

Use the `--output` flag to format verification output in json.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add this new flag along with its description into the Outline session of this spec? (https://github.com/notaryproject/notation/blob/main/specs/commandline/verify.md#outline)


```shell
notation verify --output json localhost:5000/net-monitor@sha256:b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, what error message are we expecting from the following command:
notation verify --output <something_not_defined> localhost:5000/net-monitor@sha256:b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9

```

An example of output messages for a successful verification:

```json
{
"reference": "localhost:5000/net-monitor@sha256:b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9",
"signatures" : [
{
"digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"userDefinedAttributes": {
"io.wabbit-networks.buildId": "123"
}
}
],
"result": "success"
}
```

An example of output messages for a verification skipped by the trust policy:

```json
{
"reference": "localhost:5000/net-monitor@sha256:b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9",
"result": "skipped"
}
```

On unsuccessful verification, a non-zero exit code will be returned and an error message will be written to stderr.