package moby_buildkit_v1_sourcepolicy

import "github.com/moby/buildkit/sourcepolicy/pb"

Index

Variables

var (
	PolicyAction_name = map[int32]string{
		0: "ALLOW",
		1: "DENY",
		2: "CONVERT",
	}
	PolicyAction_value = map[string]int32{
		"ALLOW":   0,
		"DENY":    1,
		"CONVERT": 2,
	}
)

Enum value maps for PolicyAction.

var (
	AttrMatch_name = map[int32]string{
		0: "EQUAL",
		1: "NOTEQUAL",
		2: "MATCHES",
	}
	AttrMatch_value = map[string]int32{
		"EQUAL":    0,
		"NOTEQUAL": 1,
		"MATCHES":  2,
	}
)

Enum value maps for AttrMatch.

var (
	MatchType_name = map[int32]string{
		0: "WILDCARD",
		1: "EXACT",
		2: "REGEX",
	}
	MatchType_value = map[string]int32{
		"WILDCARD": 0,
		"EXACT":    1,
		"REGEX":    2,
	}
)

Enum value maps for MatchType.

var File_github_com_moby_buildkit_sourcepolicy_pb_policy_proto protoreflect.FileDescriptor

Types

type AttrConstraint

type AttrConstraint struct {
	Key       string    `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value     string    `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	Condition AttrMatch `protobuf:"varint,3,opt,name=condition,proto3,enum=moby.buildkit.v1.sourcepolicy.AttrMatch" json:"condition,omitempty"`
	// contains filtered or unexported fields
}

AttrConstraint defines a constraint on a source attribute

func (*AttrConstraint) CloneMessageVT

func (m *AttrConstraint) CloneMessageVT() proto.Message

func (*AttrConstraint) CloneVT

func (m *AttrConstraint) CloneVT() *AttrConstraint

func (*AttrConstraint) Descriptor

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

Deprecated: Use AttrConstraint.ProtoReflect.Descriptor instead.

func (*AttrConstraint) EqualMessageVT

func (this *AttrConstraint) EqualMessageVT(thatMsg proto.Message) bool

func (*AttrConstraint) EqualVT

func (this *AttrConstraint) EqualVT(that *AttrConstraint) bool

func (*AttrConstraint) GetCondition

func (x *AttrConstraint) GetCondition() AttrMatch

func (*AttrConstraint) GetKey

func (x *AttrConstraint) GetKey() string

func (*AttrConstraint) GetValue

func (x *AttrConstraint) GetValue() string

func (*AttrConstraint) MarshalToSizedBufferVT

func (m *AttrConstraint) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*AttrConstraint) MarshalToVT

func (m *AttrConstraint) MarshalToVT(dAtA []byte) (int, error)

func (*AttrConstraint) MarshalVT

func (m *AttrConstraint) MarshalVT() (dAtA []byte, err error)

func (*AttrConstraint) ProtoMessage

func (*AttrConstraint) ProtoMessage()

func (*AttrConstraint) ProtoReflect

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

func (*AttrConstraint) Reset

func (x *AttrConstraint) Reset()

func (*AttrConstraint) SizeVT

func (m *AttrConstraint) SizeVT() (n int)

func (*AttrConstraint) String

func (x *AttrConstraint) String() string

func (*AttrConstraint) UnmarshalVT

func (m *AttrConstraint) UnmarshalVT(dAtA []byte) error

type AttrMatch

type AttrMatch int32

AttrMatch defines the condition to match a source attribute

const (
	AttrMatch_EQUAL    AttrMatch = 0
	AttrMatch_NOTEQUAL AttrMatch = 1
	AttrMatch_MATCHES  AttrMatch = 2
)

func (AttrMatch) Descriptor

func (AttrMatch) Descriptor() protoreflect.EnumDescriptor

func (AttrMatch) Enum

func (x AttrMatch) Enum() *AttrMatch

func (AttrMatch) EnumDescriptor

func (AttrMatch) EnumDescriptor() ([]byte, []int)

Deprecated: Use AttrMatch.Descriptor instead.

func (AttrMatch) MarshalJSON

func (a AttrMatch) MarshalJSON() ([]byte, error)

func (AttrMatch) Number

func (x AttrMatch) Number() protoreflect.EnumNumber

func (AttrMatch) String

func (x AttrMatch) String() string

func (AttrMatch) Type

func (*AttrMatch) UnmarshalJSON

func (a *AttrMatch) UnmarshalJSON(data []byte) error

type MatchType

type MatchType int32

Match type is used to determine how a rule source is matched

