permission

package
v0.0.0-...-6a8978f Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2022 License: MIT Imports: 10 Imported by: 0

README

用户权限判定

Documentation

Index

Constants

View Source
const (
	AppName = "permission"
)

Variables

View Source
var File_apps_permission_pb_rpc_proto protoreflect.FileDescriptor
View Source
var RPC_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "go8.devcloud.mcenter.permission.RPC",
	HandlerType: (*RPCServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "QueryPermission",
			Handler:    _RPC_QueryPermission_Handler,
		},
		{
			MethodName: "QueryRole",
			Handler:    _RPC_QueryRole_Handler,
		},
		{
			MethodName: "CheckPermission",
			Handler:    _RPC_CheckPermission_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "apps/permission/pb/rpc.proto",
}

RPC_ServiceDesc is the grpc.ServiceDesc for RPC service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterRPCServer

func RegisterRPCServer(s grpc.ServiceRegistrar, srv RPCServer)

Types

type CheckPermissionRequest

type CheckPermissionRequest struct {

	// 用户
	// @gotags: json:"username"
	Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username"`
	// 域
	// @gotags: json:"domain"
	Domain string `protobuf:"bytes,8,opt,name=domain,proto3" json:"domain"`
	// 那个空间
	// @gotags: json:"namespace"
	Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace"`
	// 那个组
	// @gotags: json:"group"
	Group string `protobuf:"bytes,3,opt,name=group,proto3" json:"group"`
	// 对那个服务
	// @gotags: json:"service_id"
	ServiceId string `protobuf:"bytes,4,opt,name=service_id,json=serviceId,proto3" json:"service_id"`
	// 那个接口的ID
	// @gotags: json:"endpoint_id"
	EndpointId string `protobuf:"bytes,5,opt,name=endpoint_id,json=endpointId,proto3" json:"endpoint_id"`
	// 接口的Path
	// @gotags: json:"path"
	Path string `protobuf:"bytes,6,opt,name=path,proto3" json:"path"`
	// @gotags: json:"page"
	Page *request.PageRequest `protobuf:"bytes,7,opt,name=page,proto3" json:"page"`
	// contains filtered or unexported fields
}

CheckPermissionRequest todo

func NewCheckPermissionRequest

func NewCheckPermissionRequest() *CheckPermissionRequest

NewCheckPermissionrequest todo

func (*CheckPermissionRequest) Descriptor deprecated

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

Deprecated: Use CheckPermissionRequest.ProtoReflect.Descriptor instead.

func (*CheckPermissionRequest) GetDomain

func (x *CheckPermissionRequest) GetDomain() string

func (*CheckPermissionRequest) GetEndpointId

func (x *CheckPermissionRequest) GetEndpointId() string

func (*CheckPermissionRequest) GetGroup

func (x *CheckPermissionRequest) GetGroup() string

func (*CheckPermissionRequest) GetNamespace

func (x *CheckPermissionRequest) GetNamespace() string

func (*CheckPermissionRequest) GetPage

func (*CheckPermissionRequest) GetPath

func (x *CheckPermissionRequest) GetPath() string

func (*CheckPermissionRequest) GetServiceId

func (x *CheckPermissionRequest) GetServiceId() string

func (*CheckPermissionRequest) GetUsername

func (x *CheckPermissionRequest) GetUsername() string

func (*CheckPermissionRequest) ProtoMessage

func (*CheckPermissionRequest) ProtoMessage()

func (*CheckPermissionRequest) ProtoReflect

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

func (*CheckPermissionRequest) Reset

func (x *CheckPermissionRequest) Reset()

func (*CheckPermissionRequest) String

func (x *CheckPermissionRequest) String() string

type QueryPermissionRequest

type QueryPermissionRequest struct {

	// @gotags: json:"page"
	Page *request.PageRequest `protobuf:"bytes,1,opt,name=page,proto3" json:"page"`
	// @gotags: json:"namespace"
	Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace"`
	// @gotags: json:"username"
	Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username"`
	// contains filtered or unexported fields
}

