Added resetpass, nocommands, resetkeys and resetchannels directives in ACL DSL

This commit is contained in:
Kelvin Clement Mwinuka
2023-12-19 10:02:17 +08:00
parent ab86694bc2
commit 1d36d2c772
3 changed files with 30 additions and 4 deletions

View File

@@ -102,6 +102,9 @@ func (p Plugin) handleGetUser(ctx context.Context, cmd []string, server utils.Se
if user.NoPassword {
flags = append(flags, "nopass")
}
if user.NoKeys {
flags = append(flags, "nokeys")
}
res = res + fmt.Sprintf("\r\n+flags\r\n*%d", len(flags))
for _, flag := range flags {
@@ -279,6 +282,10 @@ func (p Plugin) handleList(ctx context.Context, cmd []string, server utils.Serve
if user.NoPassword {
s += " nopass"
}
// No keys
if user.NoKeys {
s += " nokeys"
}
// Passwords
for _, password := range user.Passwords {
if strings.EqualFold(password.PasswordType, "plaintext") {