MCPcopy
hub / github.com/gin-gonic/gin / BasicAuth

Function BasicAuth

auth.go:72–74  ·  view source on GitHub ↗

BasicAuth returns a Basic HTTP Authorization middleware. It takes as argument a map[string]string where the key is the user name and the value is the password.

(accounts Accounts)

Source from the content-addressed store, hash-verified

70// BasicAuth returns a Basic HTTP Authorization middleware. It takes as argument a map[string]string where
71// the key is the user name and the value is the password.
72func BasicAuth(accounts Accounts) HandlerFunc {
73 return BasicAuthForRealm(accounts, "")
74}
75
76func processAccounts(accounts Accounts) authPairs {
77 length := len(accounts)

Callers 2

TestBasicAuthSucceedFunction · 0.85
TestBasicAuth401Function · 0.85

Calls 1

BasicAuthForRealmFunction · 0.85

Tested by 2

TestBasicAuthSucceedFunction · 0.68
TestBasicAuth401Function · 0.68