Skip to content

Commit

Permalink
docs: update the contributing guide for a successful cli debugging (r…
Browse files Browse the repository at this point in the history
  • Loading branch information
shahramk64 authored and duffney committed Aug 23, 2024
1 parent 8d0a864 commit dcc64b5
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 2 deletions.
10 changes: 8 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ The Ratify project is composed of the following main components:

Ratify can run through cli command or run as a http server. Create a [launch.json](https://code.visualstudio.com/docs/editor/debugging#_launch-configurations) file in the .vscode directory, then hit F5 to debug. Note the first debug session may take a few minutes to load, subsequent session will be much faster.

Sample json for cli:
Here is a sample json for cli. Note that for the following sample json to successfully work, you need to make sure that `verificationCerts` attribute of the verifier in your config file points to the notation verifier's certificate file. In order to do that, you can download the cert file with the following command:
`curl -sSLO https://raw.githubusercontent.com/deislabs/ratify/main/test/testdata/notation.crt`,
and then modify the config file by setting the `verificationCerts` attribute in the notation verifier to the downloaded cert file path.

```json
{
Expand All @@ -65,7 +67,11 @@ Sample json for cli:
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/cmd/ratify",
"args": ["verify", "-s", "ratify.azurecr.io/testimage@sha256:9515b691095051d68b4409a30c4819c98bd6f4355d5993a7487687cdc6d47cc3"]
"args": [
"verify",
"-s", "ghcr.io/deislabs/ratify/notary-image:signed",
"-c", "${workspaceFolder}/test/bats/tests/config/config_cli.json"
]
}]
}
```
Expand Down
55 changes: 55 additions & 0 deletions config/config_cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"store": {
"version": "1.0.0",
"plugins": [
{
"name": "oras",
"cosignEnabled": true,
"useHttp": true
}
]
},
"policy": {
"version": "1.0.0",
"plugin": {
"name": "configPolicy"
}
},
"verifier": {
"version": "1.0.0",
"plugins": [
{
"name": "cosign",
"artifactTypes": "application/vnd.dev.cosign.artifact.sig.v1+json",
"key": ".staging/cosign/cosign.pub"
},
{
"name": "notation",
"artifactTypes": "application/vnd.cncf.notary.signature",
"verificationCerts": [
"~/.config/notation/localkeys/notation.crt"
],
"trustPolicyDoc": {
"version": "1.0",
"trustPolicies": [
{
"name": "default",
"registryScopes": [
"*"
],
"signatureVerification": {
"level": "strict"
},
"trustStores": [
"ca:certs"
],
"trustedIdentities": [
"*"
]
}
]
}
}
]
}
}

0 comments on commit dcc64b5

Please sign in to comment.