2945 lines
74 KiB
Go
2945 lines
74 KiB
Go
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
|
// source: security/v1beta1/authorization.proto
|
|
|
|
// Istio Authorization Policy enables access control on workloads in the mesh.
|
|
//
|
|
// Authorization policy supports both allow and deny policies. When allow and
|
|
// deny policies are used for a workload at the same time, the deny policies are
|
|
// evaluated first. The evaluation is determined by the following rules:
|
|
//
|
|
// 1. If there are any DENY policies that match the request, deny the request.
|
|
// 2. If there are no ALLOW policies for the workload, allow the request.
|
|
// 3. If any of the ALLOW policies match the request, allow the request.
|
|
// 4. Deny the request.
|
|
//
|
|
// For example, the following authorization policy sets the `action` to "ALLOW"
|
|
// to create an allow policy. The default action is "ALLOW" but it is useful
|
|
// to be explicit in the policy.
|
|
//
|
|
// It allows requests from:
|
|
//
|
|
// - service account "cluster.local/ns/default/sa/sleep" or
|
|
// - namespace "test"
|
|
//
|
|
// to access the workload with:
|
|
//
|
|
// - "GET" method at paths of prefix "/info" or,
|
|
// - "POST" method at path "/data".
|
|
//
|
|
// when the request has a valid JWT token issued by "https://accounts.google.com".
|
|
//
|
|
// Any other requests will be denied.
|
|
//
|
|
// ```yaml
|
|
// apiVersion: security.istio.io/v1beta1
|
|
// kind: AuthorizationPolicy
|
|
// metadata:
|
|
// name: httpbin
|
|
// namespace: foo
|
|
// spec:
|
|
// action: ALLOW
|
|
// rules:
|
|
// - from:
|
|
// - source:
|
|
// principals: ["cluster.local/ns/default/sa/sleep"]
|
|
// - source:
|
|
// namespaces: ["test"]
|
|
// to:
|
|
// - operation:
|
|
// methods: ["GET"]
|
|
// paths: ["/info*"]
|
|
// - operation:
|
|
// methods: ["POST"]
|
|
// paths: ["/data"]
|
|
// when:
|
|
// - key: request.auth.claims[iss]
|
|
// values: ["https://accounts.google.com"]
|
|
// ```
|
|
//
|
|
// The following is another example that sets `action` to "DENY" to create a deny policy.
|
|
// It denies requests from the "dev" namespace to the "POST" method on all workloads
|
|
// in the "foo" namespace.
|
|
//
|
|
// ```yaml
|
|
// apiVersion: security.istio.io/v1beta1
|
|
// kind: AuthorizationPolicy
|
|
// metadata:
|
|
// name: httpbin
|
|
// namespace: foo
|
|
// spec:
|
|
// action: DENY
|
|
// rules:
|
|
// - from:
|
|
// - source:
|
|
// namespaces: ["dev"]
|
|
// to:
|
|
// - operation:
|
|
// methods: ["POST"]
|
|
// ```
|
|
//
|
|
// Authorization Policy scope (target) is determined by "metadata/namespace" and
|
|
// an optional "selector".
|
|
//
|
|
// - "metadata/namespace" tells which namespace the policy applies. If set to root
|
|
// namespace, the policy applies to all namespaces in a mesh.
|
|
// - workload "selector" can be used to further restrict where a policy applies.
|
|
//
|
|
// For example,
|
|
//
|
|
// The following authorization policy applies to workloads containing label
|
|
// "app: httpbin" in namespace bar.
|
|
//
|
|
// ```yaml
|
|
// apiVersion: security.istio.io/v1beta1
|
|
// kind: AuthorizationPolicy
|
|
// metadata:
|
|
// name: policy
|
|
// namespace: bar
|
|
// spec:
|
|
// selector:
|
|
// matchLabels:
|
|
// app: httpbin
|
|
// ```
|
|
//
|
|
// The following authorization policy applies to all workloads in namespace foo.
|
|
//
|
|
// ```yaml
|
|
// apiVersion: security.istio.io/v1beta1
|
|
// kind: AuthorizationPolicy
|
|
// metadata:
|
|
// name: policy
|
|
// namespace: foo
|
|
// spec:
|
|
// {}
|
|
// ```
|
|
//
|
|
// The following authorization policy applies to workloads containing label
|
|
// "version: v1" in all namespaces in the mesh. (Assuming the root namespace is
|
|
// configured to "istio-config").
|
|
//
|
|
// ```yaml
|
|
// apiVersion: security.istio.io/v1beta1
|
|
// kind: AuthorizationPolicy
|
|
// metadata:
|
|
// name: policy
|
|
// namespace: istio-config
|
|
// spec:
|
|
// selector:
|
|
// matchLabels:
|
|
// version: v1
|
|
// ```
|
|
|
|
package v1beta1
|
|
|
|
import (
|
|
fmt "fmt"
|
|
proto "github.com/gogo/protobuf/proto"
|
|
io "io"
|
|
v1beta1 "istio.io/api/type/v1beta1"
|
|
_ "istio.io/gogo-genproto/googleapis/google/api"
|
|
math "math"
|
|
math_bits "math/bits"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the proto package it is being compiled against.
|
|
// A compilation error at this line likely means your copy of the
|
|
// proto package needs to be updated.
|
|
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
|
|
|
// Action specifies the operation to take.
|
|
type AuthorizationPolicy_Action int32
|
|
|
|
const (
|
|
// Allow a request only if it matches the rules. This is the default type.
|
|
AuthorizationPolicy_ALLOW AuthorizationPolicy_Action = 0
|
|
// Deny a request if it matches any of the rules.
|
|
AuthorizationPolicy_DENY AuthorizationPolicy_Action = 1
|
|
)
|
|
|
|
var AuthorizationPolicy_Action_name = map[int32]string{
|
|
0: "ALLOW",
|
|
1: "DENY",
|
|
}
|
|
|
|
var AuthorizationPolicy_Action_value = map[string]int32{
|
|
"ALLOW": 0,
|
|
"DENY": 1,
|
|
}
|
|
|
|
func (x AuthorizationPolicy_Action) String() string {
|
|
return proto.EnumName(AuthorizationPolicy_Action_name, int32(x))
|
|
}
|
|
|
|
func (AuthorizationPolicy_Action) EnumDescriptor() ([]byte, []int) {
|
|
return fileDescriptor_b72f4bc212a83269, []int{0, 0}
|
|
}
|
|
|
|
// AuthorizationPolicy enables access control on workloads.
|
|
//
|
|
// For example, the following authorization policy denies all requests to workloads
|
|
// in namespace foo.
|
|
//
|
|
// ```yaml
|
|
// apiVersion: security.istio.io/v1beta1
|
|
// kind: AuthorizationPolicy
|
|
// metadata:
|
|
// name: deny-all
|
|
// namespace: foo
|
|
// spec:
|
|
// {}
|
|
// ```
|
|
//
|
|
// The following authorization policy allows all requests to workloads in namespace
|
|
// foo.
|
|
//
|
|
// ```yaml
|
|
// apiVersion: security.istio.io/v1beta1
|
|
// kind: AuthorizationPolicy
|
|
// metadata:
|
|
// name: allow-all
|
|
// namespace: foo
|
|
// spec:
|
|
// rules:
|
|
// - {}
|
|
// ```
|
|
//
|
|
// <!-- crd generation tags
|
|
// +cue-gen:AuthorizationPolicy:groupName:security.istio.io
|
|
// +cue-gen:AuthorizationPolicy:version:v1beta1
|
|
// +cue-gen:AuthorizationPolicy:storageVersion
|
|
// +cue-gen:AuthorizationPolicy:annotations:helm.sh/resource-policy=keep
|
|
// +cue-gen:AuthorizationPolicy:labels:app=istio-pilot,chart=istio,istio=security,heritage=Tiller,release=istio
|
|
// +cue-gen:AuthorizationPolicy:subresource:status
|
|
// +cue-gen:AuthorizationPolicy:scope:Namespaced
|
|
// +cue-gen:AuthorizationPolicy:resource:categories=istio-io,security-istio-io,plural=authorizationpolicies
|
|
// +cue-gen:AuthorizationPolicy:preserveUnknownFields:false
|
|
// -->
|
|
//
|
|
// <!-- go code generation tags
|
|
// +kubetype-gen
|
|
// +kubetype-gen:groupVersion=security.istio.io/v1beta1
|
|
// +genclient
|
|
// +k8s:deepcopy-gen=true
|
|
// -->
|
|
type AuthorizationPolicy struct {
|
|
// Optional. Workload selector decides where to apply the authorization policy.
|
|
// If not set, the authorization policy will be applied to all workloads in the
|
|
// same namespace as the authorization policy.
|
|
Selector *v1beta1.WorkloadSelector `protobuf:"bytes,1,opt,name=selector,proto3" json:"selector,omitempty"`
|
|
// Optional. A list of rules to match the request. A match occurs when at least
|
|
// one rule matches the request.
|
|
//
|
|
// If not set, the match will never occur. This is equivalent to setting a
|
|
// default of deny for the target workloads.
|
|
Rules []*Rule `protobuf:"bytes,2,rep,name=rules,proto3" json:"rules,omitempty"`
|
|
// Optional. The action to take if the request is matched with the rules.
|
|
Action AuthorizationPolicy_Action `protobuf:"varint,3,opt,name=action,proto3,enum=istio.security.v1beta1.AuthorizationPolicy_Action" json:"action,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *AuthorizationPolicy) Reset() { *m = AuthorizationPolicy{} }
|
|
func (m *AuthorizationPolicy) String() string { return proto.CompactTextString(m) }
|
|
func (*AuthorizationPolicy) ProtoMessage() {}
|
|
func (*AuthorizationPolicy) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_b72f4bc212a83269, []int{0}
|
|
}
|
|
func (m *AuthorizationPolicy) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *AuthorizationPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_AuthorizationPolicy.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalToSizedBuffer(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *AuthorizationPolicy) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_AuthorizationPolicy.Merge(m, src)
|
|
}
|
|
func (m *AuthorizationPolicy) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *AuthorizationPolicy) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_AuthorizationPolicy.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_AuthorizationPolicy proto.InternalMessageInfo
|
|
|
|
func (m *AuthorizationPolicy) GetSelector() *v1beta1.WorkloadSelector {
|
|
if m != nil {
|
|
return m.Selector
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *AuthorizationPolicy) GetRules() []*Rule {
|
|
if m != nil {
|
|
return m.Rules
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *AuthorizationPolicy) GetAction() AuthorizationPolicy_Action {
|
|
if m != nil {
|
|
return m.Action
|
|
}
|
|
return AuthorizationPolicy_ALLOW
|
|
}
|
|
|
|
// Rule matches requests from a list of sources that perform a list of operations subject to a
|
|
// list of conditions. A match occurs when at least one source, operation and condition
|
|
// matches the request. An empty rule is always matched.
|
|
//
|
|
// Any string field in the rule supports Exact, Prefix, Suffix and Presence match:
|
|
//
|
|
// - Exact match: "abc" will match on value "abc".
|
|
// - Prefix match: "abc*" will match on value "abc" and "abcd".
|
|
// - Suffix match: "*abc" will match on value "abc" and "xabc".
|
|
// - Presence match: "*" will match when value is not empty.
|
|
type Rule struct {
|
|
// Optional. from specifies the source of a request.
|
|
//
|
|
// If not set, any source is allowed.
|
|
From []*Rule_From `protobuf:"bytes,1,rep,name=from,proto3" json:"from,omitempty"`
|
|
// Optional. to specifies the operation of a request.
|
|
//
|
|
// If not set, any operation is allowed.
|
|
To []*Rule_To `protobuf:"bytes,2,rep,name=to,proto3" json:"to,omitempty"`
|
|
// Optional. when specifies a list of additional conditions of a request.
|
|
//
|
|
// If not set, any condition is allowed.
|
|
When []*Condition `protobuf:"bytes,3,rep,name=when,proto3" json:"when,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *Rule) Reset() { *m = Rule{} }
|
|
func (m *Rule) String() string { return proto.CompactTextString(m) }
|
|
func (*Rule) ProtoMessage() {}
|
|
func (*Rule) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_b72f4bc212a83269, []int{1}
|
|
}
|
|
func (m *Rule) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *Rule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_Rule.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalToSizedBuffer(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *Rule) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Rule.Merge(m, src)
|
|
}
|
|
func (m *Rule) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *Rule) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Rule.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Rule proto.InternalMessageInfo
|
|
|
|
func (m *Rule) GetFrom() []*Rule_From {
|
|
if m != nil {
|
|
return m.From
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Rule) GetTo() []*Rule_To {
|
|
if m != nil {
|
|
return m.To
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Rule) GetWhen() []*Condition {
|
|
if m != nil {
|
|
return m.When
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// From includes a list or sources.
|
|
type Rule_From struct {
|
|
// Source specifies the source of a request.
|
|
Source *Source `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *Rule_From) Reset() { *m = Rule_From{} }
|
|
func (m *Rule_From) String() string { return proto.CompactTextString(m) }
|
|
func (*Rule_From) ProtoMessage() {}
|
|
func (*Rule_From) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_b72f4bc212a83269, []int{1, 0}
|
|
}
|
|
func (m *Rule_From) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *Rule_From) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_Rule_From.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalToSizedBuffer(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *Rule_From) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Rule_From.Merge(m, src)
|
|
}
|
|
func (m *Rule_From) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *Rule_From) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Rule_From.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Rule_From proto.InternalMessageInfo
|
|
|
|
func (m *Rule_From) GetSource() *Source {
|
|
if m != nil {
|
|
return m.Source
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// To includes a list or operations.
|
|
type Rule_To struct {
|
|
// Operation specifies the operation of a request.
|
|
Operation *Operation `protobuf:"bytes,1,opt,name=operation,proto3" json:"operation,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *Rule_To) Reset() { *m = Rule_To{} }
|
|
func (m *Rule_To) String() string { return proto.CompactTextString(m) }
|
|
func (*Rule_To) ProtoMessage() {}
|
|
func (*Rule_To) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_b72f4bc212a83269, []int{1, 1}
|
|
}
|
|
func (m *Rule_To) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *Rule_To) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_Rule_To.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalToSizedBuffer(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *Rule_To) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Rule_To.Merge(m, src)
|
|
}
|
|
func (m *Rule_To) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *Rule_To) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Rule_To.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Rule_To proto.InternalMessageInfo
|
|
|
|
func (m *Rule_To) GetOperation() *Operation {
|
|
if m != nil {
|
|
return m.Operation
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// Source specifies the source identities of a request. Fields in the source are
|
|
// ANDed together.
|
|
//
|
|
// For example, the following source matches if the principal is "admin" or "dev"
|
|
// and the namespace is "prod" or "test" and the ip is not "1.2.3.4".
|
|
//
|
|
// ```yaml
|
|
// principals: ["admin", "dev"]
|
|
// namespaces: ["prod", "test"]
|
|
// not_ipblocks: ["1.2.3.4"]
|
|
// ```
|
|
type Source struct {
|
|
// Optional. A list of source peer identities (i.e. service account), which
|
|
// matches to the "source.principal" attribute. This field requires mTLS enabled.
|
|
//
|
|
// If not set, any principal is allowed.
|
|
Principals []string `protobuf:"bytes,1,rep,name=principals,proto3" json:"principals,omitempty"`
|
|
// Optional. A list of negative match of source peer identities.
|
|
NotPrincipals []string `protobuf:"bytes,5,rep,name=not_principals,json=notPrincipals,proto3" json:"not_principals,omitempty"`
|
|
// Optional. A list of request identities (i.e. "iss/sub" claims), which
|
|
// matches to the "request.auth.principal" attribute.
|
|
//
|
|
// If not set, any request principal is allowed.
|
|
RequestPrincipals []string `protobuf:"bytes,2,rep,name=request_principals,json=requestPrincipals,proto3" json:"request_principals,omitempty"`
|
|
// Optional. A list of negative match of request identities.
|
|
NotRequestPrincipals []string `protobuf:"bytes,6,rep,name=not_request_principals,json=notRequestPrincipals,proto3" json:"not_request_principals,omitempty"`
|
|
// Optional. A list of namespaces, which matches to the "source.namespace"
|
|
// attribute. This field requires mTLS enabled.
|
|
//
|
|
// If not set, any namespace is allowed.
|
|
Namespaces []string `protobuf:"bytes,3,rep,name=namespaces,proto3" json:"namespaces,omitempty"`
|
|
// Optional. A list of negative match of namespaces.
|
|
NotNamespaces []string `protobuf:"bytes,7,rep,name=not_namespaces,json=notNamespaces,proto3" json:"not_namespaces,omitempty"`
|
|
// Optional. A list of IP blocks, which matches to the "source.ip" attribute.
|
|
// Single IP (e.g. "1.2.3.4") and CIDR (e.g. "1.2.3.0/24") are supported.
|
|
//
|
|
// If not set, any IP is allowed.
|
|
IpBlocks []string `protobuf:"bytes,4,rep,name=ip_blocks,json=ipBlocks,proto3" json:"ip_blocks,omitempty"`
|
|
// Optional. A list of negative match of IP blocks.
|
|
NotIpBlocks []string `protobuf:"bytes,8,rep,name=not_ip_blocks,json=notIpBlocks,proto3" json:"not_ip_blocks,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *Source) Reset() { *m = Source{} }
|
|
func (m *Source) String() string { return proto.CompactTextString(m) }
|
|
func (*Source) ProtoMessage() {}
|
|
func (*Source) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_b72f4bc212a83269, []int{2}
|
|
}
|
|
func (m *Source) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *Source) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_Source.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalToSizedBuffer(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *Source) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Source.Merge(m, src)
|
|
}
|
|
func (m *Source) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *Source) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Source.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Source proto.InternalMessageInfo
|
|
|
|
func (m *Source) GetPrincipals() []string {
|
|
if m != nil {
|
|
return m.Principals
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Source) GetNotPrincipals() []string {
|
|
if m != nil {
|
|
return m.NotPrincipals
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Source) GetRequestPrincipals() []string {
|
|
if m != nil {
|
|
return m.RequestPrincipals
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Source) GetNotRequestPrincipals() []string {
|
|
if m != nil {
|
|
return m.NotRequestPrincipals
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Source) GetNamespaces() []string {
|
|
if m != nil {
|
|
return m.Namespaces
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Source) GetNotNamespaces() []string {
|
|
if m != nil {
|
|
return m.NotNamespaces
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Source) GetIpBlocks() []string {
|
|
if m != nil {
|
|
return m.IpBlocks
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Source) GetNotIpBlocks() []string {
|
|
if m != nil {
|
|
return m.NotIpBlocks
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// Operation specifies the operations of a request. Fields in the operation are
|
|
// ANDed together.
|
|
//
|
|
// For example, the following operation matches if the host has suffix ".example.com"
|
|
// and the method is "GET" or "HEAD" and the path doesn't have prefix "/admin".
|
|
//
|
|
// ```yaml
|
|
// hosts: ["*.example.com"]
|
|
// methods: ["GET", "HEAD"]
|
|
// not_paths: ["/admin*"]
|
|
// ```
|
|
type Operation struct {
|
|
// Optional. A list of hosts, which matches to the "request.host" attribute.
|
|
//
|
|
// If not set, any host is allowed. Must be used only with HTTP.
|
|
Hosts []string `protobuf:"bytes,1,rep,name=hosts,proto3" json:"hosts,omitempty"`
|
|
// Optional. A list of negative match of hosts.
|
|
NotHosts []string `protobuf:"bytes,5,rep,name=not_hosts,json=notHosts,proto3" json:"not_hosts,omitempty"`
|
|
// Optional. A list of ports, which matches to the "destination.port" attribute.
|
|
//
|
|
// If not set, any port is allowed.
|
|
Ports []string `protobuf:"bytes,2,rep,name=ports,proto3" json:"ports,omitempty"`
|
|
// Optional. A list of negative match of ports.
|
|
NotPorts []string `protobuf:"bytes,6,rep,name=not_ports,json=notPorts,proto3" json:"not_ports,omitempty"`
|
|
// Optional. A list of methods, which matches to the "request.method" attribute.
|
|
// For gRPC service, this will always be "POST".
|
|
//
|
|
// If not set, any method is allowed. Must be used only with HTTP.
|
|
Methods []string `protobuf:"bytes,3,rep,name=methods,proto3" json:"methods,omitempty"`
|
|
// Optional. A list of negative match of methods.
|
|
NotMethods []string `protobuf:"bytes,7,rep,name=not_methods,json=notMethods,proto3" json:"not_methods,omitempty"`
|
|
// Optional. A list of paths, which matches to the "request.url_path" attribute.
|
|
// For gRPC service, this will be the fully-qualified name in the form of
|
|
// "/package.service/method".
|
|
//
|
|
// If not set, any path is allowed. Must be used only with HTTP.
|
|
Paths []string `protobuf:"bytes,4,rep,name=paths,proto3" json:"paths,omitempty"`
|
|
// Optional. A list of negative match of paths.
|
|
NotPaths []string `protobuf:"bytes,8,rep,name=not_paths,json=notPaths,proto3" json:"not_paths,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *Operation) Reset() { *m = Operation{} }
|
|
func (m *Operation) String() string { return proto.CompactTextString(m) }
|
|
func (*Operation) ProtoMessage() {}
|
|
func (*Operation) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_b72f4bc212a83269, []int{3}
|
|
}
|
|
func (m *Operation) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *Operation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_Operation.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalToSizedBuffer(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *Operation) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Operation.Merge(m, src)
|
|
}
|
|
func (m *Operation) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *Operation) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Operation.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Operation proto.InternalMessageInfo
|
|
|
|
func (m *Operation) GetHosts() []string {
|
|
if m != nil {
|
|
return m.Hosts
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Operation) GetNotHosts() []string {
|
|
if m != nil {
|
|
return m.NotHosts
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Operation) GetPorts() []string {
|
|
if m != nil {
|
|
return m.Ports
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Operation) GetNotPorts() []string {
|
|
if m != nil {
|
|
return m.NotPorts
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Operation) GetMethods() []string {
|
|
if m != nil {
|
|
return m.Methods
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Operation) GetNotMethods() []string {
|
|
if m != nil {
|
|
return m.NotMethods
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Operation) GetPaths() []string {
|
|
if m != nil {
|
|
return m.Paths
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Operation) GetNotPaths() []string {
|
|
if m != nil {
|
|
return m.NotPaths
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// Condition specifies additional required attributes.
|
|
type Condition struct {
|
|
// The name of an Istio attribute.
|
|
// See the [full list of supported attributes](https://istio.io/docs/reference/config/security/conditions/).
|
|
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
|
|
// Optional. A list of allowed values for the attribute.
|
|
// Note: at least one of values or not_values must be set.
|
|
Values []string `protobuf:"bytes,2,rep,name=values,proto3" json:"values,omitempty"`
|
|
// Optional. A list of negative match of values for the attribute.
|
|
// Note: at least one of values or not_values must be set.
|
|
NotValues []string `protobuf:"bytes,3,rep,name=not_values,json=notValues,proto3" json:"not_values,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *Condition) Reset() { *m = Condition{} }
|
|
func (m *Condition) String() string { return proto.CompactTextString(m) }
|
|
func (*Condition) ProtoMessage() {}
|
|
func (*Condition) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_b72f4bc212a83269, []int{4}
|
|
}
|
|
func (m *Condition) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *Condition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_Condition.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalToSizedBuffer(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *Condition) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Condition.Merge(m, src)
|
|
}
|
|
func (m *Condition) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *Condition) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Condition.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Condition proto.InternalMessageInfo
|
|
|
|
func (m *Condition) GetKey() string {
|
|
if m != nil {
|
|
return m.Key
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Condition) GetValues() []string {
|
|
if m != nil {
|
|
return m.Values
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Condition) GetNotValues() []string {
|
|
if m != nil {
|
|
return m.NotValues
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterEnum("istio.security.v1beta1.AuthorizationPolicy_Action", AuthorizationPolicy_Action_name, AuthorizationPolicy_Action_value)
|
|
proto.RegisterType((*AuthorizationPolicy)(nil), "istio.security.v1beta1.AuthorizationPolicy")
|
|
proto.RegisterType((*Rule)(nil), "istio.security.v1beta1.Rule")
|
|
proto.RegisterType((*Rule_From)(nil), "istio.security.v1beta1.Rule.From")
|
|
proto.RegisterType((*Rule_To)(nil), "istio.security.v1beta1.Rule.To")
|
|
proto.RegisterType((*Source)(nil), "istio.security.v1beta1.Source")
|
|
proto.RegisterType((*Operation)(nil), "istio.security.v1beta1.Operation")
|
|
proto.RegisterType((*Condition)(nil), "istio.security.v1beta1.Condition")
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterFile("security/v1beta1/authorization.proto", fileDescriptor_b72f4bc212a83269)
|
|
}
|
|
|
|
var fileDescriptor_b72f4bc212a83269 = []byte{
|
|
// 654 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x94, 0xdd, 0x6e, 0xd3, 0x4e,
|
|
0x10, 0xc5, 0xff, 0x76, 0x12, 0x37, 0x9e, 0xea, 0x5f, 0x95, 0xa5, 0x54, 0x51, 0x4a, 0xd3, 0x62,
|
|
0x15, 0xa9, 0x12, 0xc2, 0x51, 0xc3, 0xc7, 0x25, 0x90, 0x42, 0x11, 0xa0, 0xd2, 0x56, 0x6e, 0x45,
|
|
0x55, 0x6e, 0x22, 0xc7, 0xd9, 0x36, 0xab, 0x3a, 0x1e, 0x63, 0xaf, 0x8b, 0xc2, 0x33, 0xf1, 0x08,
|
|
0x3c, 0x00, 0x97, 0xbc, 0x01, 0x55, 0x1f, 0x82, 0x6b, 0xb4, 0x5f, 0x4e, 0x80, 0x36, 0x97, 0xb3,
|
|
0xf3, 0x3b, 0x73, 0xce, 0x8e, 0xad, 0x85, 0x8d, 0x9c, 0x46, 0x45, 0xc6, 0xf8, 0xb8, 0x7d, 0xb1,
|
|
0xd5, 0xa7, 0x3c, 0xdc, 0x6a, 0x87, 0x05, 0x1f, 0x62, 0xc6, 0xbe, 0x84, 0x9c, 0x61, 0xe2, 0xa7,
|
|
0x19, 0x72, 0x24, 0xcb, 0x2c, 0xe7, 0x0c, 0x7d, 0xc3, 0xfa, 0x9a, 0x6d, 0xae, 0x9d, 0x21, 0x9e,
|
|
0xc5, 0xb4, 0x1d, 0xa6, 0xac, 0x7d, 0xca, 0x68, 0x3c, 0xe8, 0xf5, 0xe9, 0x30, 0xbc, 0x60, 0x98,
|
|
0x29, 0x61, 0x73, 0x85, 0x8f, 0x53, 0x5a, 0x8e, 0xce, 0x69, 0x4c, 0x23, 0x6e, 0x9a, 0xde, 0x2f,
|
|
0x0b, 0x6e, 0x77, 0xa7, 0xdd, 0x0e, 0x30, 0x66, 0xd1, 0x98, 0xbc, 0x80, 0xba, 0x21, 0x1b, 0xd6,
|
|
0xba, 0xb5, 0x39, 0xdf, 0xd9, 0xf0, 0x55, 0x00, 0x31, 0xcd, 0x98, 0xfb, 0xc7, 0x98, 0x9d, 0xc7,
|
|
0x18, 0x0e, 0x0e, 0x35, 0x1b, 0x94, 0x2a, 0xd2, 0x81, 0x5a, 0x56, 0xc4, 0x34, 0x6f, 0xd8, 0xeb,
|
|
0x95, 0xcd, 0xf9, 0xce, 0x5d, 0xff, 0xfa, 0xfc, 0x7e, 0x50, 0xc4, 0x34, 0x50, 0x28, 0x79, 0x07,
|
|
0x4e, 0x18, 0x89, 0x14, 0x8d, 0xca, 0xba, 0xb5, 0xb9, 0xd0, 0xe9, 0xdc, 0x24, 0xba, 0x26, 0xb2,
|
|
0xdf, 0x95, 0xca, 0x40, 0x4f, 0xf0, 0x56, 0xc1, 0x51, 0x27, 0xc4, 0x85, 0x5a, 0x77, 0x77, 0x77,
|
|
0xff, 0x78, 0xf1, 0x3f, 0x52, 0x87, 0xea, 0xab, 0x9d, 0xbd, 0x93, 0x45, 0xcb, 0xfb, 0x6a, 0x43,
|
|
0x55, 0x58, 0x93, 0x27, 0x50, 0x3d, 0xcd, 0x70, 0xd4, 0xb0, 0x64, 0xcc, 0x7b, 0xb3, 0x62, 0xfa,
|
|
0xaf, 0x33, 0x1c, 0x05, 0x12, 0x27, 0x6d, 0xb0, 0x39, 0xea, 0xbb, 0xad, 0xcd, 0x14, 0x1d, 0x61,
|
|
0x60, 0x73, 0x14, 0x3e, 0x9f, 0x87, 0x54, 0xdc, 0x6c, 0xa6, 0xcf, 0x4b, 0x4c, 0x06, 0x4c, 0x5e,
|
|
0x44, 0xe2, 0xcd, 0x67, 0x50, 0x15, 0xae, 0xe4, 0x29, 0x38, 0x39, 0x16, 0x59, 0x44, 0xf5, 0xe7,
|
|
0x68, 0xdd, 0x34, 0xe0, 0x50, 0x52, 0x81, 0xa6, 0x9b, 0x3b, 0x60, 0x1f, 0x21, 0x79, 0x0e, 0x2e,
|
|
0xa6, 0x34, 0x93, 0xeb, 0xd2, 0x03, 0x6e, 0x4c, 0xb0, 0x6f, 0xc0, 0x60, 0xa2, 0xf1, 0xbe, 0xd9,
|
|
0xe0, 0xa8, 0xc9, 0xa4, 0x05, 0x90, 0x66, 0x2c, 0x89, 0x58, 0x1a, 0xc6, 0xb9, 0x5c, 0x9b, 0x1b,
|
|
0x4c, 0x9d, 0x90, 0xfb, 0xb0, 0x90, 0x20, 0xef, 0x4d, 0x31, 0x35, 0xc9, 0xfc, 0x9f, 0x20, 0x3f,
|
|
0x98, 0x60, 0x0f, 0x81, 0x64, 0xf4, 0x53, 0x41, 0xf3, 0x3f, 0x50, 0x5b, 0xa2, 0xb7, 0x74, 0x67,
|
|
0x0a, 0x7f, 0x0c, 0xcb, 0x62, 0xea, 0x35, 0x12, 0x47, 0x4a, 0x96, 0x12, 0xe4, 0xc1, 0x3f, 0xaa,
|
|
0x16, 0x40, 0x12, 0x8e, 0x68, 0x9e, 0x86, 0x11, 0xcd, 0xe5, 0xea, 0xdd, 0x60, 0xea, 0xc4, 0x64,
|
|
0x9d, 0x62, 0xe6, 0xca, 0xac, 0x7b, 0x13, 0x6c, 0x05, 0x5c, 0x96, 0xf6, 0xfa, 0x31, 0x46, 0xe7,
|
|
0x79, 0xa3, 0x2a, 0x89, 0x3a, 0x4b, 0xb7, 0x65, 0x4d, 0x3c, 0x10, 0x74, 0x6f, 0x02, 0xd4, 0x25,
|
|
0x30, 0x9f, 0x20, 0x7f, 0xab, 0x19, 0xef, 0xa7, 0x05, 0x6e, 0xb9, 0x57, 0xb2, 0x04, 0xb5, 0x21,
|
|
0xe6, 0xdc, 0x2c, 0x4f, 0x15, 0xc2, 0x44, 0xcc, 0x51, 0x1d, 0xb5, 0xb2, 0x7a, 0x82, 0xfc, 0x8d,
|
|
0x6c, 0x2e, 0x41, 0x2d, 0xc5, 0x8c, 0x9b, 0x05, 0xa9, 0xc2, 0x48, 0x54, 0xc7, 0x29, 0x25, 0x07,
|
|
0xb2, 0xd9, 0x80, 0xb9, 0x11, 0xe5, 0x43, 0x1c, 0x98, 0x8b, 0x9b, 0x92, 0xac, 0x81, 0x08, 0xd7,
|
|
0x33, 0xdd, 0x39, 0xbd, 0x16, 0xe4, 0xef, 0x35, 0x20, 0xdc, 0x42, 0x3e, 0x34, 0x77, 0x55, 0x45,
|
|
0xe9, 0x26, 0x3b, 0xf5, 0x89, 0x9b, 0xa8, 0xbd, 0x13, 0x70, 0xcb, 0x5f, 0x97, 0xdc, 0x81, 0xca,
|
|
0x39, 0x1d, 0xcb, 0x1f, 0xcd, 0xdd, 0xae, 0x5c, 0x76, 0xed, 0x40, 0xd4, 0x64, 0x19, 0x9c, 0x8b,
|
|
0x30, 0x2e, 0xa8, 0xb9, 0x85, 0xae, 0xc8, 0x2a, 0x08, 0xf3, 0x9e, 0xee, 0xa9, 0xb0, 0xc2, 0xea,
|
|
0x83, 0x3c, 0xd8, 0x7e, 0xf0, 0xfd, 0xaa, 0x65, 0xfd, 0xb8, 0x6a, 0x59, 0x97, 0x57, 0x2d, 0xeb,
|
|
0xe3, 0xaa, 0xfa, 0x6d, 0x19, 0xca, 0x17, 0xef, 0xef, 0xa7, 0xb3, 0xef, 0xc8, 0x77, 0xed, 0xd1,
|
|
0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x59, 0x1f, 0xf3, 0xa8, 0x55, 0x05, 0x00, 0x00,
|
|
}
|
|
|
|
func (m *AuthorizationPolicy) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *AuthorizationPolicy) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *AuthorizationPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.XXX_unrecognized != nil {
|
|
i -= len(m.XXX_unrecognized)
|
|
copy(dAtA[i:], m.XXX_unrecognized)
|
|
}
|
|
if m.Action != 0 {
|
|
i = encodeVarintAuthorization(dAtA, i, uint64(m.Action))
|
|
i--
|
|
dAtA[i] = 0x18
|
|
}
|
|
if len(m.Rules) > 0 {
|
|
for iNdEx := len(m.Rules) - 1; iNdEx >= 0; iNdEx-- {
|
|
{
|
|
size, err := m.Rules[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintAuthorization(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0x12
|
|
}
|
|
}
|
|
if m.Selector != nil {
|
|
{
|
|
size, err := m.Selector.MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintAuthorization(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *Rule) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *Rule) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *Rule) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.XXX_unrecognized != nil {
|
|
i -= len(m.XXX_unrecognized)
|
|
copy(dAtA[i:], m.XXX_unrecognized)
|
|
}
|
|
if len(m.When) > 0 {
|
|
for iNdEx := len(m.When) - 1; iNdEx >= 0; iNdEx-- {
|
|
{
|
|
size, err := m.When[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintAuthorization(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0x1a
|
|
}
|
|
}
|
|
if len(m.To) > 0 {
|
|
for iNdEx := len(m.To) - 1; iNdEx >= 0; iNdEx-- {
|
|
{
|
|
size, err := m.To[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintAuthorization(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0x12
|
|
}
|
|
}
|
|
if len(m.From) > 0 {
|
|
for iNdEx := len(m.From) - 1; iNdEx >= 0; iNdEx-- {
|
|
{
|
|
size, err := m.From[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintAuthorization(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *Rule_From) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *Rule_From) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *Rule_From) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.XXX_unrecognized != nil {
|
|
i -= len(m.XXX_unrecognized)
|
|
copy(dAtA[i:], m.XXX_unrecognized)
|
|
}
|
|
if m.Source != nil {
|
|
{
|
|
size, err := m.Source.MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintAuthorization(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *Rule_To) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *Rule_To) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *Rule_To) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.XXX_unrecognized != nil {
|
|
i -= len(m.XXX_unrecognized)
|
|
copy(dAtA[i:], m.XXX_unrecognized)
|
|
}
|
|
if m.Operation != nil {
|
|
{
|
|
size, err := m.Operation.MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintAuthorization(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *Source) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *Source) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *Source) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.XXX_unrecognized != nil {
|
|
i -= len(m.XXX_unrecognized)
|
|
copy(dAtA[i:], m.XXX_unrecognized)
|
|
}
|
|
if len(m.NotIpBlocks) > 0 {
|
|
for iNdEx := len(m.NotIpBlocks) - 1; iNdEx >= 0; iNdEx-- {
|
|
i -= len(m.NotIpBlocks[iNdEx])
|
|
copy(dAtA[i:], m.NotIpBlocks[iNdEx])
|
|
i = encodeVarintAuthorization(dAtA, i, uint64(len(m.NotIpBlocks[iNdEx])))
|
|
i--
|
|
dAtA[i] = 0x42
|
|
}
|
|
}
|
|
if len(m.NotNamespaces) > 0 {
|
|
for iNdEx := len(m.NotNamespaces) - 1; iNdEx >= 0; iNdEx-- {
|
|
i -= len(m.NotNamespaces[iNdEx])
|
|
copy(dAtA[i:], m.NotNamespaces[iNdEx])
|
|
i = encodeVarintAuthorization(dAtA, i, uint64(len(m.NotNamespaces[iNdEx])))
|
|
i--
|
|
dAtA[i] = 0x3a
|
|
}
|
|
}
|
|
if len(m.NotRequestPrincipals) > 0 {
|
|
for iNdEx := len(m.NotRequestPrincipals) - 1; iNdEx >= 0; iNdEx-- {
|
|
i -= len(m.NotRequestPrincipals[iNdEx])
|
|
copy(dAtA[i:], m.NotRequestPrincipals[iNdEx])
|
|
i = encodeVarintAuthorization(dAtA, i, uint64(len(m.NotRequestPrincipals[iNdEx])))
|
|
i--
|
|
dAtA[i] = 0x32
|
|
}
|
|
}
|
|
if len(m.NotPrincipals) > 0 {
|
|
for iNdEx := len(m.NotPrincipals) - 1; iNdEx >= 0; iNdEx-- {
|
|
i -= len(m.NotPrincipals[iNdEx])
|
|
copy(dAtA[i:], m.NotPrincipals[iNdEx])
|
|
i = encodeVarintAuthorization(dAtA, i, uint64(len(m.NotPrincipals[iNdEx])))
|
|
i--
|
|
dAtA[i] = 0x2a
|
|
}
|
|
}
|
|
if len(m.IpBlocks) > 0 {
|
|
for iNdEx := len(m.IpBlocks) - 1; iNdEx >= 0; iNdEx-- {
|
|
i -= len(m.IpBlocks[iNdEx])
|
|
copy(dAtA[i:], m.IpBlocks[iNdEx])
|
|
i = encodeVarintAuthorization(dAtA, i, uint64(len(m.IpBlocks[iNdEx])))
|
|
i--
|
|
dAtA[i] = 0x22
|
|
}
|
|
}
|
|
if len(m.Namespaces) > 0 {
|
|
for iNdEx := len(m.Namespaces) - 1; iNdEx >= 0; iNdEx-- {
|
|
i -= len(m.Namespaces[iNdEx])
|
|
copy(dAtA[i:], m.Namespaces[iNdEx])
|
|
i = encodeVarintAuthorization(dAtA, i, uint64(len(m.Namespaces[iNdEx])))
|
|
i--
|
|
dAtA[i] = 0x1a
|
|
}
|
|
}
|
|
if len(m.RequestPrincipals) > 0 {
|
|
for iNdEx := len(m.RequestPrincipals) - 1; iNdEx >= 0; iNdEx-- {
|
|
i -= len(m.RequestPrincipals[iNdEx])
|
|
copy(dAtA[i:], m.RequestPrincipals[iNdEx])
|
|
i = encodeVarintAuthorization(dAtA, i, uint64(len(m.RequestPrincipals[iNdEx])))
|
|
i--
|
|
dAtA[i] = 0x12
|
|
}
|
|
}
|
|
if len(m.Principals) > 0 {
|
|
for iNdEx := len(m.Principals) - 1; iNdEx >= 0; iNdEx-- {
|
|
i -= len(m.Principals[iNdEx])
|
|
copy(dAtA[i:], m.Principals[iNdEx])
|
|
i = encodeVarintAuthorization(dAtA, i, uint64(len(m.Principals[iNdEx])))
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *Operation) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *Operation) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *Operation) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.XXX_unrecognized != nil {
|
|
i -= len(m.XXX_unrecognized)
|
|
copy(dAtA[i:], m.XXX_unrecognized)
|
|
}
|
|
if len(m.NotPaths) > 0 {
|
|
for iNdEx := len(m.NotPaths) - 1; iNdEx >= 0; iNdEx-- {
|
|
i -= len(m.NotPaths[iNdEx])
|
|
copy(dAtA[i:], m.NotPaths[iNdEx])
|
|
i = encodeVarintAuthorization(dAtA, i, uint64(len(m.NotPaths[iNdEx])))
|
|
i--
|
|
dAtA[i] = 0x42
|
|
}
|
|
}
|
|
if len(m.NotMethods) > 0 {
|
|
for iNdEx := len(m.NotMethods) - 1; iNdEx >= 0; iNdEx-- {
|
|
i -= len(m.NotMethods[iNdEx])
|
|
copy(dAtA[i:], m.NotMethods[iNdEx])
|
|
i = encodeVarintAuthorization(dAtA, i, uint64(len(m.NotMethods[iNdEx])))
|
|
i--
|
|
dAtA[i] = 0x3a
|
|
}
|
|
}
|
|
if len(m.NotPorts) > 0 {
|
|
for iNdEx := len(m.NotPorts) - 1; iNdEx >= 0; iNdEx-- {
|
|
i -= len(m.NotPorts[iNdEx])
|
|
copy(dAtA[i:], m.NotPorts[iNdEx])
|
|
i = encodeVarintAuthorization(dAtA, i, uint64(len(m.NotPorts[iNdEx])))
|
|
i--
|
|
dAtA[i] = 0x32
|
|
}
|
|
}
|
|
if len(m.NotHosts) > 0 {
|
|
for iNdEx := len(m.NotHosts) - 1; iNdEx >= 0; iNdEx-- {
|
|
i -= len(m.NotHosts[iNdEx])
|
|
copy(dAtA[i:], m.NotHosts[iNdEx])
|
|
i = encodeVarintAuthorization(dAtA, i, uint64(len(m.NotHosts[iNdEx])))
|
|
i--
|
|
dAtA[i] = 0x2a
|
|
}
|
|
}
|
|
if len(m.Paths) > 0 {
|
|
for iNdEx := len(m.Paths) - 1; iNdEx >= 0; iNdEx-- {
|
|
i -= len(m.Paths[iNdEx])
|
|
copy(dAtA[i:], m.Paths[iNdEx])
|
|
i = encodeVarintAuthorization(dAtA, i, uint64(len(m.Paths[iNdEx])))
|
|
i--
|
|
dAtA[i] = 0x22
|
|
}
|
|
}
|
|
if len(m.Methods) > 0 {
|
|
for iNdEx := len(m.Methods) - 1; iNdEx >= 0; iNdEx-- {
|
|
i -= len(m.Methods[iNdEx])
|
|
copy(dAtA[i:], m.Methods[iNdEx])
|
|
i = encodeVarintAuthorization(dAtA, i, uint64(len(m.Methods[iNdEx])))
|
|
i--
|
|
dAtA[i] = 0x1a
|
|
}
|
|
}
|
|
if len(m.Ports) > 0 {
|
|
for iNdEx := len(m.Ports) - 1; iNdEx >= 0; iNdEx-- {
|
|
i -= len(m.Ports[iNdEx])
|
|
copy(dAtA[i:], m.Ports[iNdEx])
|
|
i = encodeVarintAuthorization(dAtA, i, uint64(len(m.Ports[iNdEx])))
|
|
i--
|
|
dAtA[i] = 0x12
|
|
}
|
|
}
|
|
if len(m.Hosts) > 0 {
|
|
for iNdEx := len(m.Hosts) - 1; iNdEx >= 0; iNdEx-- {
|
|
i -= len(m.Hosts[iNdEx])
|
|
copy(dAtA[i:], m.Hosts[iNdEx])
|
|
i = encodeVarintAuthorization(dAtA, i, uint64(len(m.Hosts[iNdEx])))
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *Condition) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *Condition) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *Condition) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.XXX_unrecognized != nil {
|
|
i -= len(m.XXX_unrecognized)
|
|
copy(dAtA[i:], m.XXX_unrecognized)
|
|
}
|
|
if len(m.NotValues) > 0 {
|
|
for iNdEx := len(m.NotValues) - 1; iNdEx >= 0; iNdEx-- {
|
|
i -= len(m.NotValues[iNdEx])
|
|
copy(dAtA[i:], m.NotValues[iNdEx])
|
|
i = encodeVarintAuthorization(dAtA, i, uint64(len(m.NotValues[iNdEx])))
|
|
i--
|
|
dAtA[i] = 0x1a
|
|
}
|
|
}
|
|
if len(m.Values) > 0 {
|
|
for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- {
|
|
i -= len(m.Values[iNdEx])
|
|
copy(dAtA[i:], m.Values[iNdEx])
|
|
i = encodeVarintAuthorization(dAtA, i, uint64(len(m.Values[iNdEx])))
|
|
i--
|
|
dAtA[i] = 0x12
|
|
}
|
|
}
|
|
if len(m.Key) > 0 {
|
|
i -= len(m.Key)
|
|
copy(dAtA[i:], m.Key)
|
|
i = encodeVarintAuthorization(dAtA, i, uint64(len(m.Key)))
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func encodeVarintAuthorization(dAtA []byte, offset int, v uint64) int {
|
|
offset -= sovAuthorization(v)
|
|
base := offset
|
|
for v >= 1<<7 {
|
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
|
v >>= 7
|
|
offset++
|
|
}
|
|
dAtA[offset] = uint8(v)
|
|
return base
|
|
}
|
|
func (m *AuthorizationPolicy) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if m.Selector != nil {
|
|
l = m.Selector.Size()
|
|
n += 1 + l + sovAuthorization(uint64(l))
|
|
}
|
|
if len(m.Rules) > 0 {
|
|
for _, e := range m.Rules {
|
|
l = e.Size()
|
|
n += 1 + l + sovAuthorization(uint64(l))
|
|
}
|
|
}
|
|
if m.Action != 0 {
|
|
n += 1 + sovAuthorization(uint64(m.Action))
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
n += len(m.XXX_unrecognized)
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *Rule) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if len(m.From) > 0 {
|
|
for _, e := range m.From {
|
|
l = e.Size()
|
|
n += 1 + l + sovAuthorization(uint64(l))
|
|
}
|
|
}
|
|
if len(m.To) > 0 {
|
|
for _, e := range m.To {
|
|
l = e.Size()
|
|
n += 1 + l + sovAuthorization(uint64(l))
|
|
}
|
|
}
|
|
if len(m.When) > 0 {
|
|
for _, e := range m.When {
|
|
l = e.Size()
|
|
n += 1 + l + sovAuthorization(uint64(l))
|
|
}
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
n += len(m.XXX_unrecognized)
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *Rule_From) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if m.Source != nil {
|
|
l = m.Source.Size()
|
|
n += 1 + l + sovAuthorization(uint64(l))
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
n += len(m.XXX_unrecognized)
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *Rule_To) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if m.Operation != nil {
|
|
l = m.Operation.Size()
|
|
n += 1 + l + sovAuthorization(uint64(l))
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
n += len(m.XXX_unrecognized)
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *Source) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if len(m.Principals) > 0 {
|
|
for _, s := range m.Principals {
|
|
l = len(s)
|
|
n += 1 + l + sovAuthorization(uint64(l))
|
|
}
|
|
}
|
|
if len(m.RequestPrincipals) > 0 {
|
|
for _, s := range m.RequestPrincipals {
|
|
l = len(s)
|
|
n += 1 + l + sovAuthorization(uint64(l))
|
|
}
|
|
}
|
|
if len(m.Namespaces) > 0 {
|
|
for _, s := range m.Namespaces {
|
|
l = len(s)
|
|
n += 1 + l + sovAuthorization(uint64(l))
|
|
}
|
|
}
|
|
if len(m.IpBlocks) > 0 {
|
|
for _, s := range m.IpBlocks {
|
|
l = len(s)
|
|
n += 1 + l + sovAuthorization(uint64(l))
|
|
}
|
|
}
|
|
if len(m.NotPrincipals) > 0 {
|
|
for _, s := range m.NotPrincipals {
|
|
l = len(s)
|
|
n += 1 + l + sovAuthorization(uint64(l))
|
|
}
|
|
}
|
|
if len(m.NotRequestPrincipals) > 0 {
|
|
for _, s := range m.NotRequestPrincipals {
|
|
l = len(s)
|
|
n += 1 + l + sovAuthorization(uint64(l))
|
|
}
|
|
}
|
|
if len(m.NotNamespaces) > 0 {
|
|
for _, s := range m.NotNamespaces {
|
|
l = len(s)
|
|
n += 1 + l + sovAuthorization(uint64(l))
|
|
}
|
|
}
|
|
if len(m.NotIpBlocks) > 0 {
|
|
for _, s := range m.NotIpBlocks {
|
|
l = len(s)
|
|
n += 1 + l + sovAuthorization(uint64(l))
|
|
}
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
n += len(m.XXX_unrecognized)
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *Operation) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if len(m.Hosts) > 0 {
|
|
for _, s := range m.Hosts {
|
|
l = len(s)
|
|
n += 1 + l + sovAuthorization(uint64(l))
|
|
}
|
|
}
|
|
if len(m.Ports) > 0 {
|
|
for _, s := range m.Ports {
|
|
l = len(s)
|
|
n += 1 + l + sovAuthorization(uint64(l))
|
|
}
|
|
}
|
|
if len(m.Methods) > 0 {
|
|
for _, s := range m.Methods {
|
|
l = len(s)
|
|
n += 1 + l + sovAuthorization(uint64(l))
|
|
}
|
|
}
|
|
if len(m.Paths) > 0 {
|
|
for _, s := range m.Paths {
|
|
l = len(s)
|
|
n += 1 + l + sovAuthorization(uint64(l))
|
|
}
|
|
}
|
|
if len(m.NotHosts) > 0 {
|
|
for _, s := range m.NotHosts {
|
|
l = len(s)
|
|
n += 1 + l + sovAuthorization(uint64(l))
|
|
}
|
|
}
|
|
if len(m.NotPorts) > 0 {
|
|
for _, s := range m.NotPorts {
|
|
l = len(s)
|
|
n += 1 + l + sovAuthorization(uint64(l))
|
|
}
|
|
}
|
|
if len(m.NotMethods) > 0 {
|
|
for _, s := range m.NotMethods {
|
|
l = len(s)
|
|
n += 1 + l + sovAuthorization(uint64(l))
|
|
}
|
|
}
|
|
if len(m.NotPaths) > 0 {
|
|
for _, s := range m.NotPaths {
|
|
l = len(s)
|
|
n += 1 + l + sovAuthorization(uint64(l))
|
|
}
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
n += len(m.XXX_unrecognized)
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *Condition) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
l = len(m.Key)
|
|
if l > 0 {
|
|
n += 1 + l + sovAuthorization(uint64(l))
|
|
}
|
|
if len(m.Values) > 0 {
|
|
for _, s := range m.Values {
|
|
l = len(s)
|
|
n += 1 + l + sovAuthorization(uint64(l))
|
|
}
|
|
}
|
|
if len(m.NotValues) > 0 {
|
|
for _, s := range m.NotValues {
|
|
l = len(s)
|
|
n += 1 + l + sovAuthorization(uint64(l))
|
|
}
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
n += len(m.XXX_unrecognized)
|
|
}
|
|
return n
|
|
}
|
|
|
|
func sovAuthorization(x uint64) (n int) {
|
|
return (math_bits.Len64(x|1) + 6) / 7
|
|
}
|
|
func sozAuthorization(x uint64) (n int) {
|
|
return sovAuthorization(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
}
|
|
func (m *AuthorizationPolicy) Unmarshal(dAtA []byte) error {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
wire |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
if wireType == 4 {
|
|
return fmt.Errorf("proto: AuthorizationPolicy: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: AuthorizationPolicy: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.Selector == nil {
|
|
m.Selector = &v1beta1.WorkloadSelector{}
|
|
}
|
|
if err := m.Selector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Rules", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Rules = append(m.Rules, &Rule{})
|
|
if err := m.Rules[len(m.Rules)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
case 3:
|
|
if wireType != 0 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType)
|
|
}
|
|
m.Action = 0
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
m.Action |= AuthorizationPolicy_Action(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipAuthorization(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *Rule) Unmarshal(dAtA []byte) error {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
wire |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
if wireType == 4 {
|
|
return fmt.Errorf("proto: Rule: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: Rule: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field From", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.From = append(m.From, &Rule_From{})
|
|
if err := m.From[len(m.From)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field To", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.To = append(m.To, &Rule_To{})
|
|
if err := m.To[len(m.To)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
case 3:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field When", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.When = append(m.When, &Condition{})
|
|
if err := m.When[len(m.When)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipAuthorization(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *Rule_From) Unmarshal(dAtA []byte) error {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
wire |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
if wireType == 4 {
|
|
return fmt.Errorf("proto: From: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: From: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.Source == nil {
|
|
m.Source = &Source{}
|
|
}
|
|
if err := m.Source.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipAuthorization(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *Rule_To) Unmarshal(dAtA []byte) error {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
wire |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
if wireType == 4 {
|
|
return fmt.Errorf("proto: To: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: To: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Operation", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.Operation == nil {
|
|
m.Operation = &Operation{}
|
|
}
|
|
if err := m.Operation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipAuthorization(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *Source) Unmarshal(dAtA []byte) error {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
wire |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
if wireType == 4 {
|
|
return fmt.Errorf("proto: Source: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: Source: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Principals", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Principals = append(m.Principals, string(dAtA[iNdEx:postIndex]))
|
|
iNdEx = postIndex
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field RequestPrincipals", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.RequestPrincipals = append(m.RequestPrincipals, string(dAtA[iNdEx:postIndex]))
|
|
iNdEx = postIndex
|
|
case 3:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Namespaces", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Namespaces = append(m.Namespaces, string(dAtA[iNdEx:postIndex]))
|
|
iNdEx = postIndex
|
|
case 4:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field IpBlocks", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.IpBlocks = append(m.IpBlocks, string(dAtA[iNdEx:postIndex]))
|
|
iNdEx = postIndex
|
|
case 5:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field NotPrincipals", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.NotPrincipals = append(m.NotPrincipals, string(dAtA[iNdEx:postIndex]))
|
|
iNdEx = postIndex
|
|
case 6:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field NotRequestPrincipals", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.NotRequestPrincipals = append(m.NotRequestPrincipals, string(dAtA[iNdEx:postIndex]))
|
|
iNdEx = postIndex
|
|
case 7:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field NotNamespaces", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.NotNamespaces = append(m.NotNamespaces, string(dAtA[iNdEx:postIndex]))
|
|
iNdEx = postIndex
|
|
case 8:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field NotIpBlocks", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.NotIpBlocks = append(m.NotIpBlocks, string(dAtA[iNdEx:postIndex]))
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipAuthorization(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *Operation) Unmarshal(dAtA []byte) error {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
wire |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
if wireType == 4 {
|
|
return fmt.Errorf("proto: Operation: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: Operation: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Hosts", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Hosts = append(m.Hosts, string(dAtA[iNdEx:postIndex]))
|
|
iNdEx = postIndex
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Ports", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Ports = append(m.Ports, string(dAtA[iNdEx:postIndex]))
|
|
iNdEx = postIndex
|
|
case 3:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Methods", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Methods = append(m.Methods, string(dAtA[iNdEx:postIndex]))
|
|
iNdEx = postIndex
|
|
case 4:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Paths", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Paths = append(m.Paths, string(dAtA[iNdEx:postIndex]))
|
|
iNdEx = postIndex
|
|
case 5:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field NotHosts", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.NotHosts = append(m.NotHosts, string(dAtA[iNdEx:postIndex]))
|
|
iNdEx = postIndex
|
|
case 6:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field NotPorts", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.NotPorts = append(m.NotPorts, string(dAtA[iNdEx:postIndex]))
|
|
iNdEx = postIndex
|
|
case 7:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field NotMethods", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.NotMethods = append(m.NotMethods, string(dAtA[iNdEx:postIndex]))
|
|
iNdEx = postIndex
|
|
case 8:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field NotPaths", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.NotPaths = append(m.NotPaths, string(dAtA[iNdEx:postIndex]))
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipAuthorization(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *Condition) Unmarshal(dAtA []byte) error {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
preIndex := iNdEx
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
wire |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
if wireType == 4 {
|
|
return fmt.Errorf("proto: Condition: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: Condition: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Key = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Values = append(m.Values, string(dAtA[iNdEx:postIndex]))
|
|
iNdEx = postIndex
|
|
case 3:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field NotValues", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.NotValues = append(m.NotValues, string(dAtA[iNdEx:postIndex]))
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipAuthorization(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthAuthorization
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func skipAuthorization(dAtA []byte) (n int, err error) {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return 0, ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
wireType := int(wire & 0x7)
|
|
switch wireType {
|
|
case 0:
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return 0, ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx++
|
|
if dAtA[iNdEx-1] < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
return iNdEx, nil
|
|
case 1:
|
|
iNdEx += 8
|
|
return iNdEx, nil
|
|
case 2:
|
|
var length int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return 0, ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
length |= (int(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if length < 0 {
|
|
return 0, ErrInvalidLengthAuthorization
|
|
}
|
|
iNdEx += length
|
|
if iNdEx < 0 {
|
|
return 0, ErrInvalidLengthAuthorization
|
|
}
|
|
return iNdEx, nil
|
|
case 3:
|
|
for {
|
|
var innerWire uint64
|
|
var start int = iNdEx
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return 0, ErrIntOverflowAuthorization
|
|
}
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
innerWire |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
innerWireType := int(innerWire & 0x7)
|
|
if innerWireType == 4 {
|
|
break
|
|
}
|
|
next, err := skipAuthorization(dAtA[start:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
iNdEx = start + next
|
|
if iNdEx < 0 {
|
|
return 0, ErrInvalidLengthAuthorization
|
|
}
|
|
}
|
|
return iNdEx, nil
|
|
case 4:
|
|
return iNdEx, nil
|
|
case 5:
|
|
iNdEx += 4
|
|
return iNdEx, nil
|
|
default:
|
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
}
|
|
}
|
|
panic("unreachable")
|
|
}
|
|
|
|
var (
|
|
ErrInvalidLengthAuthorization = fmt.Errorf("proto: negative length found during unmarshaling")
|
|
ErrIntOverflowAuthorization = fmt.Errorf("proto: integer overflow")
|
|
)
|