Documentation
¶
Index ¶
- Variables
- type AuthZ
- func (*AuthZ) Descriptor() ([]byte, []int)deprecated
- func (x *AuthZ) GetCasbin() *CasbinAuth
- func (x *AuthZ) GetCustomize() *structpb.Struct
- func (x *AuthZ) GetId() string
- func (x *AuthZ) GetName() string
- func (x *AuthZ) GetRoles() []string
- func (x *AuthZ) GetRoot() bool
- func (x *AuthZ) GetTimestamp() int64
- func (x *AuthZ) GetType() string
- func (x *AuthZ) GetUserType() string
- func (x *AuthZ) GetUsername() string
- func (*AuthZ) ProtoMessage()
- func (x *AuthZ) ProtoReflect() protoreflect.Message
- func (x *AuthZ) Reset()
- func (x *AuthZ) String() string
- func (m *AuthZ) Validate() error
- func (m *AuthZ) ValidateAll() error
- type AuthZMultiError
- type AuthZValidationError
- type CasbinAuth
- func (*CasbinAuth) Descriptor() ([]byte, []int)deprecated
- func (x *CasbinAuth) GetClaims() *v1.Claims
- func (x *CasbinAuth) GetPolicy() *Policy
- func (*CasbinAuth) ProtoMessage()
- func (x *CasbinAuth) ProtoReflect() protoreflect.Message
- func (x *CasbinAuth) Reset()
- func (x *CasbinAuth) String() string
- func (m *CasbinAuth) Validate() error
- func (m *CasbinAuth) ValidateAll() error
- type CasbinAuthMultiError
- type CasbinAuthValidationError
- type Policy
- func (*Policy) Descriptor() ([]byte, []int)deprecated
- func (x *Policy) GetAction() string
- func (x *Policy) GetDomain() []string
- func (x *Policy) GetExtras() map[string]string
- func (x *Policy) GetObject() string
- func (x *Policy) GetSubject() string
- func (*Policy) ProtoMessage()
- func (x *Policy) ProtoReflect() protoreflect.Message
- func (x *Policy) Reset()
- func (x *Policy) String() string
- func (m *Policy) Validate() error
- func (m *Policy) ValidateAll() error
- type PolicyMultiError
- type PolicyValidationError
Constants ¶
This section is empty.
Variables ¶
var File_runtime_security_authz_v1_authz_proto protoreflect.FileDescriptor
var File_runtime_security_authz_v1_casbin_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type AuthZ ¶
type AuthZ struct {
// Unique name for this authorization configuration instance.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// The type of authorization mechanism, e.g., "casbin", "opa", "customize".
Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
// Optional Casbin authorization configuration.
Casbin *CasbinAuth `protobuf:"bytes,10,opt,name=casbin,proto3,oneof" json:"casbin,omitempty"`
// Optional custom configuration for authorization types not explicitly defined.
Customize *structpb.Struct `protobuf:"bytes,100,opt,name=customize,proto3,oneof" json:"customize,omitempty"`
// The following fields describe attributes of the authorized entity or context.
// They are re-numbered to accommodate the new 'type' field and future mechanism configurations.
Root bool `protobuf:"varint,3,opt,name=root,proto3" json:"root,omitempty"`
Id string `protobuf:"bytes,4,opt,name=id,proto3" json:"id,omitempty"`
UserType string `protobuf:"bytes,5,opt,name=user_type,proto3" json:"user_type,omitempty"`
Username string `protobuf:"bytes,6,opt,name=username,proto3" json:"username,omitempty"`
Roles []string `protobuf:"bytes,7,rep,name=roles,proto3" json:"roles,omitempty"`
Timestamp int64 `protobuf:"varint,8,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
// contains filtered or unexported fields
}
AuthZ defines the configuration for an authorization mechanism instance. It can also contain attributes of the authorized entity.
func (*AuthZ) Descriptor
deprecated
func (*AuthZ) GetCasbin ¶
func (x *AuthZ) GetCasbin() *CasbinAuth
func (*AuthZ) GetCustomize ¶ added in v0.2.8
func (*AuthZ) GetTimestamp ¶
func (*AuthZ) GetUserType ¶
func (*AuthZ) GetUsername ¶
func (*AuthZ) ProtoMessage ¶
func (*AuthZ) ProtoMessage()
func (*AuthZ) ProtoReflect ¶
func (x *AuthZ) ProtoReflect() protoreflect.Message
func (*AuthZ) Validate ¶
Validate checks the field values on AuthZ with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*AuthZ) ValidateAll ¶
ValidateAll checks the field values on AuthZ with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in AuthZMultiError, or nil if none found.
type AuthZMultiError ¶
type AuthZMultiError []error
AuthZMultiError is an error wrapping multiple validation errors returned by AuthZ.ValidateAll() if the designated constraints aren't met.
func (AuthZMultiError) AllErrors ¶
func (m AuthZMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (AuthZMultiError) Error ¶
func (m AuthZMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type AuthZValidationError ¶
type AuthZValidationError struct {
// contains filtered or unexported fields
}
AuthZValidationError is the validation error returned by AuthZ.Validate if the designated constraints aren't met.
func (AuthZValidationError) Cause ¶
func (e AuthZValidationError) Cause() error
Cause function returns cause value.
func (AuthZValidationError) Error ¶
func (e AuthZValidationError) Error() string
Error satisfies the builtin error interface
func (AuthZValidationError) ErrorName ¶
func (e AuthZValidationError) ErrorName() string
ErrorName returns error name.
func (AuthZValidationError) Field ¶
func (e AuthZValidationError) Field() string
Field function returns field value.
func (AuthZValidationError) Key ¶
func (e AuthZValidationError) Key() bool
Key function returns key value.
func (AuthZValidationError) Reason ¶
func (e AuthZValidationError) Reason() string
Reason function returns reason value.
type CasbinAuth ¶
type CasbinAuth struct {
Policy *Policy `protobuf:"bytes,1,opt,name=policy,proto3" json:"policy,omitempty"`
Claims *v1.Claims `protobuf:"bytes,20,opt,name=claims,proto3" json:"claims,omitempty"` // Claims
// contains filtered or unexported fields
}
func (*CasbinAuth) Descriptor
deprecated
func (*CasbinAuth) Descriptor() ([]byte, []int)
Deprecated: Use CasbinAuth.ProtoReflect.Descriptor instead.
func (*CasbinAuth) GetClaims ¶
func (x *CasbinAuth) GetClaims() *v1.Claims
func (*CasbinAuth) GetPolicy ¶
func (x *CasbinAuth) GetPolicy() *Policy
func (*CasbinAuth) ProtoMessage ¶
func (*CasbinAuth) ProtoMessage()
func (*CasbinAuth) ProtoReflect ¶
func (x *CasbinAuth) ProtoReflect() protoreflect.Message
func (*CasbinAuth) Reset ¶
func (x *CasbinAuth) Reset()
func (*CasbinAuth) String ¶
func (x *CasbinAuth) String() string
func (*CasbinAuth) Validate ¶
func (m *CasbinAuth) Validate() error
Validate checks the field values on CasbinAuth with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*CasbinAuth) ValidateAll ¶
func (m *CasbinAuth) ValidateAll() error
ValidateAll checks the field values on CasbinAuth with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in CasbinAuthMultiError, or nil if none found.
type CasbinAuthMultiError ¶
type CasbinAuthMultiError []error
CasbinAuthMultiError is an error wrapping multiple validation errors returned by CasbinAuth.ValidateAll() if the designated constraints aren't met.
func (CasbinAuthMultiError) AllErrors ¶
func (m CasbinAuthMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (CasbinAuthMultiError) Error ¶
func (m CasbinAuthMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type CasbinAuthValidationError ¶
type CasbinAuthValidationError struct {
// contains filtered or unexported fields
}
CasbinAuthValidationError is the validation error returned by CasbinAuth.Validate if the designated constraints aren't met.
func (CasbinAuthValidationError) Cause ¶
func (e CasbinAuthValidationError) Cause() error
Cause function returns cause value.
func (CasbinAuthValidationError) Error ¶
func (e CasbinAuthValidationError) Error() string
Error satisfies the builtin error interface
func (CasbinAuthValidationError) ErrorName ¶
func (e CasbinAuthValidationError) ErrorName() string
ErrorName returns error name.
func (CasbinAuthValidationError) Field ¶
func (e CasbinAuthValidationError) Field() string
Field function returns field value.
func (CasbinAuthValidationError) Key ¶
func (e CasbinAuthValidationError) Key() bool
Key function returns key value.
func (CasbinAuthValidationError) Reason ¶
func (e CasbinAuthValidationError) Reason() string
Reason function returns reason value.
type Policy ¶
type Policy struct {
Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"`
Object string `protobuf:"bytes,2,opt,name=object,proto3" json:"object,omitempty"`
Action string `protobuf:"bytes,3,opt,name=action,proto3" json:"action,omitempty"`
Domain []string `protobuf:"bytes,4,rep,name=domain,proto3" json:"domain,omitempty"`
Extras map[string]string `` /* 139-byte string literal not displayed */
// contains filtered or unexported fields
}
func (*Policy) Descriptor
deprecated
func (*Policy) GetSubject ¶
func (*Policy) ProtoMessage ¶
func (*Policy) ProtoMessage()
func (*Policy) ProtoReflect ¶
func (x *Policy) ProtoReflect() protoreflect.Message
func (*Policy) Validate ¶
Validate checks the field values on Policy with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*Policy) ValidateAll ¶
ValidateAll checks the field values on Policy with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in PolicyMultiError, or nil if none found.
type PolicyMultiError ¶
type PolicyMultiError []error
PolicyMultiError is an error wrapping multiple validation errors returned by Policy.ValidateAll() if the designated constraints aren't met.
func (PolicyMultiError) AllErrors ¶
func (m PolicyMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (PolicyMultiError) Error ¶
func (m PolicyMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type PolicyValidationError ¶
type PolicyValidationError struct {
// contains filtered or unexported fields
}
PolicyValidationError is the validation error returned by Policy.Validate if the designated constraints aren't met.
func (PolicyValidationError) Cause ¶
func (e PolicyValidationError) Cause() error
Cause function returns cause value.
func (PolicyValidationError) Error ¶
func (e PolicyValidationError) Error() string
Error satisfies the builtin error interface
func (PolicyValidationError) ErrorName ¶
func (e PolicyValidationError) ErrorName() string
ErrorName returns error name.
func (PolicyValidationError) Field ¶
func (e PolicyValidationError) Field() string
Field function returns field value.
func (PolicyValidationError) Key ¶
func (e PolicyValidationError) Key() bool
Key function returns key value.
func (PolicyValidationError) Reason ¶
func (e PolicyValidationError) Reason() string
Reason function returns reason value.