Documentation ¶
Index ¶
- Variables
- func BuildAuthzProgram(expr string, msg proto.Message, config *FileRule, libs ...cel.Library) (cel.Program, error)
- func BuildAuthzProgramFromDesc(expr string, imports []protoreflect.FileDescriptor, ...) (cel.Program, error)
- func BuildMacroExpander(ast *cel.Ast) parser.MacroExpander
- func BuildRuntimeLibrary(config *FileRule, opts ...Options) cel.Library
- func FindMacros(config *FileRule, opts []cel.EnvOption, expr string) ([]string, error)
- func TypeFromOverloadType(t *FileRule_Overloads_Type) *v1alpha1.Type
- type AuthzInterceptor
- type FileRule
- func (*FileRule) Descriptor() ([]byte, []int)deprecated
- func (x *FileRule) GetGlobals() *FileRule_Globals
- func (x *FileRule) GetOverloads() *FileRule_Overloads
- func (x *FileRule) GetRules() map[string]*MethodRule
- func (*FileRule) ProtoMessage()
- func (x *FileRule) ProtoReflect() protoreflect.Message
- func (x *FileRule) Reset()
- func (x *FileRule) String() string
- type FileRule_Globals
- func (*FileRule_Globals) Descriptor() ([]byte, []int)deprecated
- func (x *FileRule_Globals) GetConstants() map[string]string
- func (x *FileRule_Globals) GetFunctions() map[string]string
- func (*FileRule_Globals) ProtoMessage()
- func (x *FileRule_Globals) ProtoReflect() protoreflect.Message
- func (x *FileRule_Globals) Reset()
- func (x *FileRule_Globals) String() string
- type FileRule_Overloads
- func (*FileRule_Overloads) Descriptor() ([]byte, []int)deprecated
- func (x *FileRule_Overloads) GetFunctions() map[string]*FileRule_Overloads_Function
- func (x *FileRule_Overloads) GetVariables() map[string]*FileRule_Overloads_Type
- func (*FileRule_Overloads) ProtoMessage()
- func (x *FileRule_Overloads) ProtoReflect() protoreflect.Message
- func (x *FileRule_Overloads) Reset()
- func (x *FileRule_Overloads) String() string
- type FileRule_Overloads_Function
- func (*FileRule_Overloads_Function) Descriptor() ([]byte, []int)deprecated
- func (x *FileRule_Overloads_Function) GetArgs() []*FileRule_Overloads_Type
- func (x *FileRule_Overloads_Function) GetResult() *FileRule_Overloads_Type
- func (*FileRule_Overloads_Function) ProtoMessage()
- func (x *FileRule_Overloads_Function) ProtoReflect() protoreflect.Message
- func (x *FileRule_Overloads_Function) Reset()
- func (x *FileRule_Overloads_Function) String() string
- type FileRule_Overloads_Type
- func (*FileRule_Overloads_Type) Descriptor() ([]byte, []int)deprecated
- func (x *FileRule_Overloads_Type) GetArray() *FileRule_Overloads_Type_Array
- func (x *FileRule_Overloads_Type) GetMap() *FileRule_Overloads_Type_Map
- func (x *FileRule_Overloads_Type) GetObject() string
- func (x *FileRule_Overloads_Type) GetPrimitive() FileRule_Overloads_Type_Primitive
- func (m *FileRule_Overloads_Type) GetType() isFileRule_Overloads_Type_Type
- func (*FileRule_Overloads_Type) ProtoMessage()
- func (x *FileRule_Overloads_Type) ProtoReflect() protoreflect.Message
- func (x *FileRule_Overloads_Type) Reset()
- func (x *FileRule_Overloads_Type) String() string
- type FileRule_Overloads_Type_Array
- func (*FileRule_Overloads_Type_Array) Descriptor() ([]byte, []int)deprecated
- func (x *FileRule_Overloads_Type_Array) GetType() *FileRule_Overloads_Type
- func (*FileRule_Overloads_Type_Array) ProtoMessage()
- func (x *FileRule_Overloads_Type_Array) ProtoReflect() protoreflect.Message
- func (x *FileRule_Overloads_Type_Array) Reset()
- func (x *FileRule_Overloads_Type_Array) String() string
- type FileRule_Overloads_Type_Array_
- type FileRule_Overloads_Type_Map
- func (*FileRule_Overloads_Type_Map) Descriptor() ([]byte, []int)deprecated
- func (x *FileRule_Overloads_Type_Map) GetKey() *FileRule_Overloads_Type
- func (x *FileRule_Overloads_Type_Map) GetValue() *FileRule_Overloads_Type
- func (*FileRule_Overloads_Type_Map) ProtoMessage()
- func (x *FileRule_Overloads_Type_Map) ProtoReflect() protoreflect.Message
- func (x *FileRule_Overloads_Type_Map) Reset()
- func (x *FileRule_Overloads_Type_Map) String() string
- type FileRule_Overloads_Type_Map_
- type FileRule_Overloads_Type_Object
- type FileRule_Overloads_Type_Primitive
- func (FileRule_Overloads_Type_Primitive) Descriptor() protoreflect.EnumDescriptor
- func (x FileRule_Overloads_Type_Primitive) Enum() *FileRule_Overloads_Type_Primitive
- func (FileRule_Overloads_Type_Primitive) EnumDescriptor() ([]byte, []int)deprecated
- func (x FileRule_Overloads_Type_Primitive) Number() protoreflect.EnumNumber
- func (x FileRule_Overloads_Type_Primitive) String() string
- func (FileRule_Overloads_Type_Primitive) Type() protoreflect.EnumType
- type FileRule_Overloads_Type_Primitive_
- type FunctionOverload
- type MethodRule
- type Options
- type TypeAdapterFunc
- type VariableOverload
Constants ¶
This section is empty.
Variables ¶
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.
var (
// optional authorize.FileRule file = 1145;
E_File = &file_authorize_authz_proto_extTypes[0]
)
Extension fields to descriptorpb.FileOptions.
var (
// optional authorize.MethodRule method = 1145;
E_Method = &file_authorize_authz_proto_extTypes[1]
)
Extension fields to descriptorpb.MethodOptions.
Functions ¶
func BuildAuthzProgram ¶
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 FindMacros ¶
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) 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
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 (x *FileRule_Overloads_Function) GetArgs() []*FileRule_Overloads_Type
func (*FileRule_Overloads_Function) GetResult ¶
func (x *FileRule_Overloads_Function) GetResult() *FileRule_Overloads_Type
func (*FileRule_Overloads_Function) ProtoMessage ¶
func (*FileRule_Overloads_Function) ProtoMessage()
func (*FileRule_Overloads_Function) ProtoReflect ¶
func (x *FileRule_Overloads_Function) ProtoReflect() protoreflect.Message
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 (x *FileRule_Overloads_Type) GetArray() *FileRule_Overloads_Type_Array
func (*FileRule_Overloads_Type) GetMap ¶
func (x *FileRule_Overloads_Type) GetMap() *FileRule_Overloads_Type_Map
func (*FileRule_Overloads_Type) GetObject ¶
func (x *FileRule_Overloads_Type) GetObject() string
func (*FileRule_Overloads_Type) GetPrimitive ¶
func (x *FileRule_Overloads_Type) GetPrimitive() FileRule_Overloads_Type_Primitive
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 (x *FileRule_Overloads_Type_Array) GetType() *FileRule_Overloads_Type
func (*FileRule_Overloads_Type_Array) ProtoMessage ¶
func (*FileRule_Overloads_Type_Array) ProtoMessage()
func (*FileRule_Overloads_Type_Array) ProtoReflect ¶
func (x *FileRule_Overloads_Type_Array) ProtoReflect() protoreflect.Message
func (*FileRule_Overloads_Type_Array) Reset ¶
func (x *FileRule_Overloads_Type_Array) Reset()
func (*FileRule_Overloads_Type_Array) String ¶
func (x *FileRule_Overloads_Type_Array) String() 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 (x *FileRule_Overloads_Type_Map) GetKey() *FileRule_Overloads_Type
func (*FileRule_Overloads_Type_Map) GetValue ¶
func (x *FileRule_Overloads_Type_Map) GetValue() *FileRule_Overloads_Type
func (*FileRule_Overloads_Type_Map) ProtoMessage ¶
func (*FileRule_Overloads_Type_Map) ProtoMessage()
func (*FileRule_Overloads_Type_Map) ProtoReflect ¶
func (x *FileRule_Overloads_Type_Map) ProtoReflect() protoreflect.Message
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) Descriptor() protoreflect.EnumDescriptor
func (FileRule_Overloads_Type_Primitive) Enum ¶
func (x FileRule_Overloads_Type_Primitive) Enum() *FileRule_Overloads_Type_Primitive
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 (x FileRule_Overloads_Type_Primitive) Number() protoreflect.EnumNumber
func (FileRule_Overloads_Type_Primitive) String ¶
func (x FileRule_Overloads_Type_Primitive) String() string
func (FileRule_Overloads_Type_Primitive) Type ¶
func (FileRule_Overloads_Type_Primitive) Type() protoreflect.EnumType
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 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 ¶
func (TypeAdapterFunc) NativeToValue ¶
func (fn TypeAdapterFunc) NativeToValue(value interface{}) ref.Val
type VariableOverload ¶
type VariableOverload struct { Name string Value interface{} }