rbacservice

package
v0.0.0-...-de657e7 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RbacService_AddPolicy_FullMethodName          = "/edmondop.api.rbac.v1.RbacService/AddPolicy"
	RbacService_AssignPolicy_FullMethodName       = "/edmondop.api.rbac.v1.RbacService/AssignPolicy"
	RbacService_UnassignPolicy_FullMethodName     = "/edmondop.api.rbac.v1.RbacService/UnassignPolicy"
	RbacService_UpdatePolicy_FullMethodName       = "/edmondop.api.rbac.v1.RbacService/UpdatePolicy"
	RbacService_AuthorizeAction_FullMethodName    = "/edmondop.api.rbac.v1.RbacService/AuthorizeAction"
	RbacService_AddUserToRole_FullMethodName      = "/edmondop.api.rbac.v1.RbacService/AddUserToRole"
	RbacService_RemoveUserFromRole_FullMethodName = "/edmondop.api.rbac.v1.RbacService/RemoveUserFromRole"
	RbacService_GetRolesForUser_FullMethodName    = "/edmondop.api.rbac.v1.RbacService/GetRolesForUser"
)

Variables

View Source
var (
	Effect_name = map[int32]string{
		0: "ALLOW",
		1: "DENY",
	}
	Effect_value = map[string]int32{
		"ALLOW": 0,
		"DENY":  1,
	}
)

Enum value maps for Effect.

View Source
var File_proto_rbac_proto protoreflect.FileDescriptor
View Source
var RbacService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "edmondop.api.rbac.v1.RbacService",
	HandlerType: (*RbacServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AddPolicy",
			Handler:    _RbacService_AddPolicy_Handler,
		},
		{
			MethodName: "AssignPolicy",
			Handler:    _RbacService_AssignPolicy_Handler,
		},
		{
			MethodName: "UnassignPolicy",
			Handler:    _RbacService_UnassignPolicy_Handler,
		},
		{
			MethodName: "UpdatePolicy",
			Handler:    _RbacService_UpdatePolicy_Handler,
		},
		{
			MethodName: "AuthorizeAction",
			Handler:    _RbacService_AuthorizeAction_Handler,
		},
		{
			MethodName: "AddUserToRole",
			Handler:    _RbacService_AddUserToRole_Handler,
		},
		{
			MethodName: "RemoveUserFromRole",
			Handler:    _RbacService_RemoveUserFromRole_Handler,
		},
		{
			MethodName: "GetRolesForUser",
			Handler:    _RbacService_GetRolesForUser_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/rbac.proto",
}

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

Functions

func RegisterRbacServiceServer

func RegisterRbacServiceServer(s grpc.ServiceRegistrar, srv RbacServiceServer)

Types

type AddPolicyRequest

type AddPolicyRequest struct {
	Statements []*PolicyStatement `protobuf:"bytes,1,rep,name=statements,proto3" json:"statements,omitempty"`
	Roles      []string           `protobuf:"bytes,2,rep,name=roles,proto3" json:"roles,omitempty"`
	// contains filtered or unexported fields
}

func (*AddPolicyRequest) Descriptor deprecated

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

Deprecated: Use AddPolicyRequest.ProtoReflect.Descriptor instead.

func (*AddPolicyRequest) GetRoles

func (x *AddPolicyRequest) GetRoles() []string

func (*AddPolicyRequest) GetStatements

func (x *AddPolicyRequest) GetStatements() []*PolicyStatement

func (*AddPolicyRequest) ProtoMessage

func (*AddPolicyRequest) ProtoMessage()

func (*AddPolicyRequest) ProtoReflect

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

func (*AddPolicyRequest) Reset

func (x *AddPolicyRequest) Reset()

func (*AddPolicyRequest) String

func (x *AddPolicyRequest) String() string

type AddUserToRoleRequest

type AddUserToRoleRequest struct {
	User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
	Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"`
	// contains filtered or unexported fields
}

func (*AddUserToRoleRequest) Descriptor deprecated

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

