Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsInternalUser ¶
AsInternalUser should never be used during user requests, only internal background jobs. It gives a context a cached whoami username of form internal:<name>. It also overwrites any existing metadata. As a result, this context may not be able to make additional gRPCs.
Types ¶
type ContextKey ¶
type ContextKey string
type Interceptor ¶
type Interceptor struct {
// contains filtered or unexported fields
}
Interceptor checks the authentication metadata in unary and streaming RPCs and prevents unknown or unauthorized calls.
func NewInterceptor ¶
func NewInterceptor(getAuthServer func() authserver.APIServer) *Interceptor
NewInterceptor instantiates a new Interceptor
func (*Interceptor) InterceptStream ¶
func (i *Interceptor) InterceptStream(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error
InterceptStream applies authentication rules to streaming RPCs
func (*Interceptor) InterceptUnary ¶
func (i *Interceptor) InterceptUnary(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
InterceptUnary applies authentication rules to unary RPCs
type ServerStreamWrapper ¶
type ServerStreamWrapper struct { grpc.ServerStream // contains filtered or unexported fields }
we use ServerStreamWrapper to set the stream's Context with added values
func (ServerStreamWrapper) Context ¶
func (s ServerStreamWrapper) Context() context.Context
Click to show internal directories.
Click to hide internal directories.