@@ -201,69 +201,58 @@ def acl_setuser(
201
201
"""
202
202
Create or update an ACL user.
203
203
204
- Create or update the ACL for `` username` `. If the user already exists,
204
+ Create or update the ACL for `username`. If the user already exists,
205
205
the existing ACL is completely overwritten and replaced with the
206
206
specified values.
207
207
208
- ``enabled`` is a boolean indicating whether the user should be allowed
209
- to authenticate or not. Defaults to ``False``.
210
-
211
- ``nopass`` is a boolean indicating whether the can authenticate without
212
- a password. This cannot be True if ``passwords`` are also specified.
213
-
214
- ``passwords`` if specified is a list of plain text passwords
215
- to add to or remove from the user. Each password must be prefixed with
216
- a '+' to add or a '-' to remove. For convenience, the value of
217
- ``passwords`` can be a simple prefixed string when adding or
218
- removing a single password.
219
-
220
- ``hashed_passwords`` if specified is a list of SHA-256 hashed passwords
221
- to add to or remove from the user. Each hashed password must be
222
- prefixed with a '+' to add or a '-' to remove. For convenience,
223
- the value of ``hashed_passwords`` can be a simple prefixed string when
224
- adding or removing a single password.
225
-
226
- ``categories`` if specified is a list of strings representing category
227
- permissions. Each string must be prefixed with either a '+' to add the
228
- category permission or a '-' to remove the category permission.
229
-
230
- ``commands`` if specified is a list of strings representing command
231
- permissions. Each string must be prefixed with either a '+' to add the
232
- command permission or a '-' to remove the command permission.
233
-
234
- ``keys`` if specified is a list of key patterns to grant the user
235
- access to. Keys patterns allow '*' to support wildcard matching. For
236
- example, '*' grants access to all keys while 'cache:*' grants access
237
- to all keys that are prefixed with 'cache:'. ``keys`` should not be
238
- prefixed with a '~'.
239
-
240
- ``reset`` is a boolean indicating whether the user should be fully
241
- reset prior to applying the new ACL. Setting this to True will
242
- remove all existing passwords, flags and privileges from the user and
243
- then apply the specified rules. If this is False, the user's existing
244
- passwords, flags and privileges will be kept and any new specified
245
- rules will be applied on top.
246
-
247
- ``reset_keys`` is a boolean indicating whether the user's key
248
- permissions should be reset prior to applying any new key permissions
249
- specified in ``keys``. If this is False, the user's existing
250
- key permissions will be kept and any new specified key permissions
251
- will be applied on top.
252
-
253
- ``reset_channels`` is a boolean indicating whether the user's channel
254
- permissions should be reset prior to applying any new channel permissions
255
- specified in ``channels``.If this is False, the user's existing
256
- channel permissions will be kept and any new specified channel permissions
257
- will be applied on top.
258
-
259
- ``reset_passwords`` is a boolean indicating whether to remove all
260
- existing passwords and the 'nopass' flag from the user prior to
261
- applying any new passwords specified in 'passwords' or
262
- 'hashed_passwords'. If this is False, the user's existing passwords
263
- and 'nopass' status will be kept and any new specified passwords
264
- or hashed_passwords will be applied on top.
265
-
266
- For more information see https://redis.io/commands/acl-setuser
208
+ For more information, see https://redis.io/commands/acl-setuser
209
+
210
+ Args:
211
+ username: The name of the user whose ACL is to be created or updated.
212
+ enabled: Indicates whether the user should be allowed to authenticate.
213
+ Defaults to `False`.
214
+ nopass: Indicates whether the user can authenticate without a password.
215
+ This cannot be `True` if `passwords` are also specified.
216
+ passwords: A list of plain text passwords to add to or remove from the user.
217
+ Each password must be prefixed with a '+' to add or a '-' to
218
+ remove. For convenience, a single prefixed string can be used
219
+ when adding or removing a single password.
220
+ hashed_passwords: A list of SHA-256 hashed passwords to add to or remove
221
+ from the user. Each hashed password must be prefixed with
222
+ a '+' to add or a '-' to remove. For convenience, a single
223
+ prefixed string can be used when adding or removing a
224
+ single password.
225
+ categories: A list of strings representing category permissions. Each string
226
+ must be prefixed with either a '+' to add the category
227
+ permission or a '-' to remove the category permission.
228
+ commands: A list of strings representing command permissions. Each string
229
+ must be prefixed with either a '+' to add the command permission
230
+ or a '-' to remove the command permission.
231
+ keys: A list of key patterns to grant the user access to. Key patterns allow
232
+ '*' to support wildcard matching. For example, '*' grants access to
233
+ all keys while 'cache:*' grants access to all keys that are prefixed
234
+ with 'cache:'. `keys` should not be prefixed with a '~'.
235
+ reset: Indicates whether the user should be fully reset prior to applying
236
+ the new ACL. Setting this to `True` will remove all existing
237
+ passwords, flags, and privileges from the user and then apply the
238
+ specified rules. If `False`, the user's existing passwords, flags,
239
+ and privileges will be kept and any new specified rules will be
240
+ applied on top.
241
+ reset_keys: Indicates whether the user's key permissions should be reset
242
+ prior to applying any new key permissions specified in `keys`.
243
+ If `False`, the user's existing key permissions will be kept and
244
+ any new specified key permissions will be applied on top.
245
+ reset_channels: Indicates whether the user's channel permissions should be
246
+ reset prior to applying any new channel permissions
247
+ specified in `channels`. If `False`, the user's existing
248
+ channel permissions will be kept and any new specified
249
+ channel permissions will be applied on top.
250
+ reset_passwords: Indicates whether to remove all existing passwords and the
251
+ `nopass` flag from the user prior to applying any new
252
+ passwords specified in `passwords` or `hashed_passwords`.
253
+ If `False`, the user's existing passwords and `nopass`
254
+ status will be kept and any new specified passwords or
255
+ hashed passwords will be applied on top.
267
256
"""
268
257
encoder = self .get_encoder ()
269
258
pieces : List [EncodableT ] = [username ]
0 commit comments