Documentation
¶
Overview ¶
Package server implements the server authentication interceptors. It validates JWT tokens from other nodes and logs the incoming address.
Index ¶
- type GRPCMetricsInterceptor
- func (i *GRPCMetricsInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc
- func (i *GRPCMetricsInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc
- func (i *GRPCMetricsInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc
- type LoggingInterceptor
- func (i *LoggingInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc
- func (i *LoggingInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc
- func (i *LoggingInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc
- type OpenConnectionsInterceptor
- func (i *OpenConnectionsInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc
- func (i *OpenConnectionsInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc
- func (i *OpenConnectionsInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc
- type ProtocolValidationInterceptor
- func (i *ProtocolValidationInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc
- func (i *ProtocolValidationInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc
- func (i *ProtocolValidationInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc
- type ServerAuthInterceptor
- func (i *ServerAuthInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc
- func (i *ServerAuthInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc
- func (i *ServerAuthInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GRPCMetricsInterceptor ¶ added in v1.1.0
type GRPCMetricsInterceptor struct{}
GRPCMetricsInterceptor provides Prometheus metrics for ConnectRPC server calls. It emits metrics compatible with the standard grpc-ecosystem prometheus middleware.
func NewGRPCMetricsInterceptor ¶ added in v1.1.0
func NewGRPCMetricsInterceptor() *GRPCMetricsInterceptor
func (*GRPCMetricsInterceptor) WrapStreamingClient ¶ added in v1.1.0
func (i *GRPCMetricsInterceptor) WrapStreamingClient( next connect.StreamingClientFunc, ) connect.StreamingClientFunc
WrapStreamingClient is a no-op for server-side interceptors.
func (*GRPCMetricsInterceptor) WrapStreamingHandler ¶ added in v1.1.0
func (i *GRPCMetricsInterceptor) WrapStreamingHandler( next connect.StreamingHandlerFunc, ) connect.StreamingHandlerFunc
type LoggingInterceptor ¶
type LoggingInterceptor struct {
// contains filtered or unexported fields
}
LoggingInterceptor logs errors for unary and stream RPCs.
func NewLoggingInterceptor ¶
func NewLoggingInterceptor(logger *zap.Logger) (*LoggingInterceptor, error)
NewLoggingInterceptor creates a new instance of LoggingInterceptor.
func (*LoggingInterceptor) WrapStreamingClient ¶ added in v1.0.0
func (i *LoggingInterceptor) WrapStreamingClient( next connect.StreamingClientFunc, ) connect.StreamingClientFunc
WrapStreamingClient is a no-op. Interface requirement.
func (*LoggingInterceptor) WrapStreamingHandler ¶ added in v1.0.0
func (i *LoggingInterceptor) WrapStreamingHandler( next connect.StreamingHandlerFunc, ) connect.StreamingHandlerFunc
type OpenConnectionsInterceptor ¶ added in v0.2.3
type OpenConnectionsInterceptor struct{}
OpenConnectionsInterceptor reports open connections for unary and stream RPCs.
func NewOpenConnectionsInterceptor ¶ added in v0.2.3
func NewOpenConnectionsInterceptor() (*OpenConnectionsInterceptor, error)
NewOpenConnectionsInterceptor creates a new instance of OpenConnectionsInterceptor.
func (*OpenConnectionsInterceptor) WrapStreamingClient ¶ added in v1.0.0
func (i *OpenConnectionsInterceptor) WrapStreamingClient( next connect.StreamingClientFunc, ) connect.StreamingClientFunc
WrapStreamingClient is a no-op. Interface requirement.
func (*OpenConnectionsInterceptor) WrapStreamingHandler ¶ added in v1.0.0
func (i *OpenConnectionsInterceptor) WrapStreamingHandler( next connect.StreamingHandlerFunc, ) connect.StreamingHandlerFunc
type ProtocolValidationInterceptor ¶ added in v1.0.0
type ProtocolValidationInterceptor struct{}
ProtocolValidationInterceptor enforces protocol restrictions by rejecting the Connect protocol and allowing only gRPC and gRPC-Web.
func NewProtocolValidationInterceptor ¶ added in v1.0.0
func NewProtocolValidationInterceptor() *ProtocolValidationInterceptor
func (*ProtocolValidationInterceptor) WrapStreamingClient ¶ added in v1.0.0
func (i *ProtocolValidationInterceptor) WrapStreamingClient( next connect.StreamingClientFunc, ) connect.StreamingClientFunc
WrapStreamingClient is a no-op. Interface requirement.
func (*ProtocolValidationInterceptor) WrapStreamingHandler ¶ added in v1.0.0
func (i *ProtocolValidationInterceptor) WrapStreamingHandler( next connect.StreamingHandlerFunc, ) connect.StreamingHandlerFunc
type ServerAuthInterceptor ¶ added in v1.0.0
type ServerAuthInterceptor struct {
// contains filtered or unexported fields
}
ServerAuthInterceptor validates JWT tokens from other nodes
func NewServerAuthInterceptor ¶ added in v1.0.0
func NewServerAuthInterceptor( verifier authn.JWTVerifier, logger *zap.Logger, ) *ServerAuthInterceptor
NewServerAuthInterceptor creates a new ServerAuthInterceptor.
func (*ServerAuthInterceptor) WrapStreamingClient ¶ added in v1.0.0
func (i *ServerAuthInterceptor) WrapStreamingClient( next connect.StreamingClientFunc, ) connect.StreamingClientFunc
WrapStreamingClient is a no-op for server interceptors. It's only implemented to satisfy the connect.Interceptor interface. This method is never called on the server side.
func (*ServerAuthInterceptor) WrapStreamingHandler ¶ added in v1.0.0
func (i *ServerAuthInterceptor) WrapStreamingHandler( next connect.StreamingHandlerFunc, ) connect.StreamingHandlerFunc