v1

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 8 Imported by: 6

Documentation

Index

Constants

View Source
const StatementTypeUri = "https://in-toto.io/Statement/v1"

Variables

View Source
var (
	ErrIncorrectDigestLength = errors.New("digest has incorrect length")
	ErrInvalidDigestEncoding = errors.New("digest is not valid hex-encoded string")
	ErrRDRequiredField       = errors.New("at least one of name, URI, or digest are required")
)
View Source
var (
	ErrInvalidStatementType  = errors.New("wrong statement type")
	ErrSubjectRequired       = errors.New("at least one subject required")
	ErrDigestRequired        = errors.New("at least one digest required")
	ErrPredicateTypeRequired = errors.New("predicate type required")
	ErrPredicateRequired     = errors.New("predicate object required")
)
View Source
var File_in_toto_attestation_v1_resource_descriptor_proto protoreflect.FileDescriptor
View Source
var File_in_toto_attestation_v1_statement_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type ResourceDescriptor

type ResourceDescriptor struct {
	Name             string            `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Uri              string            `protobuf:"bytes,2,opt,name=uri,proto3" json:"uri,omitempty"`
	Digest           map[string]string `` /* 153-byte string literal not displayed */
	Content          []byte            `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty"`
	DownloadLocation string            `protobuf:"bytes,5,opt,name=download_location,json=downloadLocation,proto3" json:"download_location,omitempty"`
	MediaType        string            `protobuf:"bytes,6,opt,name=media_type,json=mediaType,proto3" json:"media_type,omitempty"`
	// Per the Struct protobuf spec, this type corresponds to
	// a JSON Object, which is truly a map<string, Value> under the hood.
	// So, the Struct a) is still consistent with our specification for
	// the `annotations` field, and b) has native support in some language
	// bindings making their use easier in implementations.
	// See: https://pkg.go.dev/google.golang.org/protobuf/types/known/structpb#Struct
	Annotations *structpb.Struct `protobuf:"bytes,7,opt,name=annotations,proto3" json:"annotations,omitempty"`
	// contains filtered or unexported fields
}

Proto representation of the in-toto v1 ResourceDescriptor. https://github.com/in-toto/attestation/blob/main/spec/v1/resource_descriptor.md Validation of all fields is left to the users of this proto.

func (*ResourceDescriptor) Descriptor deprecated

func (*ResourceDescriptor) Descriptor() ([]byte, []int)

Deprecated: Use ResourceDescriptor.ProtoReflect.Descriptor instead.

func (*ResourceDescriptor) GetAnnotations

func (x *ResourceDescriptor) GetAnnotations() *structpb.Struct

func (*ResourceDescriptor) GetContent

func (x *ResourceDescriptor) GetContent() []byte

func (*ResourceDescriptor) GetDigest

func (x *ResourceDescriptor) GetDigest() map[string]string

func (*ResourceDescriptor) GetDownloadLocation

func (x *ResourceDescriptor) GetDownloadLocation() string

func (*ResourceDescriptor) GetMediaType

func (x *ResourceDescriptor) GetMediaType() string

func (*ResourceDescriptor) GetName

func (x *ResourceDescriptor) GetName() string

func (*ResourceDescriptor) GetUri

func (x *ResourceDescriptor) GetUri() string

func (*ResourceDescriptor) ProtoMessage

func (*ResourceDescriptor) ProtoMessage()

func (*ResourceDescriptor) ProtoReflect

func (x *ResourceDescriptor) ProtoReflect() protoreflect.Message

func (*ResourceDescriptor) Reset

func (x *ResourceDescriptor) Reset()

func (*ResourceDescriptor) String

func (x *ResourceDescriptor) String() string

func (*ResourceDescriptor) Validate

func (d *ResourceDescriptor) Validate() error

type Statement

type Statement struct {

	// Expected to always be "https://in-toto.io/Statement/v1"
	Type          string                `protobuf:"bytes,1,opt,name=type,json=_type,proto3" json:"type,omitempty"`
	Subject       []*ResourceDescriptor `protobuf:"bytes,2,rep,name=subject,proto3" json:"subject,omitempty"`
	PredicateType string                `protobuf:"bytes,3,opt,name=predicate_type,json=predicateType,proto3" json:"predicate_type,omitempty"`
	Predicate     *structpb.Struct      `protobuf:"bytes,4,opt,name=predicate,proto3" json:"predicate,omitempty"`
	// contains filtered or unexported fields
}

Proto representation of the in-toto v1 Statement. https://github.com/in-toto/attestation/tree/main/spec/v1 Validation of all fields is left to the users of this proto.

func (*Statement) Descriptor deprecated

func (*Statement) Descriptor() ([]byte, []int)

Deprecated: Use Statement.ProtoReflect.Descriptor instead.

func (*Statement) GetPredicate

func (x *Statement) GetPredicate() *structpb.Struct

func (*Statement) GetPredicateType

func (x *Statement) GetPredicateType() string

func (*Statement) GetSubject

func (x *Statement) GetSubject() []*ResourceDescriptor

func (*Statement) GetType

func (x *Statement) GetType() string

func (*Statement) ProtoMessage

func (*Statement) ProtoMessage()

func (*Statement) ProtoReflect

func (x *Statement) ProtoReflect() protoreflect.Message

func (*Statement) Reset

func (x *Statement) Reset()

func (*Statement) String

func (x *Statement) String() string

func (*Statement) Validate

func (s *Statement) Validate() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL