Documentation ¶
Index ¶
- Variables
- type Auth
- func (*Auth) Descriptor() ([]byte, []int)deprecated
- func (x *Auth) GetExpression() *PermissionExpression
- func (x *Auth) GetPermission() *Permission
- func (m *Auth) GetPolicy() isAuth_Policy
- func (*Auth) ProtoMessage()
- func (x *Auth) ProtoReflect() protoreflect.Message
- func (x *Auth) Reset()
- func (x *Auth) String() string
- type Auth_Expression
- type Auth_Permission
- type Operation
- type Permission
- func (*Permission) Descriptor() ([]byte, []int)deprecated
- func (x *Permission) GetObject() string
- func (x *Permission) GetPredicate() string
- func (x *Permission) GetSubject() string
- func (*Permission) ProtoMessage()
- func (x *Permission) ProtoReflect() protoreflect.Message
- func (x *Permission) Reset()
- func (x *Permission) String() string
- type PermissionExpression
- func (*PermissionExpression) Descriptor() ([]byte, []int)deprecated
- func (x *PermissionExpression) GetOp() Operation
- func (x *PermissionExpression) GetPolicies() []*Auth
- func (*PermissionExpression) ProtoMessage()
- func (x *PermissionExpression) ProtoReflect() protoreflect.Message
- func (x *PermissionExpression) Reset()
- func (x *PermissionExpression) String() string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Operation_name = map[int32]string{ 0: "OPERATION_UNSPECIFIED", 1: "OPERATION_AND", 2: "OPERATION_OR", } Operation_value = map[string]int32{ "OPERATION_UNSPECIFIED": 0, "OPERATION_AND": 1, "OPERATION_OR": 2, } )
Enum value maps for Operation.
View Source
var (
// optional crwd.api.v1.Auth auth = 1000;
E_Auth = &file_crwd_api_v1_auth_proto_extTypes[0]
)
Extension fields to descriptorpb.MethodOptions.
View Source
var File_crwd_api_v1_auth_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct { // Types that are assignable to Policy: // // *Auth_Permission // *Auth_Expression Policy isAuth_Policy `protobuf_oneof:"policy"` // contains filtered or unexported fields }
Auth expresses authorization policies for an RPC.
func (*Auth) Descriptor
deprecated
func (*Auth) GetExpression ¶
func (x *Auth) GetExpression() *PermissionExpression
func (*Auth) GetPermission ¶
func (x *Auth) GetPermission() *Permission
func (*Auth) ProtoMessage ¶
func (*Auth) ProtoMessage()
func (*Auth) ProtoReflect ¶
func (x *Auth) ProtoReflect() protoreflect.Message
type Auth_Expression ¶
type Auth_Expression struct {
Expression *PermissionExpression `protobuf:"bytes,3,opt,name=expression,proto3,oneof"`
}
type Auth_Permission ¶
type Auth_Permission struct {
Permission *Permission `protobuf:"bytes,1,opt,name=permission,proto3,oneof"`
}
type Operation ¶
type Operation int32
Operation defines allowed boolean operations.
func (Operation) Descriptor ¶
func (Operation) Descriptor() protoreflect.EnumDescriptor
func (Operation) EnumDescriptor
deprecated
func (Operation) Number ¶
func (x Operation) Number() protoreflect.EnumNumber
func (Operation) Type ¶
func (Operation) Type() protoreflect.EnumType
type Permission ¶
type Permission struct { // The object, predicate, and subject fields are the types that are being // permission checked. For example, can a user subject read a book object? Object string `protobuf:"bytes,1,opt,name=object,proto3" json:"object,omitempty"` Predicate *string `protobuf:"bytes,2,opt,name=predicate,proto3,oneof" json:"predicate,omitempty"` Subject *string `protobuf:"bytes,3,opt,name=subject,proto3,oneof" json:"subject,omitempty"` // contains filtered or unexported fields }
Permission is the building block for expressing authorization.
Example:
rpc CreateFoo(CreateFooRequest) returns (CreateFooResponse) { option (crwd.api.v1.auth) = { permission: { predicate: "create" resource: "foo" } }; };
func (*Permission) Descriptor
deprecated
func (*Permission) Descriptor() ([]byte, []int)
Deprecated: Use Permission.ProtoReflect.Descriptor instead.
func (*Permission) GetObject ¶
func (x *Permission) GetObject() string
func (*Permission) GetPredicate ¶
func (x *Permission) GetPredicate() string
func (*Permission) GetSubject ¶
func (x *Permission) GetSubject() string
func (*Permission) ProtoMessage ¶
func (*Permission) ProtoMessage()
func (*Permission) ProtoReflect ¶
func (x *Permission) ProtoReflect() protoreflect.Message
func (*Permission) Reset ¶
func (x *Permission) Reset()
func (*Permission) String ¶
func (x *Permission) String() string
type PermissionExpression ¶
type PermissionExpression struct { Policies []*Auth `protobuf:"bytes,1,rep,name=policies,proto3" json:"policies,omitempty"` Op Operation `protobuf:"varint,2,opt,name=op,proto3,enum=crwd.api.v1.Operation" json:"op,omitempty"` // contains filtered or unexported fields }
PermissionExpression allows for boolean operations on policies.
Example:
option (crwd.api.v1.auth) = { permission_expression: { policies: [ { permission: { predicate: "update" resource: "foo" } }, { permission: { predicate: "delete" resource: "foo" }, } ] op: OR } };
func (*PermissionExpression) Descriptor
deprecated
func (*PermissionExpression) Descriptor() ([]byte, []int)
Deprecated: Use PermissionExpression.ProtoReflect.Descriptor instead.
func (*PermissionExpression) GetOp ¶
func (x *PermissionExpression) GetOp() Operation
func (*PermissionExpression) GetPolicies ¶
func (x *PermissionExpression) GetPolicies() []*Auth
func (*PermissionExpression) ProtoMessage ¶
func (*PermissionExpression) ProtoMessage()
func (*PermissionExpression) ProtoReflect ¶
func (x *PermissionExpression) ProtoReflect() protoreflect.Message
func (*PermissionExpression) Reset ¶
func (x *PermissionExpression) Reset()
func (*PermissionExpression) String ¶
func (x *PermissionExpression) String() string
Click to show internal directories.
Click to hide internal directories.