middleware

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const AuthenticationHeader = "authorization"

AuthenticationHeader declares the standard header that should contain authentication data such as a token, key, etc.

Variables

This section is empty.

Functions

func NewGRPCAuthenticationInterceptor

func NewGRPCAuthenticationInterceptor(
	token string,
) grpc.UnaryServerInterceptor

NewGRPCAuthenticationInterceptor creates an interceptor for GRPC requests. It checks for the presence of AuthenticationHeader and verifies that the token matches the parameter set in the constructor.

func NewRESTErrorHandler

func NewRESTErrorHandler(logger glog.Logger) runtime.ServeMuxOption

NewRESTErrorHandler replaces the default error handler of the package github.com/grpc-ecosystem/grpc-gateway/v2/runtime with a custom one that logs errors and modifies the header behavior.

Types

This section is empty.

Jump to

Keyboard shortcuts

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