const (
	// WILDCARD is the default matching type.
	// It may first attempt to due an exact match but will follow up with a wildcard match
	// For something more powerful, use REGEX
	MatchType_WILDCARD MatchType = 0
	// EXACT treats the source identifier as a litteral string match
	MatchType_EXACT MatchType = 1
	// REGEX treats the source identifier as a regular expression
	// With regex matching you can also use match groups to replace values in the destination identifier
	MatchType_REGEX MatchType = 2
)

func (MatchType) Descriptor

func (MatchType) Descriptor() protoreflect.EnumDescriptor

func (MatchType) Enum

func (x MatchType) Enum() *MatchType

func (MatchType) EnumDescriptor

func (MatchType) EnumDescriptor() ([]byte, []int)

Deprecated: Use MatchType.Descriptor instead.

func (MatchType) MarshalJSON

func (a MatchType) MarshalJSON() ([]byte, error)

func (MatchType) Number

func (x MatchType) Number() protoreflect.EnumNumber

func (MatchType) String

func (x MatchType) String() string

func (MatchType) Type

func (*MatchType) UnmarshalJSON

func (a *MatchType) UnmarshalJSON(data []byte) error

type Policy

type Policy struct {
	Version int64   `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` // Currently 1
	Rules   []*Rule `protobuf:"bytes,2,rep,name=rules,proto3" json:"rules,omitempty"`
	// contains filtered or unexported fields
}

Policy is the list of rules the policy engine will perform

func (*Policy) CloneMessageVT

func (m *Policy) CloneMessageVT() proto.Message

func (*Policy) CloneVT

func (m *Policy) CloneVT() *Policy

func (*Policy) Descriptor

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

Deprecated: Use Policy.ProtoReflect.Descriptor instead.

func (*Policy) EqualMessageVT

func (this *Policy) EqualMessageVT(thatMsg proto.Message) bool

func (*Policy) EqualVT

func (this *Policy) EqualVT(that *Policy) bool

func (*Policy) GetRules

func (x *Policy) GetRules() []*Rule

func (*Policy) GetVersion

func (x *Policy) GetVersion() int64

func (*Policy) MarshalToSizedBufferVT

func (m *Policy) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Policy) MarshalToVT

func (m *Policy) MarshalToVT(dAtA []byte) (int, error)

func (*Policy) MarshalVT

func (m *Policy) MarshalVT() (dAtA []byte, err error)

func (*Policy) ProtoMessage

func (*Policy) ProtoMessage()

func (*Policy) ProtoReflect

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

func (*Policy) Reset

func (x *Policy) Reset()

func (*Policy) SizeVT

func (m *Policy) SizeVT() (n int)

func (*Policy) String

func (x *Policy) String() string

func (*Policy) UnmarshalVT

func (m *Policy) UnmarshalVT(dAtA []byte) error

type PolicyAction

type PolicyAction int32

PolicyAction defines the action to take when a source is matched

const (
	PolicyAction_ALLOW   PolicyAction = 0
	PolicyAction_DENY    PolicyAction = 1
	PolicyAction_CONVERT PolicyAction = 2
)

func (PolicyAction) Descriptor

func (PolicyAction) Enum

func (x PolicyAction) Enum() *PolicyAction

func (PolicyAction) EnumDescriptor

func (PolicyAction) EnumDescriptor() ([]byte, []int)

Deprecated: Use PolicyAction.Descriptor instead.

func (PolicyAction) MarshalJSON

func (a PolicyAction) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler with custom marshaling for PolicyAction. It gives the string form of the enum value.

func (PolicyAction) Number

func (PolicyAction) String

func (x PolicyAction) String() string

func (PolicyAction) Type

func (*PolicyAction) UnmarshalJSON

func (a *PolicyAction) UnmarshalJSON(data []byte) error

type Rule

type Rule struct {
	Action   PolicyAction `protobuf:"varint,1,opt,name=action,proto3,enum=moby.buildkit.v1.sourcepolicy.PolicyAction" json:"action,omitempty"`
	Selector *Selector    `protobuf:"bytes,2,opt,name=selector,proto3" json:"selector,omitempty"`
	Updates  *Update      `protobuf:"bytes,3,opt,name=updates,proto3" json:"updates,omitempty"`
	// contains filtered or unexported fields
}

Rule defines the action(s) to take when a source is matched

func (*Rule) CloneMessageVT

func (m *Rule) CloneMessageVT() proto.Message

func (*Rule) CloneVT

func (m *Rule) CloneVT() *Rule

func (*Rule) Descriptor

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

Deprecated: Use Rule.ProtoReflect.Descriptor instead.

func (*Rule) EqualMessageVT

func (this *Rule) EqualMessageVT(thatMsg proto.Message) bool

func (*Rule) EqualVT

func (this *Rule) EqualVT(that *Rule) bool

func (*Rule) GetAction

