Documentation ¶
Overview ¶
Package rpc contains the gRPC endpoints and support code.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Set = wire.NewSet( ProvideAuthInterceptor, ProvideRPC, wire.Struct(new(BusyInterceptor), "*"), wire.Struct(new(ElideInterceptor), "*"), wire.Struct(new(VHostInterceptor), "*"), )
Set is used by wire.
Functions ¶
func ProvideRPC ¶
func ProvideRPC( log *log.Logger, security *AuthInterceptor, busy *BusyInterceptor, elide *ElideInterceptor, met *metrics.Interceptor, vh *VHostInterceptor, dia diag.DiagsServer, fls file.FilesServer, prn principal.PrincipalsServer, tnt tenant.TenantsServer, tkn token.TokensServer, upl upload.UploadsServer, vht vhost.VHostsServer, ) (*grpc.Server, error)
ProvideRPC attaches all of the service implementations to a *grpc.Server and returns it.
Types ¶
type AuthInterceptor ¶
type AuthInterceptor struct { Connector *oidc.Connector Enforcer *enforcer.Enforcer Logger *log.Logger Tokens token.TokensServer // contains filtered or unexported fields }
AuthInterceptor will examine an incoming RPC request for authorization data and decorate the context with a token.Session.
Unauthorized requests will be rejected unless the service implementation implements DefaultSession.
func ProvideAuthInterceptor ¶
func ProvideAuthInterceptor( connector *oidc.Connector, logger *log.Logger, tokens token.TokensServer, ) (*AuthInterceptor, error)
ProvideAuthInterceptor is called by wire.
func (*AuthInterceptor) Stream ¶
func (i *AuthInterceptor) Stream( srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler, ) error
Stream wraps a streaming gRPC call.
func (*AuthInterceptor) Unary ¶
func (i *AuthInterceptor) Unary( ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler, ) (ret interface{}, err error)
Unary wraps a unary gRPC call.
type BusyInterceptor ¶
BusyInterceptor ensures that a vhost.VHost is present in RPC calls.
func (BusyInterceptor) Stream ¶
func (i BusyInterceptor) Stream( srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler, ) error
Stream wraps a streaming gRPC call.
func (BusyInterceptor) Unary ¶
func (i BusyInterceptor) Unary( ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler, ) (ret interface{}, err error)
Unary wraps a unary gRPC call.
type ElideInterceptor ¶
ElideInterceptor provides services for eliding marked message fields.
func (*ElideInterceptor) Stream ¶
func (i *ElideInterceptor) Stream( srv interface{}, ss grpc.ServerStream, _ *grpc.StreamServerInfo, handler grpc.StreamHandler, ) error
Stream wraps a streaming gRPC call.
func (*ElideInterceptor) Unary ¶
func (i *ElideInterceptor) Unary( ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler, ) (interface{}, error)
Unary wraps a unary gRPC call.
type VHostInterceptor ¶
VHostInterceptor ensures that a vhost.VHost is present in RPC calls.
func (*VHostInterceptor) Stream ¶
func (i *VHostInterceptor) Stream( srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler, ) error
Stream wraps a streaming gRPC call.
func (*VHostInterceptor) Unary ¶
func (i *VHostInterceptor) Unary( ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler, ) (ret interface{}, err error)
Unary wraps a unary gRPC call.