MCPcopy Index your code
hub / github.com/foxcpp/maddy / usersPassword

Function usersPassword

internal/cli/ctl/users.go:228–246  ·  view source on GitHub ↗
(be module.PlainUserDB, ctx *cli.Context)

Source from the content-addressed store, hash-verified

226}
227
228func usersPassword(be module.PlainUserDB, ctx *cli.Context) error {
229 username := ctx.Args().First()
230 if username == "" {
231 return errors.New("error: USERNAME is required")
232 }
233
234 var pass string
235 if ctx.IsSet("password") {
236 pass = ctx.String("password")
237 } else {
238 var err error
239 pass, err = clitools2.ReadPassword("Enter new password")
240 if err != nil {
241 return err
242 }
243 }
244
245 return be.SetUserPassword(username, pass)
246}

Callers 1

initFunction · 0.85

Calls 4

ArgsMethod · 0.80
IsSetMethod · 0.80
SetUserPasswordMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected