MCPcopy
hub / github.com/labstack/echo / BasicAuthConfig

Struct BasicAuthConfig

middleware/basic_auth.go:21–39  ·  view source on GitHub ↗

BasicAuthConfig defines the config for BasicAuthWithConfig middleware. SECURITY: The Validator function is responsible for securely comparing credentials. See BasicAuthValidator documentation for guidance on preventing timing attacks.

Source from the content-addressed store, hash-verified

19// SECURITY: The Validator function is responsible for securely comparing credentials.
20// See BasicAuthValidator documentation for guidance on preventing timing attacks.
21type BasicAuthConfig struct {
22 // Skipper defines a function to skip middleware.
23 Skipper Skipper
24
25 // Validator is a function to validate BasicAuthWithConfig credentials. Note: if request contains multiple basic auth headers
26 // this function would be called once for each header until first valid result is returned
27 // Required.
28 Validator BasicAuthValidator
29
30 // Realm is a string to define realm attribute of BasicAuthWithConfig.
31 // Default value "Restricted".
32 Realm string
33
34 // AllowedCheckLimit set how many headers are allowed to be checked. This is useful
35 // environments like corporate test environments with application proxies restricting
36 // access to environment with their own auth scheme.
37 // Defaults to 1.
38 AllowedCheckLimit uint
39}
40
41// BasicAuthValidator defines a function to validate BasicAuthWithConfig credentials.
42//

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected