github.com/anchore/syft@v1.38.2/cmd/syft/internal/options/attest.go (about) 1 package options 2 3 import ( 4 "github.com/anchore/clio" 5 ) 6 7 var _ clio.FlagAdder = (*Attest)(nil) 8 9 type Attest struct { 10 // IMPORTANT: do not show the attestation key/password in any YAML/JSON output (sensitive information) 11 Key secret `yaml:"key" json:"key" mapstructure:"key"` 12 Password secret `yaml:"password" json:"password" mapstructure:"password"` 13 } 14 15 var _ interface { 16 clio.FlagAdder 17 clio.FieldDescriber 18 } = (*Attest)(nil) 19 20 func (o *Attest) AddFlags(flags clio.FlagSet) { 21 flags.StringVarP((*string)(&o.Key), "key", "k", "the key to use for the attestation") 22 } 23 24 func (o *Attest) DescribeFields(descriptions clio.FieldDescriptionSet) { 25 descriptions.Add(&o.Password, `password to decrypt to given private key 26 additionally responds to COSIGN_PASSWORD env var`) 27 }