Deprecated: Use AddUserToRoleRequest.ProtoReflect.Descriptor instead.

func (*AddUserToRoleRequest) GetRole

func (x *AddUserToRoleRequest) GetRole() string

func (*AddUserToRoleRequest) GetUser

func (x *AddUserToRoleRequest) GetUser() string

func (*AddUserToRoleRequest) ProtoMessage

func (*AddUserToRoleRequest) ProtoMessage()

func (*AddUserToRoleRequest) ProtoReflect

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

func (*AddUserToRoleRequest) Reset

func (x *AddUserToRoleRequest) Reset()

func (*AddUserToRoleRequest) String

func (x *AddUserToRoleRequest) String() string

type AddUserToRoleResponse

type AddUserToRoleResponse struct {
	Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	// contains filtered or unexported fields
}

func (*AddUserToRoleResponse) Descriptor deprecated

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

Deprecated: Use AddUserToRoleResponse.ProtoReflect.Descriptor instead.

func (*AddUserToRoleResponse) GetSuccess

func (x *AddUserToRoleResponse) GetSuccess() bool

func (*AddUserToRoleResponse) ProtoMessage

func (*AddUserToRoleResponse) ProtoMessage()

func (*AddUserToRoleResponse) ProtoReflect

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

func (*AddUserToRoleResponse) Reset

func (x *AddUserToRoleResponse) Reset()

func (*AddUserToRoleResponse) String

func (x *AddUserToRoleResponse) String() string

type AssignPolicyRequest

type AssignPolicyRequest struct {
	PolicyId *PolicyId `protobuf:"bytes,1,opt,name=policy_id,json=policyId,proto3" json:"policy_id,omitempty"`
	Roles    []string  `protobuf:"bytes,2,rep,name=roles,proto3" json:"roles,omitempty"`
	// contains filtered or unexported fields
}

func (*AssignPolicyRequest) Descriptor deprecated

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

Deprecated: Use AssignPolicyRequest.ProtoReflect.Descriptor instead.

func (*AssignPolicyRequest) GetPolicyId

func (x *AssignPolicyRequest) GetPolicyId() *PolicyId

func (*AssignPolicyRequest) GetRoles

func (x *AssignPolicyRequest) GetRoles() []string

func (*AssignPolicyRequest) ProtoMessage

func (*AssignPolicyRequest) ProtoMessage()

func (*AssignPolicyRequest) ProtoReflect

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

func (*AssignPolicyRequest) Reset

func (x *AssignPolicyRequest) Reset()

func (*AssignPolicyRequest) String

func (x *AssignPolicyRequest) String() string

type AuthorizeActionRequest

type AuthorizeActionRequest struct {
	User     string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
	Resource string `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"`
	Action   string `protobuf:"bytes,3,opt,name=action,proto3" json:"action,omitempty"`
	// contains filtered or unexported fields
}

func (*AuthorizeActionRequest) Descriptor deprecated

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

Deprecated: Use AuthorizeActionRequest.ProtoReflect.Descriptor instead.

func (*AuthorizeActionRequest) GetAction

func (x *AuthorizeActionRequest) GetAction() string

func (*AuthorizeActionRequest) GetResource

func (x *AuthorizeActionRequest) GetResource() string

func (*AuthorizeActionRequest) GetUser

func (x *AuthorizeActionRequest) GetUser() string

func (*AuthorizeActionRequest) ProtoMessage

func (*AuthorizeActionRequest) ProtoMessage()

func (*AuthorizeActionRequest) ProtoReflect

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

func (*AuthorizeActionRequest) Reset

func (x *AuthorizeActionRequest) Reset()

func (*AuthorizeActionRequest) String

func (x *AuthorizeActionRequest) String() string

type AuthorizeActionResponse

type AuthorizeActionResponse struct {
	Authorized bool    `protobuf:"varint,1,opt,name=authorized,proto3" json:"authorized,omitempty"`
	Error      *string `protobuf:"bytes,2,opt,name=error,proto3,oneof" json:"error,omitempty"` // error message if any
	// contains filtered or unexported fields
}

