MCPcopy Create free account
hub / github.com/chain/Core / tokenAuthn

Method tokenAuthn

net/http/authn/authn.go:128–134  ·  view source on GitHub ↗
(req *http.Request)

Source from the content-addressed store, hash-verified

126}
127
128func (a *API) tokenAuthn(req *http.Request) (string, error) {
129 user, pw, ok := req.BasicAuth()
130 if !ok {
131 return "", errors.New("no token")
132 }
133 return user, a.cachedTokenAuthnCheck(req.Context(), user, pw)
134}
135
136func (a *API) tokenAuthnCheck(ctx context.Context, user, pw string) (bool, error) {
137 pwBytes, err := hex.DecodeString(pw)

Callers 1

AuthenticateMethod · 0.95

Calls 1

cachedTokenAuthnCheckMethod · 0.95

Tested by

no test coverage detected