QueryPermissionRequest 查询用户权限

func (*QueryPermissionRequest) Descriptor deprecated

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

Deprecated: Use QueryPermissionRequest.ProtoReflect.Descriptor instead.

func (*QueryPermissionRequest) GetNamespace

func (x *QueryPermissionRequest) GetNamespace() string

func (*QueryPermissionRequest) GetPage

func (*QueryPermissionRequest) GetUsername

func (x *QueryPermissionRequest) GetUsername() string

func (*QueryPermissionRequest) ProtoMessage

func (*QueryPermissionRequest) ProtoMessage()

func (*QueryPermissionRequest) ProtoReflect

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

func (*QueryPermissionRequest) Reset

func (x *QueryPermissionRequest) Reset()

func (*QueryPermissionRequest) String

func (x *QueryPermissionRequest) String() string

type QueryRoleRequest

type QueryRoleRequest struct {

	// @gotags: json:"page"
	Page *request.PageRequest `protobuf:"bytes,1,opt,name=page,proto3" json:"page"`
	// @gotags: json:"namespace"
	Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace"`
	// @gotags: json:"with_permission"
	WithPermission bool `protobuf:"varint,3,opt,name=with_permission,json=withPermission,proto3" json:"with_permission"`
	// @gotags: json:"username"
	Username string `protobuf:"bytes,4,opt,name=username,proto3" json:"username"`
	// contains filtered or unexported fields
}

QueryRoleRequest 查询用户权限

func (*QueryRoleRequest) Descriptor deprecated

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

Deprecated: Use QueryRoleRequest.ProtoReflect.Descriptor instead.

func (*QueryRoleRequest) GetNamespace

func (x *QueryRoleRequest) GetNamespace() string

func (*QueryRoleRequest) GetPage

func (x *QueryRoleRequest) GetPage() *request.PageRequest

func (*QueryRoleRequest) GetUsername

func (x *QueryRoleRequest) GetUsername() string

func (*QueryRoleRequest) GetWithPermission

func (x *QueryRoleRequest) GetWithPermission() bool

func (*QueryRoleRequest) ProtoMessage

func (*QueryRoleRequest) ProtoMessage()

func (*QueryRoleRequest) ProtoReflect

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

func (*QueryRoleRequest) Reset

func (x *QueryRoleRequest) Reset()

func (*QueryRoleRequest) String

func (x *QueryRoleRequest) String() string

type RPCClient

type RPCClient interface {
	QueryPermission(ctx context.Context, in *QueryPermissionRequest, opts ...grpc.CallOption) (*role.PermissionSet, error)
	QueryRole(ctx context.Context, in *QueryRoleRequest, opts ...grpc.CallOption) (*role.RoleSet, error)
	// 校验权限
	CheckPermission(ctx context.Context, in *CheckPermissionRequest, opts ...grpc.CallOption) (*role.Permission, error)
}

RPCClient is the client API for RPC service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewRPCClient

func NewRPCClient(cc grpc.ClientConnInterface) RPCClient

type RPCServer

type RPCServer interface {
	QueryPermission(context.Context, *QueryPermissionRequest) (*role.PermissionSet, error)
	QueryRole(context.Context, *QueryRoleRequest) (*role.RoleSet, error)
	// 校验权限
	CheckPermission(context.Context, *CheckPermissionRequest) (*role.Permission, error)
	// contains filtered or unexported methods
}

RPCServer is the server API for RPC service. All implementations must embed UnimplementedRPCServer for forward compatibility

type Service

type Service interface {
	RPCServer
}

type UnimplementedRPCServer

type UnimplementedRPCServer struct {
}

UnimplementedRPCServer must be embedded to have forward compatible implementations.

func (UnimplementedRPCServer) CheckPermission

func (UnimplementedRPCServer) QueryPermission

func (UnimplementedRPCServer) QueryRole

type UnsafeRPCServer

type UnsafeRPCServer interface {
	// contains filtered or unexported methods
}

UnsafeRPCServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RPCServer will result in compilation errors.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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