func (*AuthorizeActionResponse) Descriptor deprecated

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

Deprecated: Use AuthorizeActionResponse.ProtoReflect.Descriptor instead.

func (*AuthorizeActionResponse) GetAuthorized

func (x *AuthorizeActionResponse) GetAuthorized() bool

func (*AuthorizeActionResponse) GetError

func (x *AuthorizeActionResponse) GetError() string

func (*AuthorizeActionResponse) ProtoMessage

func (*AuthorizeActionResponse) ProtoMessage()

func (*AuthorizeActionResponse) ProtoReflect

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

func (*AuthorizeActionResponse) Reset

func (x *AuthorizeActionResponse) Reset()

func (*AuthorizeActionResponse) String

func (x *AuthorizeActionResponse) String() string

type Effect

type Effect int32
const (
	Effect_ALLOW Effect = 0
	Effect_DENY  Effect = 1
)

func (Effect) Descriptor

func (Effect) Descriptor() protoreflect.EnumDescriptor

func (Effect) Enum

func (x Effect) Enum() *Effect

func (Effect) EnumDescriptor deprecated

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

Deprecated: Use Effect.Descriptor instead.

func (Effect) Number

func (x Effect) Number() protoreflect.EnumNumber

func (Effect) String

func (x Effect) String() string

func (Effect) Type

func (Effect) Type() protoreflect.EnumType

type ErrorResponse

type ErrorResponse struct {
	Error *string `protobuf:"bytes,1,opt,name=error,proto3,oneof" json:"error,omitempty"` // error message if any
	// contains filtered or unexported fields
}

func (*ErrorResponse) Descriptor deprecated

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

Deprecated: Use ErrorResponse.ProtoReflect.Descriptor instead.

func (*ErrorResponse) GetError

func (x *ErrorResponse) GetError() string

func (*ErrorResponse) ProtoMessage

func (*ErrorResponse) ProtoMessage()

func (*ErrorResponse) ProtoReflect

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

func (*ErrorResponse) Reset

func (x *ErrorResponse) Reset()

func (*ErrorResponse) String

func (x *ErrorResponse) String() string

type GetRolesForUserRequest

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

func (*GetRolesForUserRequest) Descriptor deprecated

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

Deprecated: Use GetRolesForUserRequest.ProtoReflect.Descriptor instead.

func (*GetRolesForUserRequest) GetUser

func (x *GetRolesForUserRequest) GetUser() string

func (*GetRolesForUserRequest) ProtoMessage

func (*GetRolesForUserRequest) ProtoMessage()

func (*GetRolesForUserRequest) ProtoReflect

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

func (*GetRolesForUserRequest) Reset

func (x *GetRolesForUserRequest) Reset()

func (*GetRolesForUserRequest) String

func (x *GetRolesForUserRequest) String() string

type GetRolesForUserResponse

type GetRolesForUserResponse struct {
	Roles []string `protobuf:"bytes,1,rep,name=roles,proto3" json:"roles,omitempty"`
	// contains filtered or unexported fields
}

func (*GetRolesForUserResponse) Descriptor deprecated

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

Deprecated: Use GetRolesForUserResponse.ProtoReflect.Descriptor instead.

func (*GetRolesForUserResponse) GetRoles

func (x *GetRolesForUserResponse) GetRoles() []string

func (*GetRolesForUserResponse) ProtoMessage

func (*GetRolesForUserResponse) ProtoMessage()

func (*GetRolesForUserResponse) ProtoReflect

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

func (*GetRolesForUserResponse) Reset

func (x *GetRolesForUserResponse) Reset()

func (*GetRolesForUserResponse) String

func (x *GetRolesForUserResponse) String() string

type PolicyId

type PolicyId struct {
	Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` // UUID as a string
	// contains filtered or unexported fields
}

func (*PolicyId) Descriptor deprecated

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

Deprecated: Use PolicyId.ProtoReflect.Descriptor instead.

func (*PolicyId) GetValue

func (x *PolicyId) GetValue() string

func (*PolicyId) ProtoMessage

func (*PolicyId) ProtoMessage()

func (*PolicyId) ProtoReflect

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

func (*PolicyId) Reset

func (x *PolicyId) Reset()

func (*PolicyId) String

func (x *PolicyId) String() string

type PolicyIdResponse

type PolicyIdResponse struct {
	PolicyId *PolicyId `protobuf:"bytes,1,opt,name=policy_id,json=policyId,proto3" json:"policy_id,omitempty"`
	Error    *string   `protobuf:"bytes,2,opt,name=error,proto3,oneof" json:"error,omitempty"` // error message if any
	// contains filtered or unexported fields
}

func (*PolicyIdResponse) Descriptor deprecated

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

Deprecated: Use PolicyIdResponse.ProtoReflect.Descriptor instead.

func (*PolicyIdResponse) GetError

func (x *PolicyIdResponse) GetError() string

func (*PolicyIdResponse) GetPolicyId

func (x *PolicyIdResponse) GetPolicyId() *PolicyId

func (*PolicyIdResponse) ProtoMessage

func (*PolicyIdResponse) ProtoMessage()

func (*PolicyIdResponse) ProtoReflect

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

func (*PolicyIdResponse) Reset

func (x *PolicyIdResponse) Reset()

func (*PolicyIdResponse) String

func (x *PolicyIdResponse) String() string

type PolicyStatement

type PolicyStatement struct {
	StatementId string   `protobuf:"bytes,1,opt,name=statement_id,json=statementId,proto3" json:"statement_id,omitempty"`
	Resources   []string `protobuf:"bytes,2,rep,name=resources,proto3" json:"resources,omitempty"`
	Actions     []string `protobuf:"bytes,3,rep,name=actions,proto3" json:"actions,omitempty"`
	Effect      Effect   `protobuf:"varint,4,opt,name=effect,proto3,enum=edmondop.api.rbac.v1.Effect" json:"effect,omitempty"`
	// contains filtered or unexported fields
}

func (*PolicyStatement) Descriptor deprecated

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

Deprecated: Use PolicyStatement.ProtoReflect.Descriptor instead.

func (*PolicyStatement) GetActions

func (x *PolicyStatement) GetActions() []string

func (*PolicyStatement) GetEffect

func (x *PolicyStatement) GetEffect() Effect

func (*PolicyStatement) GetResources

func (x *PolicyStatement) GetResources() []string

func (*PolicyStatement) GetStatementId

func (x *PolicyStatement) GetStatementId() string

func (*PolicyStatement) ProtoMessage

func (*PolicyStatement) ProtoMessage()

func (*PolicyStatement) ProtoReflect

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

func (*PolicyStatement) Reset

func (x *PolicyStatement) Reset()

func (*PolicyStatement) String

func (x *PolicyStatement) String() string

type RbacServiceClient

type RbacServiceClient interface {
	AddPolicy(ctx context.Context, in *AddPolicyRequest, opts ...grpc.CallOption) (*PolicyIdResponse, error)
	AssignPolicy(ctx context.Context, in *AssignPolicyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	UnassignPolicy(ctx context.Context, in *UnassignPolicyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	UpdatePolicy(ctx context.Context, in *UpdatePolicyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	AuthorizeAction(ctx context.Context, in *AuthorizeActionRequest, opts ...grpc.CallOption) (*AuthorizeActionResponse, error)
	AddUserToRole(ctx context.Context, in *AddUserToRoleRequest, opts ...grpc.CallOption) (*AddUserToRoleResponse, error)
	RemoveUserFromRole(ctx context.Context, in *RemoveUserFromRoleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	GetRolesForUser(ctx context.Context, in *GetRolesForUserRequest, opts ...grpc.CallOption) (*GetRolesForUserResponse, error)
}

RbacServiceClient is the client API for RbacService 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.

type RbacServiceServer

RbacServiceServer is the server API for RbacService service. All implementations must embed UnimplementedRbacServiceServer for forward compatibility

type RemoveUserFromRoleRequest

type RemoveUserFromRoleRequest struct {
	User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
	Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"`
	// contains filtered or unexported fields
}

func (*RemoveUserFromRoleRequest) Descriptor deprecated

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

Deprecated: Use RemoveUserFromRoleRequest.ProtoReflect.Descriptor instead.

func (*RemoveUserFromRoleRequest) GetRole

func (x *RemoveUserFromRoleRequest) GetRole() string

func (*RemoveUserFromRoleRequest) GetUser

func (x *RemoveUserFromRoleRequest) GetUser() string

func (*RemoveUserFromRoleRequest) ProtoMessage

func (*RemoveUserFromRoleRequest) ProtoMessage()

func (*RemoveUserFromRoleRequest) ProtoReflect

func (*RemoveUserFromRoleRequest) Reset

func (x *RemoveUserFromRoleRequest) Reset()

func (*RemoveUserFromRoleRequest) String

func (x *RemoveUserFromRoleRequest) String() string

type UnassignPolicyRequest

type UnassignPolicyRequest struct {
	PolicyId *PolicyId `protobuf:"bytes,1,opt,name=policy_id,json=policyId,proto3" json:"policy_id,omitempty"`
	Roles    []string  `protobuf:"bytes,2,rep,name=roles,proto3" json:"roles,omitempty"`
	// contains filtered or unexported fields
}

func (*UnassignPolicyRequest) Descriptor deprecated

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

Deprecated: Use UnassignPolicyRequest.ProtoReflect.Descriptor instead.

func (*UnassignPolicyRequest) GetPolicyId

func (x *UnassignPolicyRequest) GetPolicyId() *PolicyId

func (*UnassignPolicyRequest) GetRoles

func (x *UnassignPolicyRequest) GetRoles() []string

func (*UnassignPolicyRequest) ProtoMessage

func (*UnassignPolicyRequest) ProtoMessage()

func (*UnassignPolicyRequest) ProtoReflect

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

func (*UnassignPolicyRequest) Reset

func (x *UnassignPolicyRequest) Reset()

func (*UnassignPolicyRequest) String

func (x *UnassignPolicyRequest) String() string

type UnimplementedRbacServiceServer

type UnimplementedRbacServiceServer struct {
}

UnimplementedRbacServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedRbacServiceServer) AddPolicy

func (UnimplementedRbacServiceServer) AddUserToRole

func (UnimplementedRbacServiceServer) AssignPolicy

func (UnimplementedRbacServiceServer) AuthorizeAction

func (UnimplementedRbacServiceServer) GetRolesForUser

func (UnimplementedRbacServiceServer) RemoveUserFromRole

func (UnimplementedRbacServiceServer) UnassignPolicy

func (UnimplementedRbacServiceServer) UpdatePolicy

type UnsafeRbacServiceServer

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

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

type UpdatePolicyRequest

type UpdatePolicyRequest struct {
	PolicyId *PolicyId `protobuf:"bytes,1,opt,name=policy_id,json=policyId,proto3" json:"policy_id,omitempty"`
	Roles    []string  `protobuf:"bytes,2,rep,name=roles,proto3" json:"roles,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdatePolicyRequest) Descriptor deprecated

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

Deprecated: Use UpdatePolicyRequest.ProtoReflect.Descriptor instead.

func (*UpdatePolicyRequest) GetPolicyId

func (x *UpdatePolicyRequest) GetPolicyId() *PolicyId

func (*UpdatePolicyRequest) GetRoles

func (x *UpdatePolicyRequest) GetRoles() []string

func (*UpdatePolicyRequest) ProtoMessage

func (*UpdatePolicyRequest) ProtoMessage()

func (*UpdatePolicyRequest) ProtoReflect

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

func (*UpdatePolicyRequest) Reset

func (x *UpdatePolicyRequest) Reset()

func (*UpdatePolicyRequest) String

func (x *UpdatePolicyRequest) String() string

Jump to

Keyboard shortcuts

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