ACL GENTOKEN to create the credential you need before you can give an ACL user a password.
ACL SETUSER does not accept arbitrary passwords with >password: the value must come from GENTOKEN. Call it with just a username to have a strong password generated for you, or supply your own password to wrap instead. Either way, the reply is a token string that does two things at once: pass it to SETUSER as >token to set the user’s password, and later use it directly as UPSTASH_REDIS_REST_TOKEN, or exchange it (or the password it wraps) for a fresh one with ACL RESTTOKEN. GENTOKEN is an Upstash extension.
Syntax
Arguments
Important points
- A supplied
passwordis checked for minimum entropy and rejected if too weak. - This only generates a token; it does not create or modify the user. Pass the result to
ACL SETUSER <username> >tokento actually set it as the user’s password.
Response
The reply reports the result of the operation. Error replies have the same shape in RESP2 and RESP3 and are surfaced as exceptions by the SDKs below.Client libraries often decode bulk strings, maps, sets, and numeric strings into language-native values. The table describes the Redis wire reply.
Examples
TCP examples use the TLSREDIS_URL from the Upstash console. REST examples use UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN.
Redis CLI
Redis CLI
@upstash/redis
@upstash/redis
This command is not supported yet in
@upstash/redis.upstash_redis
upstash_redis
This command is not supported yet in
upstash_redis.ioredis
ioredis
node-redis
node-redis
redis-py
redis-py
go-redis
go-redis
jedis
jedis
redis-rs
redis-rs