MCPcopy Index your code
hub / github.com/coder/coder / password

Method password

coderd/notifications/dispatch/smtp.go:565–575  ·  view source on GitHub ↗

password returns either the configured password, or reads it from the configured file (if possible).

()

Source from the content-addressed store, hash-verified

563
564// password returns either the configured password, or reads it from the configured file (if possible).
565func (s *SMTPHandler) password() (string, error) {
566 file := s.cfg.Auth.PasswordFile.String()
567 if len(file) > 0 {
568 content, err := os.ReadFile(file)
569 if err != nil {
570 return "", xerrors.Errorf("could not read %s: %w", file, err)
571 }
572 return string(content), nil
573 }
574 return s.cfg.Auth.Password.String(), nil
575}

Callers 1

authMethod · 0.95

Calls 3

ReadFileMethod · 0.65
StringMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected