MCPcopy Create free account
hub / github.com/foxcpp/maddy / Lookup

Method Lookup

internal/auth/shadow/module.go:93–111  ·  view source on GitHub ↗
(username string)

Source from the content-addressed store, hash-verified

91}
92
93func (a *Auth) Lookup(username string) (string, bool, error) {
94 if a.useHelper {
95 return "", false, fmt.Errorf("shadow: table lookup are not possible when using a helper")
96 }
97
98 ent, err := Lookup(username)
99 if err != nil {
100 if errors.Is(err, ErrNoSuchUser) {
101 return "", false, nil
102 }
103 return "", false, err
104 }
105
106 if !ent.IsAccountValid() {
107 return "", false, nil
108 }
109
110 return "", true, nil
111}
112
113func (a *Auth) AuthPlain(username, password string) error {
114 if a.useHelper {

Callers

nothing calls this directly

Calls 2

LookupFunction · 0.85
IsAccountValidMethod · 0.80

Tested by

no test coverage detected