Skip to content

Commit

Permalink
Fix verification example
Browse files Browse the repository at this point in the history
`GetTrustedrootJSON` was removed in 40d7422, so update the example for
the new API.

Signed-off-by: Colleen Murphy <[email protected]>
  • Loading branch information
cmurphy committed May 30, 2024
1 parent a23a4d5 commit 66672e9
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions docs/verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ To verify a bundle with the Go API, you'll need to:
Going through this step-by-step, we'll start by loading the trusted root from the Sigstore TUF repo:

```go
trustedrootJSON, err := tuf.GetTrustedrootJSON("tuf-repo-cdn.sigstore.dev", "tufcache")
opts := tuf.DefaultOptions()
opts.RepositoryBaseURL = "https://tuf-repo-cdn.sigstore.dev"
client, err := tuf.New(opts)
if err != nil {
panic(err)
}
trustedrootJSON, err := client.GetTarget("trusted_root.json")
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -187,7 +193,13 @@ import (
)

func main() {
trustedrootJSON, err := tuf.GetTrustedrootJSON("tuf-repo-cdn.sigstore.dev", "tufcache")
opts := tuf.DefaultOptions()
opts.RepositoryBaseURL = "https://tuf-repo-cdn.sigstore.dev"
client, err := tuf.New(opts)
if err != nil {
panic(err)
}
trustedrootJSON, err := client.GetTarget("trusted_root.json")
if err != nil {
panic(err)
}
Expand Down

0 comments on commit 66672e9

Please sign in to comment.