connectinterceptors

package
v0.72.2 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2025 License: Apache-2.0 Imports: 20 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 UnaryConnectLoggerInterceptor

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

Types

type AuthenticationInterceptor added in v0.71.0

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

func NewAuthenticationInterceptor added in v0.71.0

func NewAuthenticationInterceptor(h *v1beta1connect.ConnectHandler) *AuthenticationInterceptor

func (*AuthenticationInterceptor) WrapStreamingClient added in v0.71.0

func (*AuthenticationInterceptor) WrapStreamingHandler added in v0.71.0

func (*AuthenticationInterceptor) WrapUnary added in v0.71.0

type AuthorizationInterceptor added in v0.71.0

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

func NewAuthorizationInterceptor added in v0.71.0

func NewAuthorizationInterceptor(h *v1beta1connect.ConnectHandler) *AuthorizationInterceptor

func (*AuthorizationInterceptor) WrapStreamingClient added in v0.71.0

func (*AuthorizationInterceptor) WrapStreamingHandler added in v0.71.0

func (*AuthorizationInterceptor) WrapUnary added in v0.71.0

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 SessionInterceptor added in v0.71.0

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

func NewSessionInterceptor added in v0.71.0

func NewSessionInterceptor(cookieCutter securecookie.Codec, conf authenticate.SessionConfig, h *v1beta1connect.ConnectHandler) *SessionInterceptor

func (*SessionInterceptor) UnaryConnectRequestHeadersAnnotator added in v0.71.0

func (s *SessionInterceptor) UnaryConnectRequestHeadersAnnotator() connect.UnaryInterceptorFunc

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

func (*SessionInterceptor) UnaryConnectResponseInterceptor added in v0.71.0

func (s *SessionInterceptor) UnaryConnectResponseInterceptor() connect.UnaryInterceptorFunc

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

func (*SessionInterceptor) WrapStreamingClient added in v0.71.0

func (*SessionInterceptor) WrapStreamingHandler added in v0.71.0

func (*SessionInterceptor) WrapUnary added in v0.71.0

Jump to

Keyboard shortcuts

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