server

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package server implements the server authentication interceptors. It validates JWT tokens from other nodes and logs the incoming address.

Index

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

WrapStreamingClient is a no-op for server-side interceptors.

func (*GRPCMetricsInterceptor) WrapStreamingHandler added in v1.1.0

func (*GRPCMetricsInterceptor) WrapUnary added in v1.1.0

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

WrapStreamingClient is a no-op. Interface requirement.

func (*LoggingInterceptor) WrapStreamingHandler added in v1.0.0

func (*LoggingInterceptor) WrapUnary added in v1.0.0

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

WrapStreamingClient is a no-op. Interface requirement.

func (*OpenConnectionsInterceptor) WrapStreamingHandler added in v1.0.0

func (*OpenConnectionsInterceptor) WrapUnary added in v1.0.0

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

WrapStreamingClient is a no-op. Interface requirement.

func (*ProtocolValidationInterceptor) WrapStreamingHandler added in v1.0.0

func (*ProtocolValidationInterceptor) WrapUnary added in v1.0.0

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

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 (*ServerAuthInterceptor) WrapUnary added in v1.0.0

Jump to

Keyboard shortcuts

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