connectinterceptors

package
v0.70.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotAvailable      = connect.NewError(connect.CodeUnavailable, fmt.Errorf("function not available at the moment"))
	ErrDeniedInvalidArgs = connect.NewError(connect.CodePermissionDenied, errors.New("invalid arguments"))
)

Functions

func CookieSameSite

func CookieSameSite(name string) http.SameSite

func UnaryAuthorizationCheck

func UnaryAuthorizationCheck(h *v1beta1connect.ConnectHandler) connect.UnaryInterceptorFunc

UnaryAuthorizationCheck returns a unary server interceptor that checks for authorization

func UnaryConnectLoggerInterceptor

func UnaryConnectLoggerInterceptor(logger *zap.Logger, opts *LoggerOptions) connect.UnaryInterceptorFunc

Types

type LoggerOption

type LoggerOption struct {
	// Decider returns true if method should be logged
	Decider func(procedure string) bool
}

type LoggerOptions

type LoggerOptions struct {
	// contains filtered or unexported fields
}

func NewLoggerOptions

func NewLoggerOptions(opts ...LoggerOption) *LoggerOptions

type Session

type Session struct {
	// contains filtered or unexported fields
}

func NewSession

func NewSession(cookieCutter securecookie.Codec, conf authenticate.SessionConfig) *Session

func (Session) UnaryConnectRequestHeadersAnnotator

func (s Session) UnaryConnectRequestHeadersAnnotator() connect.UnaryInterceptorFunc

UnaryConnectRequestHeadersAnnotator converts session cookies set in grpc metadata to context this requires decrypting the cookie and setting it as context

func (Session) UnaryConnectResponseInterceptor

func (s Session) UnaryConnectResponseInterceptor() connect.UnaryInterceptorFunc

UnaryConnectResponseInterceptor adds session cookie to response if session id is present in header

Jump to

Keyboard shortcuts

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