ACL WHOAMI
Since 1.1.0ACL
Syntax
ACL WHOAMIReturns the name of the user the connection is logged in as. A new connection is logged in as default; AUTH with a user name and password, or HELLO with AUTH, changes that, and RESET goes back to default. Use it to check which user, and so which rights, a connection pool or a client library ended up with.
It takes no arguments. On a server that requires a password, a connection that has not logged in gets NOAUTH, as it does for every command but AUTH, HELLO, QUIT and RESET.
In KiviDB, ACL WHOAMI is in @admin and @dangerous, as every ACL subcommand is; in Redis it is in neither. So a user given +@all -@dangerous, as applications often are, is refused it with NOPERM. Add +acl|whoami to its rules to let it call it. See Security.
Reply
The user name, as a bulk string.
Examples
> ACL WHOAMI
"default"
> AUTH alice alice-pw
OK
> ACL WHOAMI
"alice"
> RESET
RESET
> ACL WHOAMI
"default"