authorize

package
v0.0.0-...-af18c7d Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FileRule_Overloads_Type_Primitive_name = map[int32]string{
		0:  "PRIMITIVE_UNSPECIFIED",
		1:  "BOOL",
		2:  "INT",
		3:  "UINT",
		4:  "DOUBLE",
		5:  "BYTES",
		6:  "STRING",
		7:  "DURATION",
		8:  "TIMESTAMP",
		9:  "ERROR",
		10: "DYN",
		11: "ANY",
	}
	FileRule_Overloads_Type_Primitive_value = map[string]int32{
		"PRIMITIVE_UNSPECIFIED": 0,
		"BOOL":                  1,
		"INT":                   2,
		"UINT":                  3,
		"DOUBLE":                4,
		"BYTES":                 5,
		"STRING":                6,
		"DURATION":              7,
		"TIMESTAMP":             8,
		"ERROR":                 9,
		"DYN":                   10,
		"ANY":                   11,
	}
)

Enum value maps for FileRule_Overloads_Type_Primitive.

View Source
var (
	// optional authorize.FileRule file = 1145;
	E_File = &file_authorize_authz_proto_extTypes[0]
)

Extension fields to descriptorpb.FileOptions.

View Source
var (
	// optional authorize.MethodRule method = 1145;
	E_Method = &file_authorize_authz_proto_extTypes[1]
)

Extension fields to descriptorpb.MethodOptions.

View Source
var File_authorize_authz_proto protoreflect.FileDescriptor

Functions

func BuildAuthzProgram

func BuildAuthzProgram(expr string, msg proto.Message, config *FileRule, libs ...cel.Library) (cel.Program, error)

func BuildAuthzProgramFromDesc

func BuildAuthzProgramFromDesc(expr string, imports []protoreflect.FileDescriptor, msgDesc protoreflect.MessageDescriptor, config *FileRule, libs ...cel.Library) (cel.Program, error)

func BuildMacroExpander

func BuildMacroExpander(ast *cel.Ast) parser.MacroExpander

func BuildRuntimeLibrary

func BuildRuntimeLibrary(config *FileRule, opts ...Options) cel.Library

func FindMacros

func FindMacros(config *FileRule, opts []cel.EnvOption, expr string) ([]string, error)

func TypeFromOverloadType

func TypeFromOverloadType(t *FileRule_Overloads_Type) *v1alpha1.Type

Types

type AuthzInterceptor

type AuthzInterceptor interface {
	Authorize(ctx context.Context, method string, headers http.Header, request interface{}) error
}

func NewAuthzInterceptor

func NewAuthzInterceptor(methodProgramMapping map[string]cel.Program) AuthzInterceptor

type FileRule

type FileRule struct {
	Globals   *FileRule_Globals      `protobuf:"bytes,1,opt,name=globals,proto3" json:"globals,omitempty"`
	Rules     map[string]*MethodRule `` /* 151-byte string literal not displayed */
	Overloads *FileRule_Overloads    `protobuf:"bytes,3,opt,name=overloads,proto3" json:"overloads,omitempty"`
	// contains filtered or unexported fields
}

func (*FileRule) Descriptor deprecated

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

Deprecated: Use FileRule.ProtoReflect.Descriptor instead.

func (*FileRule) GetGlobals

func (x *FileRule) GetGlobals() *FileRule_Globals

func (*FileRule) GetOverloads

func (x *FileRule) GetOverloads() *FileRule_Overloads

func (*FileRule) GetRules

func (x *FileRule) GetRules() map[string]*MethodRule

func (*FileRule) ProtoMessage

func (*FileRule) ProtoMessage()

func (*FileRule) ProtoReflect

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

func (*FileRule) Reset

func (x *FileRule) Reset()

func (*FileRule) String

func (x *FileRule) String() string

type FileRule_Globals

