middleware

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// UserAgentKey is the key of pair for the user agent stored in the context map
	UserAgentKey = "userAgent"

	// UserIpKey is the key of pair for the user ip stored in the context map
	UserIpKey = "userIp"
)
View Source
const UserAddressKey = "userAddress"

UserAddressKey is the key of pair for the user address stored in the context map

Variables

View Source
var ErrMalformedToken = errors.New("malformed token")

ErrMalformedToken signals that a malformed token has been provided

Functions

func NewMetricsMiddleware

func NewMetricsMiddleware(
	statusMetricsHandler core.StatusMetricsHandler,
	conf config.ApiRoutesConfig,
) (*metricsMiddleware, error)

NewMetricsMiddleware returns a new instance of metricsMiddleware

func NewNativeAuth

func NewNativeAuth(args ArgNativeAuth) (*nativeAuth, error)

NewNativeAuth returns a new instance of nativeAuth

func NewNativeAuthWhitelistHandler

func NewNativeAuthWhitelistHandler(apiPackages map[string]config.APIPackageConfig) *nativeAuthWhitelistHandler

NewNativeAuthWhitelistHandler returns a new instance of nativeAuthWhitelistHandler

func NewUserContext

func NewUserContext() *userContext

NewUserContext returns a new instance of userContext

Types

type ArgNativeAuth

type ArgNativeAuth struct {
	Validator        authentication.AuthServer
	TokenHandler     authentication.AuthTokenHandler
	WhitelistHandler core.NativeAuthWhitelistHandler
}

Jump to

Keyboard shortcuts

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