Skip to content

Conversation

@joshrotenberg
Copy link
Collaborator

Summary

This PR fixes multiple deserialization errors that were preventing enterprise commands from working correctly. The issues were caused by mismatches between our struct definitions and the actual API responses.

Problem

Several enterprise commands were failing with "error decoding response body" errors because the struct field types didn't match what the API actually returns.

Changes

ClusterInfo Struct Fixes

  • sentinel_cipher_suites: Changed from Option<String> to Option<Vec<String>> (API returns array)
  • sentinel_cipher_suites_tls_1_3: Changed from Option<Vec<Value>> to Option<String> (API returns string)
  • password_complexity: Changed from Option<Value> to Option<bool> (API returns boolean)
  • mtls_certificate_authentication: Changed from Option<String> to Option<bool> (API returns boolean)
  • upgrade_mode: Changed from Option<String> to Option<bool> (API returns boolean)

User Struct Fixes

  • Removed non-existent username field
  • Changed email from Option<String> to String (it's the user identifier)
  • Added name field for display name
  • Added missing fields: auth_method, certificate_subject_line, role_uids

License Struct Fixes

  • Removed required license_key field (doesn't exist in API)
  • Kept key and license as optional fields as returned by API

Test Updates

  • Updated mock tests to use realistic API responses
  • Added comprehensive cluster info test with actual API data
  • Fixed all test assertions to match new struct fields

Testing

  • All tests pass: cargo test --package redis-enterprise
  • Manually tested against live Redis Enterprise cluster:
    • enterprise cluster get
    • enterprise user list
    • enterprise cluster get-license

Fixes

Related Issues

The workflow commands are not yet implemented in the CLI (they're commented out).
Updated docker-compose.yml to remove the auto-init container and added manual
initialization instructions instead.
The workflow init-cluster command IS implemented and working. The issue was
using :latest tag which might not have the latest code. Using explicit
v0.5.0 tag ensures the workflow command is available.
- Bootstrap API doesn't require authentication initially
- Modified init-cluster workflow to create unauthenticated client for bootstrap
- Added ARM64 Redis Enterprise image requirement to CLAUDE.md
- Fixed docker-compose.yml to build from local Dockerfile for testing
- Verified workflow successfully initializes cluster with admin user and database
The init-cluster workflow fix for unauthenticated bootstrap is not in
v0.5.0, so the docker-compose workflow won't work until the next release.
Commented out the init container with instructions for manual initialization
and notes to re-enable after v0.5.1 is published.
…ense structs

- Fix ClusterInfo struct field types to match actual API responses:
  - sentinel_cipher_suites: String -> Vec<String>
  - sentinel_cipher_suites_tls_1_3: Vec<Value> -> String
  - password_complexity: Value -> bool
  - mtls_certificate_authentication: String -> bool
  - upgrade_mode: String -> bool

- Fix User struct to match actual API:
  - Remove non-existent 'username' field
  - Make 'email' required (it's the user identifier)
  - Add 'name' field for display name
  - Add missing fields: auth_method, certificate_subject_line, role_uids

- Fix License struct:
  - Remove required 'license_key' field (doesn't exist)
  - Keep 'key' and 'license' as optional fields

- Update mock tests to use realistic API responses
- Add comprehensive cluster info test with actual API data
- Fix rbac_impl.rs to use email instead of username

Fixes #316, #317, #323, #324, #325
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment