Documentation
¶
Overview ¶
Package flagvalue provides reusable pflag.Value implementations for the complex inputs the slsa-attester CLI accepts: resource descriptors, digest and level maps, arbitrary JSON structs, and RFC3339 timestamps.
Where it makes sense, a value can be supplied as inline JSON, as @path to a JSON file, or as a key=value shorthand.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChecksumFileSlice ¶
type ChecksumFileSlice struct {
Values []*intoto.ResourceDescriptor
}
ChecksumFileSlice accumulates subject resource descriptors from files in coreutils checksum format: one "<digest><whitespace><name>" entry per line, as emitted by sha256sum and friends (the same format slsa-github-generator accepted in its base64-subjects input). The digest algorithm is inferred from the digest length using the in-toto algorithm table, so sha1sum, sha256sum, sha384sum and sha512sum outputs all work. Empty lines are ignored, the coreutils binary-mode "*" name marker is stripped, and a name appearing twice is an error.
func (*ChecksumFileSlice) Set ¶
func (c *ChecksumFileSlice) Set(path string) error
func (*ChecksumFileSlice) String ¶
func (c *ChecksumFileSlice) String() string
func (*ChecksumFileSlice) Type ¶
func (c *ChecksumFileSlice) Type() string
type RawJSON ¶
type RawJSON struct {
Data []byte
}
RawJSON holds raw JSON given inline or as @file. Only the JSON syntax is checked at flag-parse time; the schema is validated by whoever consumes the bytes (e.g. a strict proto unmarshal once the target type is known).
type ResourceDescriptorSlice ¶
type ResourceDescriptorSlice struct {
Values []*intoto.ResourceDescriptor
}
ResourceDescriptorSlice accumulates intoto ResourceDescriptors from repeated flag occurrences. Each occurrence may be inline JSON, @file, or the shorthand "name=foo,uri=...,sha256=abc" where name/uri are scalar fields and any other key is treated as a digest algorithm.
func (*ResourceDescriptorSlice) Set ¶
func (r *ResourceDescriptorSlice) Set(in string) error
func (*ResourceDescriptorSlice) String ¶
func (r *ResourceDescriptorSlice) String() string
func (*ResourceDescriptorSlice) Type ¶
func (r *ResourceDescriptorSlice) Type() string
type StringMap ¶
StringMap accumulates key=value string entries. Multiple comma-separated pairs per occurrence are allowed, and the flag may be repeated; later keys win.
type SubjectSlice ¶
type SubjectSlice struct {
Values []*intoto.ResourceDescriptor
}
SubjectSlice accumulates subject resource descriptors from repeated flag occurrences given as algorithm:digest, e.g. sha256:<hex>. The syntax and validation mirror the slsa verifier's -s/--subject flag so digests stated at attest time can be restated verbatim at verify time: the algorithm must be one in-toto defines, the digest must be hex of the algorithm's length, and it is normalized to lower case.
func (*SubjectSlice) Set ¶
func (s *SubjectSlice) Set(in string) error
func (*SubjectSlice) String ¶
func (s *SubjectSlice) String() string
func (*SubjectSlice) Type ¶
func (s *SubjectSlice) Type() string