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

Method tokenAuthnCheck

net/http/authn/authn.go:136–142  ·  view source on GitHub ↗
(ctx context.Context, user, pw string)

Source from the content-addressed store, hash-verified

134}
135
136func (a *API) tokenAuthnCheck(ctx context.Context, user, pw string) (bool, error) {
137 pwBytes, err := hex.DecodeString(pw)
138 if err != nil {
139 return false, nil
140 }
141 return a.tokens.Check(ctx, user, pwBytes)
142}
143
144func (a *API) cachedTokenAuthnCheck(ctx context.Context, user, pw string) error {
145 a.tokenMu.Lock()

Callers 1

cachedTokenAuthnCheckMethod · 0.95

Calls 1

CheckMethod · 0.80

Tested by

no test coverage detected