interceptors

package
v0.7.24 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotAvailable = fmt.Errorf("function not available at the moment")
)

Functions

func CookieSameSite added in v0.7.4

func CookieSameSite(name string) http.SameSite

func EnrichCtxWithPassthroughEmail

func EnrichCtxWithPassthroughEmail(identityHeader string) grpc.UnaryServerInterceptor

func GatewayHeaderMatcherFunc

func GatewayHeaderMatcherFunc(headerKeys map[string]bool) func(key string) (string, bool)

GatewayHeaderMatcherFunc allows bypassing default runtime behaviour of prefixing headers with `grpc-gateway`

func UnaryAuthenticationCheck

func UnaryAuthenticationCheck() grpc.UnaryServerInterceptor

func UnaryAuthorizationCheck

func UnaryAuthorizationCheck(identityHeader string) grpc.UnaryServerInterceptor

func UnaryCtxWithAudit

func UnaryCtxWithAudit(service *audit.Service) grpc.UnaryServerInterceptor

func WithCors

func WithCors(h http.Handler, conf CorsConfig) http.Handler

Types

type CorsConfig added in v0.7.4

type CorsConfig struct {
	AllowedOrigins []string `yaml:"allowed_origins" mapstructure:"allowed_origins" default:""`
	AllowedMethods []string `yaml:"allowed_methods" mapstructure:"allowed_methods" default:"GET POST PUT DELETE PATCH"`
	AllowedHeaders []string `yaml:"allowed_headers" mapstructure:"allowed_headers" default:"Authorization"`
	ExposedHeaders []string `yaml:"exposed_headers" mapstructure:"exposed_headers" default:"Content-Type"`
}

type Session

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

func NewSession

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

func (Session) GatewayResponseModifier

func (h Session) GatewayResponseModifier(ctx context.Context, w http.ResponseWriter, _ proto.Message) error

GatewayResponseModifier https://grpc-ecosystem.github.io/grpc-gateway/docs/mapping/customizing_your_gateway/ called just before RPC server response gets serialized for gateway

func (Session) UnaryGRPCRequestHeadersAnnotator

func (h Session) UnaryGRPCRequestHeadersAnnotator() grpc.UnaryServerInterceptor

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

Jump to

Keyboard shortcuts

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