mirror of
https://github.com/EchoVault/SugarDB.git
synced 2025-10-09 09:50:09 +08:00
Call ACL Authorize for command before processing. Call ACL Authenticate when auth command is triggered.
This commit is contained in:
@@ -63,7 +63,13 @@ func (p Plugin) HandleCommand(ctx context.Context, cmd []string, server utils.Se
|
||||
}
|
||||
|
||||
func (p Plugin) handleAuth(ctx context.Context, cmd []string, server utils.Server, conn *net.Conn) ([]byte, error) {
|
||||
return nil, errors.New("AUTH not implemented")
|
||||
if len(cmd) < 2 || len(cmd) > 3 {
|
||||
return nil, errors.New("wrong number of arguments")
|
||||
}
|
||||
if err := p.acl.AuthenticateConnection(conn, cmd); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return []byte("+OK\r\n\n"), nil
|
||||
}
|
||||
|
||||
func (p Plugin) handleGetUser(ctx context.Context, cmd []string, server utils.Server, conn *net.Conn) ([]byte, error) {
|
||||
|
Reference in New Issue
Block a user