MCPcopy
hub / github.com/ContainerSSH/ContainerSSH / OnPassword

Method OnPassword

e2e_framework_test.go:414–427  ·  view source on GitHub ↗
(meta metadata.ConnectionAuthPendingMetadata, Password []byte)

Source from the content-addressed store, hash-verified

412}
413
414func (a *authHandler) OnPassword(meta metadata.ConnectionAuthPendingMetadata, Password []byte) (
415 bool,
416 metadata.ConnectionAuthenticatedMetadata,
417 error,
418) {
419 user, err := a.userdb.GetUser(meta.Username)
420 if err != nil {
421 return false, meta.AuthFailed(), err
422 }
423 if pw := user.GetPassword(); pw != nil && *pw == string(Password) {
424 return true, meta.Authenticated(meta.Username), nil
425 }
426 return false, meta.AuthFailed(), fmt.Errorf("incorrect password")
427}
428
429func (a *authHandler) OnPubKey(meta metadata.ConnectionAuthPendingMetadata, publicKey auth2.PublicKey) (
430 bool,

Callers

nothing calls this directly

Calls 5

AuthFailedMethod · 0.80
AuthenticatedMethod · 0.80
GetUserMethod · 0.65
GetPasswordMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected