acl

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: May 15, 2018 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Overview

`acl` a generic ACL server-side middleware for gRPC.

ACL Middleware

TODO documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StreamServerInterceptor

func StreamServerInterceptor(aclFunc AclFunc) grpc.StreamServerInterceptor

StreamServerInterceptor returns a new streaming server interceptors that validates incoming messages.

The stage at which invalid messages will be rejected with `InvalidArgument` varies based on the type of the RPC. For `ServerStream` (1:m) requests, it will happen before reaching any userspace handlers. For `ClientStream` (n:1) or `BidiStream` (n:m) RPCs, the messages will be rejected on calls to `stream.Recv()`.

func UnaryServerInterceptor

func UnaryServerInterceptor(aclFunc AclFunc) grpc.UnaryServerInterceptor

Types

type AclFunc

type AclFunc func(ctx context.Context, fullMethodName string, req proto.Message) error

AclFunc is the pluggable function that performs Access Control List check.

If error is returned, the error and `codes.PermissionDenied` will be returned to the user as well as the verbatim message.

type ServiceAclFuncOverride

type ServiceAclFuncOverride interface {
	AclFuncOverride(ctx context.Context, fullMethodName string, req proto.Message) error
}

ServiceAclFuncOverride allows a given gRPC service implementation to override the global `AclFunc`.

If a service implements the AclFuncOverride method, it takes precedence over the `AclFunc` method, and will be called instead of AclFunc for all method invocations within that service.

Jump to

Keyboard shortcuts

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