MCPcopy Index your code
hub / github.com/labstack/echo / KeyAuthWithConfig

Function KeyAuthWithConfig

middleware/key_auth.go:133–135  ·  view source on GitHub ↗

KeyAuthWithConfig returns an KeyAuth middleware or panics if configuration is invalid. For first valid key it calls the next handler. For invalid key, it sends "401 - Unauthorized" response. For missing key, it sends "400 - Bad Request" response.

(config KeyAuthConfig)

Source from the content-addressed store, hash-verified

131// For invalid key, it sends "401 - Unauthorized" response.
132// For missing key, it sends "400 - Bad Request" response.
133func KeyAuthWithConfig(config KeyAuthConfig) echo.MiddlewareFunc {
134 return toMiddlewareOrPanic(config)
135}
136
137// ToMiddleware converts KeyAuthConfig to middleware or returns an error for invalid configuration
138func (config KeyAuthConfig) ToMiddleware() (echo.MiddlewareFunc, error) {

Callers 4

TestKeyAuthWithConfigFunction · 0.85
KeyAuthFunction · 0.85

Calls 1

toMiddlewareOrPanicFunction · 0.85

Used in the wild real call sites across dependent graphs

searching dependent graphs…