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

Function BasicAuth

middleware/basic_auth.go:87–89  ·  view source on GitHub ↗

BasicAuth returns an BasicAuth middleware. For valid credentials it calls the next handler. For missing or invalid credentials, it sends "401 - Unauthorized" response.

(fn BasicAuthValidator)

Source from the content-addressed store, hash-verified

85// For valid credentials it calls the next handler.
86// For missing or invalid credentials, it sends "401 - Unauthorized" response.
87func BasicAuth(fn BasicAuthValidator) echo.MiddlewareFunc {
88 return BasicAuthWithConfig(BasicAuthConfig{Validator: fn})
89}
90
91// BasicAuthWithConfig returns an BasicAuthWithConfig middleware with config.
92func BasicAuthWithConfig(config BasicAuthConfig) echo.MiddlewareFunc {

Callers 1

TestBasicAuth_panicFunction · 0.85

Calls 1

BasicAuthWithConfigFunction · 0.85

Tested by 1

TestBasicAuth_panicFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…