type FileRule_Globals struct {
	Functions map[string]string `` /* 159-byte string literal not displayed */
	Constants map[string]string `` /* 159-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*FileRule_Globals) Descriptor deprecated

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

Deprecated: Use FileRule_Globals.ProtoReflect.Descriptor instead.

func (*FileRule_Globals) GetConstants

func (x *FileRule_Globals) GetConstants() map[string]string

func (*FileRule_Globals) GetFunctions

func (x *FileRule_Globals) GetFunctions() map[string]string

func (*FileRule_Globals) ProtoMessage

func (*FileRule_Globals) ProtoMessage()

func (*FileRule_Globals) ProtoReflect

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

func (*FileRule_Globals) Reset

func (x *FileRule_Globals) Reset()

func (*FileRule_Globals) String

func (x *FileRule_Globals) String() string

type FileRule_Overloads

type FileRule_Overloads struct {
	Functions map[string]*FileRule_Overloads_Function `` /* 159-byte string literal not displayed */
	Variables map[string]*FileRule_Overloads_Type     `` /* 159-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*FileRule_Overloads) Descriptor deprecated

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

Deprecated: Use FileRule_Overloads.ProtoReflect.Descriptor instead.

func (*FileRule_Overloads) GetFunctions

func (x *FileRule_Overloads) GetFunctions() map[string]*FileRule_Overloads_Function

func (*FileRule_Overloads) GetVariables

func (x *FileRule_Overloads) GetVariables() map[string]*FileRule_Overloads_Type

func (*FileRule_Overloads) ProtoMessage

func (*FileRule_Overloads) ProtoMessage()

func (*FileRule_Overloads) ProtoReflect

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

func (*FileRule_Overloads) Reset

func (x *FileRule_Overloads) Reset()

func (*FileRule_Overloads) String

func (x *FileRule_Overloads) String() string

type FileRule_Overloads_Function

type FileRule_Overloads_Function struct {
	Args   []*FileRule_Overloads_Type `protobuf:"bytes,1,rep,name=args,proto3" json:"args,omitempty"`
	Result *FileRule_Overloads_Type   `protobuf:"bytes,2,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*FileRule_Overloads_Function) Descriptor deprecated

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

Deprecated: Use FileRule_Overloads_Function.ProtoReflect.Descriptor instead.

func (*FileRule_Overloads_Function) GetArgs

func (*FileRule_Overloads_Function) GetResult

func (*FileRule_Overloads_Function) ProtoMessage

func (*FileRule_Overloads_Function) ProtoMessage()

func (*FileRule_Overloads_Function) ProtoReflect

func (*FileRule_Overloads_Function) Reset

func (x *FileRule_Overloads_Function) Reset()

func (*FileRule_Overloads_Function) String

func (x *FileRule_Overloads_Function) String() string

type FileRule_Overloads_Type

type FileRule_Overloads_Type struct {

	// Types that are assignable to Type:
	//	*FileRule_Overloads_Type_Primitive_
	//	*FileRule_Overloads_Type_Object
	//	*FileRule_Overloads_Type_Array_
	//	*FileRule_Overloads_Type_Map_
	Type isFileRule_Overloads_Type_Type `protobuf_oneof:"type"`
	// contains filtered or unexported fields
}

func (*FileRule_Overloads_Type) Descriptor deprecated

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

Deprecated: Use FileRule_Overloads_Type.ProtoReflect.Descriptor instead.

func (*FileRule_Overloads_Type) GetArray

func (*FileRule_Overloads_Type) GetMap

func (*FileRule_Overloads_Type) GetObject

func (x *FileRule_Overloads_Type) GetObject() string

func (*FileRule_Overloads_Type) GetPrimitive

func (*FileRule_Overloads_Type) GetType

func (m *FileRule_Overloads_Type) GetType() isFileRule_Overloads_Type_Type

func (*FileRule_Overloads_Type) ProtoMessage

func (*FileRule_Overloads_Type) ProtoMessage()

func (*FileRule_Overloads_Type) ProtoReflect

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

func (*FileRule_Overloads_Type) Reset

func (x *FileRule_Overloads_Type) Reset()

func (*FileRule_Overloads_Type) String

func (x *FileRule_Overloads_Type) String() string

type FileRule_Overloads_Type_Array

type FileRule_Overloads_Type_Array struct {
	Type *FileRule_Overloads_Type `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	// contains filtered or unexported fields
}

func (*FileRule_Overloads_Type_Array) Descriptor deprecated

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

Deprecated: Use FileRule_Overloads_Type_Array.ProtoReflect.Descriptor instead.

func (*FileRule_Overloads_Type_Array) GetType

func (*FileRule_Overloads_Type_Array) ProtoMessage

func (*FileRule_Overloads_Type_Array) ProtoMessage()

func (*FileRule_Overloads_Type_Array) ProtoReflect

func (*FileRule_Overloads_Type_Array) Reset

func (x *FileRule_Overloads_Type_Array) Reset()

func (*FileRule_Overloads_Type_Array) String

type FileRule_Overloads_Type_Array_

type FileRule_Overloads_Type_Array_ struct {
	Array *FileRule_Overloads_Type_Array `protobuf:"bytes,3,opt,name=array,proto3,oneof"`
}

type FileRule_Overloads_Type_Map

type FileRule_Overloads_Type_Map struct {
	Key   *FileRule_Overloads_Type `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value *FileRule_Overloads_Type `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*FileRule_Overloads_Type_Map) Descriptor deprecated

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

Deprecated: Use FileRule_Overloads_Type_Map.ProtoReflect.Descriptor instead.

func (*FileRule_Overloads_Type_Map) GetKey

func (*FileRule_Overloads_Type_Map) GetValue

func (*FileRule_Overloads_Type_Map) ProtoMessage

func (*FileRule_Overloads_Type_Map) ProtoMessage()

func (*FileRule_Overloads_Type_Map) ProtoReflect

func (*FileRule_Overloads_Type_Map) Reset

func (x *FileRule_Overloads_Type_Map) Reset()

func (*FileRule_Overloads_Type_Map) String

func (x *FileRule_Overloads_Type_Map) String() string

type FileRule_Overloads_Type_Map_

type FileRule_Overloads_Type_Map_ struct {
	Map *FileRule_Overloads_Type_Map `protobuf:"bytes,4,opt,name=map,proto3,oneof"`
}

type FileRule_Overloads_Type_Object

type FileRule_Overloads_Type_Object struct {
	Object string `protobuf:"bytes,2,opt,name=object,proto3,oneof"`
}

type FileRule_Overloads_Type_Primitive

type FileRule_Overloads_Type_Primitive int32
const (
	FileRule_Overloads_Type_PRIMITIVE_UNSPECIFIED FileRule_Overloads_Type_Primitive = 0
	FileRule_Overloads_Type_BOOL                  FileRule_Overloads_Type_Primitive = 1
	FileRule_Overloads_Type_INT                   FileRule_Overloads_Type_Primitive = 2
	FileRule_Overloads_Type_UINT                  FileRule_Overloads_Type_Primitive = 3
	FileRule_Overloads_Type_DOUBLE                FileRule_Overloads_Type_Primitive = 4
	FileRule_Overloads_Type_BYTES                 FileRule_Overloads_Type_Primitive = 5
	FileRule_Overloads_Type_STRING                FileRule_Overloads_Type_Primitive = 6
	FileRule_Overloads_Type_DURATION              FileRule_Overloads_Type_Primitive = 7
	FileRule_Overloads_Type_TIMESTAMP             FileRule_Overloads_Type_Primitive = 8
	FileRule_Overloads_Type_ERROR                 FileRule_Overloads_Type_Primitive = 9
	FileRule_Overloads_Type_DYN                   FileRule_Overloads_Type_Primitive = 10
	FileRule_Overloads_Type_ANY                   FileRule_Overloads_Type_Primitive = 11
)

func (FileRule_Overloads_Type_Primitive) Descriptor

func (FileRule_Overloads_Type_Primitive) Enum

func (FileRule_Overloads_Type_Primitive) EnumDescriptor deprecated

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

Deprecated: Use FileRule_Overloads_Type_Primitive.Descriptor instead.

func (FileRule_Overloads_Type_Primitive) Number

func (FileRule_Overloads_Type_Primitive) String

func (FileRule_Overloads_Type_Primitive) Type

type FileRule_Overloads_Type_Primitive_

type FileRule_Overloads_Type_Primitive_ struct {
	Primitive FileRule_Overloads_Type_Primitive `protobuf:"varint,1,opt,name=primitive,proto3,enum=authorize.FileRule_Overloads_Type_Primitive,oneof"`
}

type FunctionOverload

type FunctionOverload struct {
	Name     string
	Function func(...ref.Val) ref.Val
}

type MethodRule

type MethodRule struct {
	Expr string `protobuf:"bytes,1,opt,name=expr,proto3" json:"expr,omitempty"`
	// contains filtered or unexported fields
}

func (*MethodRule) Descriptor deprecated

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

Deprecated: Use MethodRule.ProtoReflect.Descriptor instead.

func (*MethodRule) GetExpr

func (x *MethodRule) GetExpr() string

func (*MethodRule) ProtoMessage

func (*MethodRule) ProtoMessage()

func (*MethodRule) ProtoReflect

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

func (*MethodRule) Reset

func (x *MethodRule) Reset()

func (*MethodRule) String

func (x *MethodRule) String() string

type Options

type Options interface {
	GetFunctionOverloads() []*FunctionOverload
	GetVariableOverloads() []*VariableOverload
}

type TypeAdapterFunc

type TypeAdapterFunc func(value interface{}) ref.Val

func (TypeAdapterFunc) NativeToValue

func (fn TypeAdapterFunc) NativeToValue(value interface{}) ref.Val

type VariableOverload

type VariableOverload struct {
	Name  string
	Value interface{}
}

Directories

Path Synopsis
interceptors

Jump to

Keyboard shortcuts

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