mirror of
https://github.com/anchore/syft.git
synced 2026-10-31 14:36:33 +01:00
Fix passing "--key" to the attest command. Additionally, pull in an update to the clio CLI library to permit unit testing that flags and env vars are parsed to the correct field on command options structs. This testing strategy was needed here because testing attestation in an end to end test requires a prohibitive amount of setup. --------- Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> Signed-off-by: Will Murphy <will.murphy@anchore.com> Co-authored-by: Alex Goodman <wagoodman@users.noreply.github.com>
20 lines
534 B
Go
20 lines
534 B
Go
package options
|
|
|
|
import (
|
|
"github.com/anchore/clio"
|
|
)
|
|
|
|
var _ clio.FlagAdder = (*Attest)(nil)
|
|
|
|
type Attest struct {
|
|
// IMPORTANT: do not show the attestation key/password in any YAML/JSON output (sensitive information)
|
|
Key secret `yaml:"key" json:"key" mapstructure:"key"`
|
|
Password secret `yaml:"password" json:"password" mapstructure:"password"`
|
|
}
|
|
|
|
var _ clio.FlagAdder = (*Attest)(nil)
|
|
|
|
func (o *Attest) AddFlags(flags clio.FlagSet) {
|
|
flags.StringVarP((*string)(&o.Key), "key", "k", "the key to use for the attestation")
|
|
}
|