theupdateframework / go-tuf

Go implementation of The Update Framework (TUF)
https://theupdateframework.com
Apache License 2.0
625 stars 105 forks source link

Set sig to Array when empty #531

Closed ChevronTango closed 11 months ago

ChevronTango commented 1 year ago

right now the tuf init and a few other commands default to setting the sig field to null when it has no valid signatures. A few other commands and CLIs break when they try and read this new json as they are expecting an array, and null is unexpected. Subsequently we have to manually set the sig to [] when writing a script to handle TUF logic so that the next commands will parse the json correctly. Instead the CLI should always return valid JSON with an empty array, rather than a null, so that the downstream JSON parsing always passes correctly.