Skip to content

Conversation

@joshrotenberg
Copy link
Collaborator

Summary

This PR adds support for the --wait flag to all Cloud ACL operations, allowing users to wait for async operations to complete.

Changes

ACL Redis Rules (3 commands)

  • cloud acl create-redis-rule - Creating ACL rules
  • cloud acl update-redis-rule - Updating ACL rules
  • cloud acl delete-redis-rule - Deleting ACL rules

ACL Roles (3 commands)

  • cloud acl create-role - Creating ACL roles
  • cloud acl update-role - Updating ACL roles
  • cloud acl delete-role - Deleting ACL roles

ACL Users (3 commands)

  • cloud acl create-acl-user - Creating ACL users
  • cloud acl update-acl-user - Updating ACL users
  • cloud acl delete-acl-user - Deleting ACL users

Implementation Details

  • Added AsyncOperationArgs to all 9 ACL command variants in CloudAclCommands enum
  • Updated all handler functions to use handle_async_response for consistent async operation handling
  • Created AclOperationParams struct to group common parameters and avoid clippy's too_many_arguments warning
  • All delete operations work with both --force and --wait flags

Testing

  • ✅ All existing tests pass
  • ✅ No clippy warnings
  • ✅ Code formatted with cargo fmt

Example Usage

# Create ACL rule and wait
redisctl cloud acl create-redis-rule --name "read-only" --rule "+@read" --wait

# Delete role with force and wait
redisctl cloud acl delete-role --id 789 --force --wait

# Create ACL user with custom timeout
redisctl cloud acl create-acl-user --username "app-user" --role-ids 123,456 --wait --wait-timeout 120

Related Issues

Fixes #194
Part of #175 (Cloud async operations support)

Backwards Compatibility

The changes maintain full backward compatibility - if the wait flags are not specified, operations behave synchronously as before.

- Add AsyncOperationArgs to all 9 ACL commands (create, update, delete for redis-rules, roles, and users)
- Update handlers to use handle_async_response for consistent async operation handling
- Create AclOperationParams struct to avoid too_many_arguments clippy warnings
- Maintain backward compatibility with existing synchronous behavior

Fixes #194
@joshrotenberg joshrotenberg merged commit 56cd49b into main Sep 7, 2025
9 checks passed
@joshrotenberg joshrotenberg deleted the feat/acl-wait-flag branch September 7, 2025 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(cloud): add --wait flag to ACL commands

2 participants