func (x *Rule) GetAction() PolicyAction

func (*Rule) GetSelector

func (x *Rule) GetSelector() *Selector

func (*Rule) GetUpdates

func (x *Rule) GetUpdates() *Update

func (*Rule) MarshalToSizedBufferVT

func (m *Rule) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Rule) MarshalToVT

func (m *Rule) MarshalToVT(dAtA []byte) (int, error)

func (*Rule) MarshalVT

func (m *Rule) MarshalVT() (dAtA []byte, err error)

func (*Rule) ProtoMessage

func (*Rule) ProtoMessage()

func (*Rule) ProtoReflect

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

func (*Rule) Reset

func (x *Rule) Reset()

func (*Rule) SizeVT

func (m *Rule) SizeVT() (n int)

func (*Rule) String

func (x *Rule) String() string

func (*Rule) UnmarshalVT

func (m *Rule) UnmarshalVT(dAtA []byte) error

type Selector

type Selector struct {
	Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"`
	// MatchType is the type of match to perform on the source identifier
	MatchType   MatchType         `protobuf:"varint,2,opt,name=match_type,json=matchType,proto3,enum=moby.buildkit.v1.sourcepolicy.MatchType" json:"match_type,omitempty"`
	Constraints []*AttrConstraint `protobuf:"bytes,3,rep,name=constraints,proto3" json:"constraints,omitempty"`
	// contains filtered or unexported fields
}

Selector identifies a source to match a policy to

func (*Selector) CloneMessageVT

func (m *Selector) CloneMessageVT() proto.Message

func (*Selector) CloneVT

func (m *Selector) CloneVT() *Selector

func (*Selector) Descriptor

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

Deprecated: Use Selector.ProtoReflect.Descriptor instead.

func (*Selector) EqualMessageVT

func (this *Selector) EqualMessageVT(thatMsg proto.Message) bool

func (*Selector) EqualVT

func (this *Selector) EqualVT(that *Selector) bool

func (*Selector) GetConstraints

func (x *Selector) GetConstraints() []*AttrConstraint

func (*Selector) GetIdentifier

func (x *Selector) GetIdentifier() string

func (*Selector) GetMatchType

func (x *Selector) GetMatchType() MatchType

func (*Selector) MarshalToSizedBufferVT

func (m *Selector) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Selector) MarshalToVT

func (m *Selector) MarshalToVT(dAtA []byte) (int, error)

func (*Selector) MarshalVT

func (m *Selector) MarshalVT() (dAtA []byte, err error)

func (*Selector) ProtoMessage

func (*Selector) ProtoMessage()

func (*Selector) ProtoReflect

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

func (*Selector) Reset

func (x *Selector) Reset()

func (*Selector) SizeVT

func (m *Selector) SizeVT() (n int)

func (*Selector) String

func (x *Selector) String() string

func (*Selector) UnmarshalVT

func (m *Selector) UnmarshalVT(dAtA []byte) error

type Update

type Update struct {
	Identifier string            `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"`
	Attrs      map[string]string `protobuf:"bytes,2,rep,name=attrs,proto3" json:"attrs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
	// contains filtered or unexported fields
}

Update contains updates to the matched build step after rule is applied

func (*Update) CloneMessageVT

func (m *Update) CloneMessageVT() proto.Message

func (*Update) CloneVT

func (m *Update) CloneVT() *Update

func (*Update) Descriptor

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

Deprecated: Use Update.ProtoReflect.Descriptor instead.

func (*Update) EqualMessageVT

func (this *Update) EqualMessageVT(thatMsg proto.Message) bool

func (*Update) EqualVT

func (this *Update) EqualVT(that *Update) bool

func (*Update) GetAttrs

func (x *Update) GetAttrs() map[string]string

func (*Update) GetIdentifier

func (x *Update) GetIdentifier() string

func (*Update) MarshalToSizedBufferVT

func (m *Update) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Update) MarshalToVT

func (m *Update) MarshalToVT(dAtA []byte) (int, error)

func (*Update) MarshalVT

func (m *Update) MarshalVT() (dAtA []byte, err error)

func (*Update) ProtoMessage

func (*Update) ProtoMessage()

func (*Update) ProtoReflect

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

func (*Update) Reset

func (x *Update) Reset()

func (*Update) SizeVT

func (m *Update) SizeVT() (n int)

func (*Update) String

func (x *Update) String() string

func (*Update) UnmarshalVT

func (m *Update) UnmarshalVT(dAtA []byte) error

Source Files

json.go policy.pb.go policy_vtproto.pb.go

Version
v0.21.0 (latest)
Published
Apr 11, 2025
Platform
linux/amd64
Imports
10 packages
Last checked
11 hours ago

Tools for package owners.