moby_buildkit_v1_sourcepolicy

package
v0.13.0-beta3 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 6 Imported by: 50

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthPolicy        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowPolicy          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupPolicy = fmt.Errorf("proto: unexpected end of group")
)
View Source
var AttrMatch_name = map[int32]string{
	0: "EQUAL",
	1: "NOTEQUAL",
	2: "MATCHES",
}
View Source
var AttrMatch_value = map[string]int32{
	"EQUAL":    0,
	"NOTEQUAL": 1,
	"MATCHES":  2,
}
View Source
var MatchType_name = map[int32]string{
	0: "WILDCARD",
	1: "EXACT",
	2: "REGEX",
}
View Source
var MatchType_value = map[string]int32{
	"WILDCARD": 0,
	"EXACT":    1,
	"REGEX":    2,
}
View Source
var PolicyAction_name = map[int32]string{
	0: "ALLOW",
	1: "DENY",
	2: "CONVERT",
}
View Source
var PolicyAction_value = map[string]int32{
	"ALLOW":   0,
	"DENY":    1,
	"CONVERT": 2,
}

Functions

This section is empty.

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"`
}

AttrConstraint defines a constraint on a source attribute

func (*AttrConstraint) Descriptor

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

func (*AttrConstraint) GetCondition

func (m *AttrConstraint) GetCondition() AttrMatch

func (*AttrConstraint) GetKey

func (m *AttrConstraint) GetKey() string

func (*AttrConstraint) GetValue

func (m *AttrConstraint) GetValue() string

func (*AttrConstraint) Marshal

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

func (*AttrConstraint) MarshalTo

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

func (*AttrConstraint) MarshalToSizedBuffer

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

func (*AttrConstraint) ProtoMessage

func (*AttrConstraint) ProtoMessage()

func (*AttrConstraint) Reset

func (m *AttrConstraint) Reset()

func (*AttrConstraint) Size

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

func (*AttrConstraint) String

func (m *AttrConstraint) String() string

func (*AttrConstraint) Unmarshal

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

func (*AttrConstraint) XXX_DiscardUnknown

func (m *AttrConstraint) XXX_DiscardUnknown()

func (*AttrConstraint) XXX_Marshal

func (m *AttrConstraint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AttrConstraint) XXX_Merge

func (m *AttrConstraint) XXX_Merge(src proto.Message)

func (*AttrConstraint) XXX_Size

func (m *AttrConstraint) XXX_Size() int

func (*AttrConstraint) XXX_Unmarshal

func (m *AttrConstraint) XXX_Unmarshal(b []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) EnumDescriptor

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

func (AttrMatch) MarshalJSON

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

func (AttrMatch) String

func (x AttrMatch) String() string

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) EnumDescriptor

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

func (MatchType) MarshalJSON

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

func (MatchType) String

func (x MatchType) String() string

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"`
	Rules   []*Rule `protobuf:"bytes,2,rep,name=rules,proto3" json:"rules,omitempty"`
}

Policy is the list of rules the policy engine will perform

func (*Policy) Descriptor

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

func (*Policy) GetRules

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

func (*Policy) GetVersion

func (m *Policy) GetVersion() int64

func (*Policy) Marshal

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

func (*Policy) MarshalTo

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

func (*Policy) MarshalToSizedBuffer

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

func (*Policy) ProtoMessage

func (*Policy) ProtoMessage()

func (*Policy) Reset

func (m *Policy) Reset()

func (*Policy) Size

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

func (*Policy) String

func (m *Policy) String() string

func (*Policy) Unmarshal

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

func (*Policy) XXX_DiscardUnknown

func (m *Policy) XXX_DiscardUnknown()

func (*Policy) XXX_Marshal

func (m *Policy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Policy) XXX_Merge

func (m *Policy) XXX_Merge(src proto.Message)

func (*Policy) XXX_Size

func (m *Policy) XXX_Size() int

func (*Policy) XXX_Unmarshal

func (m *Policy) XXX_Unmarshal(b []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) EnumDescriptor

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

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) String

func (x PolicyAction) String() string

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"`
}

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

func (*Rule) Descriptor

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

func (*Rule) GetAction

func (m *Rule) GetAction() PolicyAction

func (*Rule) GetSelector

func (m *Rule) GetSelector() *Selector

func (*Rule) GetUpdates

func (m *Rule) GetUpdates() *Update

func (*Rule) Marshal

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

func (*Rule) MarshalTo

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

func (*Rule) MarshalToSizedBuffer

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

func (*Rule) ProtoMessage

func (*Rule) ProtoMessage()

func (*Rule) Reset

func (m *Rule) Reset()

func (*Rule) Size

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

func (*Rule) String

func (m *Rule) String() string

func (*Rule) Unmarshal

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

func (*Rule) XXX_DiscardUnknown

func (m *Rule) XXX_DiscardUnknown()

func (*Rule) XXX_Marshal

func (m *Rule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Rule) XXX_Merge

func (m *Rule) XXX_Merge(src proto.Message)

func (*Rule) XXX_Size

func (m *Rule) XXX_Size() int

func (*Rule) XXX_Unmarshal

func (m *Rule) XXX_Unmarshal(b []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         `` /* 134-byte string literal not displayed */
	Constraints []*AttrConstraint `protobuf:"bytes,3,rep,name=constraints,proto3" json:"constraints,omitempty"`
}

Selector identifies a source to match a policy to

func (*Selector) Descriptor

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

func (*Selector) GetConstraints

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

func (*Selector) GetIdentifier

func (m *Selector) GetIdentifier() string

func (*Selector) GetMatchType

func (m *Selector) GetMatchType() MatchType

func (*Selector) Marshal

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

func (*Selector) MarshalTo

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

func (*Selector) MarshalToSizedBuffer

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

func (*Selector) ProtoMessage

func (*Selector) ProtoMessage()

func (*Selector) Reset

func (m *Selector) Reset()

func (*Selector) Size

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

func (*Selector) String

func (m *Selector) String() string

func (*Selector) Unmarshal

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

func (*Selector) XXX_DiscardUnknown

func (m *Selector) XXX_DiscardUnknown()

func (*Selector) XXX_Marshal

func (m *Selector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Selector) XXX_Merge

func (m *Selector) XXX_Merge(src proto.Message)

func (*Selector) XXX_Size

func (m *Selector) XXX_Size() int

func (*Selector) XXX_Unmarshal

func (m *Selector) XXX_Unmarshal(b []byte) error

type Update

type Update struct {
	Identifier string            `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"`
	Attrs      map[string]string `` /* 151-byte string literal not displayed */
}

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

func (*Update) Descriptor

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

func (*Update) GetAttrs

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

func (*Update) GetIdentifier

func (m *Update) GetIdentifier() string

func (*Update) Marshal

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

func (*Update) MarshalTo

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

func (*Update) MarshalToSizedBuffer

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

func (*Update) ProtoMessage

func (*Update) ProtoMessage()

func (*Update) Reset

func (m *Update) Reset()

func (*Update) Size

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

func (*Update) String

func (m *Update) String() string

func (*Update) Unmarshal

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

func (*Update) XXX_DiscardUnknown

func (m *Update) XXX_DiscardUnknown()

func (*Update) XXX_Marshal

func (m *Update) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Update) XXX_Merge

func (m *Update) XXX_Merge(src proto.Message)

func (*Update) XXX_Size

func (m *Update) XXX_Size() int

func (*Update) XXX_Unmarshal

func (m *Update) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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