MCPcopy Index your code
hub / github.com/CodisLabs/codis / handleAuth

Method handleAuth

pkg/proxy/session.go:314–330  ·  view source on GitHub ↗
(r *Request)

Source from the content-addressed store, hash-verified

312}
313
314func (s *Session) handleAuth(r *Request) error {
315 if len(r.Multi) != 2 {
316 r.Resp = redis.NewErrorf("ERR wrong number of arguments for 'AUTH' command")
317 return nil
318 }
319 switch {
320 case s.config.SessionAuth == "":
321 r.Resp = redis.NewErrorf("ERR Client sent AUTH, but no password is set")
322 case s.config.SessionAuth != string(r.Multi[1].Value):
323 s.authorized = false
324 r.Resp = redis.NewErrorf("ERR invalid password")
325 default:
326 s.authorized = true
327 r.Resp = RespOK
328 }
329 return nil
330}
331
332func (s *Session) handleSelect(r *Request) error {
333 if len(r.Multi) != 2 {

Callers 1

handleRequestMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected