Pass context to DeleteUser and AuthenticateUser

This commit is contained in:
Kelvin Clement Mwinuka
2023-12-18 05:12:29 +08:00
parent 29b7d808eb
commit f4432a4d0e
2 changed files with 5 additions and 4 deletions

View File

@@ -64,7 +64,7 @@ func (p Plugin) handleAuth(ctx context.Context, cmd []string, server utils.Serve
if len(cmd) < 2 || len(cmd) > 3 {
return nil, errors.New(utils.WRONG_ARGS_RESPONSE)
}
if err := p.acl.AuthenticateConnection(conn, cmd); err != nil {
if err := p.acl.AuthenticateConnection(ctx, conn, cmd); err != nil {
return nil, err
}
return []byte(utils.OK_RESPONSE), nil
@@ -240,7 +240,7 @@ func (p Plugin) handleDelUser(ctx context.Context, cmd []string, server utils.Se
if len(cmd) < 3 {
return nil, errors.New(utils.WRONG_ARGS_RESPONSE)
}
if err := p.acl.DeleteUser(cmd[2:]); err != nil {
if err := p.acl.DeleteUser(ctx, cmd[2:]); err != nil {
return nil, err
}
return []byte(utils.OK_RESPONSE), nil