Documentation
¶
Index ¶
- Constants
- Variables
- func NewContentLengthLimiter(apiPackages map[string]config.APIPackageConfig) (*contentLengthLimiter, error)
- func NewMetricsMiddleware(statusMetricsHandler core.StatusMetricsHandler, conf config.ApiRoutesConfig) (*metricsMiddleware, error)
- func NewNativeAuth(args ArgNativeAuth) (*nativeAuth, error)
- func NewNativeAuthWhitelistHandler(apiPackages map[string]config.APIPackageConfig) *nativeAuthWhitelistHandler
- func NewUserContext() *userContext
- type ArgNativeAuth
Constants ¶
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" )
const UserAddressKey = "userAddress"
UserAddressKey is the key of pair for the user address stored in the context map
Variables ¶
var ErrContentLengthTooLarge = errors.New("content length too large")
ErrContentLengthTooLarge signals the content length is too large
var ErrInvalidPath = errors.New("invalid path")
ErrInvalidPath signals that the path is invalid
var ErrMalformedToken = errors.New("malformed token")
ErrMalformedToken signals that a malformed token has been provided
var ErrUnknownContentLength = errors.New("unknown content length")
ErrUnknownContentLength signals that the content length is unknown
Functions ¶
func NewContentLengthLimiter ¶ added in v1.0.15
func NewContentLengthLimiter(apiPackages map[string]config.APIPackageConfig) (*contentLengthLimiter, error)
NewContentLengthLimiter will abort all requests that have Content-Length size bigger than the one specified in config.
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 }