fix: resolve Proxmox authentication response parsing error #126

Merged
sarman merged 4 commits from fix/proxmox-auth-decoding into beta 2026-06-21 03:13:38 +00:00
Owner
  • Removed incorrect #[serde(rename_all = "PascalCase")] attribute from AuthResponse struct
  • Proxmox API returns lowercase fields (ticket, username, clustername) not PascalCase
  • Added missing clustername field to AuthResponse struct
  • Updated unit tests to match actual Proxmox API response format
  • Added 4 integration tests for Proxmox API endpoints:
    • test_real_proxmox_auth - verifies authentication works
    • test_real_proxmox_cluster_resources - fetches cluster resources
    • test_real_proxmox_nodes - fetches node status
    • test_real_proxmox_vms - fetches VM list
  • All 432 Rust tests passing
  • All integration tests verified against https://172.0.0.18:8006
- Removed incorrect #[serde(rename_all = "PascalCase")] attribute from AuthResponse struct - Proxmox API returns lowercase fields (ticket, username, clustername) not PascalCase - Added missing clustername field to AuthResponse struct - Updated unit tests to match actual Proxmox API response format - Added 4 integration tests for Proxmox API endpoints: * test_real_proxmox_auth - verifies authentication works * test_real_proxmox_cluster_resources - fetches cluster resources * test_real_proxmox_nodes - fetches node status * test_real_proxmox_vms - fetches VM list - All 432 Rust tests passing - All integration tests verified against https://172.0.0.18:8006
sarman added 1 commit 2026-06-21 02:40:18 +00:00
fix: resolve Proxmox authentication response parsing error
Some checks failed
Test / frontend-tests (pull_request) Successful in 1m41s
Test / frontend-typecheck (pull_request) Successful in 1m51s
PR Review Automation / review (pull_request) Successful in 4m24s
Test / rust-fmt-check (pull_request) Failing after 12m43s
Test / rust-clippy (pull_request) Successful in 13m51s
Test / rust-tests (pull_request) Successful in 15m12s
1904f832c6
- Removed incorrect #[serde(rename_all = "PascalCase")] attribute from AuthResponse struct
- Proxmox API returns lowercase fields (ticket, username, clustername) not PascalCase
- Added missing clustername field to AuthResponse struct
- Updated unit tests to match actual Proxmox API response format
- Added 4 integration tests for Proxmox API endpoints:
  * test_real_proxmox_auth - verifies authentication works
  * test_real_proxmox_cluster_resources - fetches cluster resources
  * test_real_proxmox_nodes - fetches node status
  * test_real_proxmox_vms - fetches VM list
- All 432 Rust tests passing
- All integration tests verified against https://172.0.0.18:8006
sarman reviewed 2026-06-21 02:44:41 +00:00
sarman left a comment
Author
Owner

Automated PR Review (qwen3.5-122b-think via liteLLM):\n\n

Summary

The PR fixes a serialization mismatch between the Proxmox API response format and the AuthResponse struct. The changes correctly remove the incorrect #[serde(rename_all = "PascalCase")] attribute and align field names with the actual lowercase Proxmox API response format. The integration tests are properly structured to skip when credentials aren't available.

Findings

  • [SUGGESTION] src-tauri/src/proxmox/client.rs:484 - Integration tests are hardcoded to specific Proxmox server IP
    Evidence: let mut client = ProxmoxClient::new("172.0.0.18", 8006, "root@pam");
    Fix: Consider using an environment variable (e.g., PROXMOX_HOST) for the server address to improve test portability across different environments

  • [SUGGESTION] src-tauri/src/proxmox/client.rs:484 - Integration tests have duplicated setup code
    Evidence: All 4 tests repeat the same PROXMOX_PASSWORD env check and client initialization pattern
    Fix: Extract common setup into a test helper function to reduce duplication and improve maintainability

Verdict: APPROVE WITH COMMENTS


Additional Notes

The core changes are well-implemented:

  • AuthResponse struct now correctly uses lowercase field names matching Proxmox API
  • CSRFPreventionToken properly handled with explicit #[serde(rename = "CSRFPreventionToken")]
  • clustername field added with #[serde(default)] for backward compatibility
  • Unit tests updated to reflect actual API response format
  • Integration tests gracefully skip when credentials unavailable

No compilation, security, or logic errors detected. The PR successfully resolves the authentication parsing issue.

Automated PR Review (qwen3.5-122b-think via liteLLM):\n\n **Summary** The PR fixes a serialization mismatch between the Proxmox API response format and the `AuthResponse` struct. The changes correctly remove the incorrect `#[serde(rename_all = "PascalCase")]` attribute and align field names with the actual lowercase Proxmox API response format. The integration tests are properly structured to skip when credentials aren't available. **Findings** - [SUGGESTION] src-tauri/src/proxmox/client.rs:484 - Integration tests are hardcoded to specific Proxmox server IP Evidence: `let mut client = ProxmoxClient::new("172.0.0.18", 8006, "root@pam");` Fix: Consider using an environment variable (e.g., `PROXMOX_HOST`) for the server address to improve test portability across different environments - [SUGGESTION] src-tauri/src/proxmox/client.rs:484 - Integration tests have duplicated setup code Evidence: All 4 tests repeat the same `PROXMOX_PASSWORD` env check and client initialization pattern Fix: Extract common setup into a test helper function to reduce duplication and improve maintainability **Verdict**: APPROVE WITH COMMENTS --- **Additional Notes** The core changes are well-implemented: - ✅ `AuthResponse` struct now correctly uses lowercase field names matching Proxmox API - ✅ `CSRFPreventionToken` properly handled with explicit `#[serde(rename = "CSRFPreventionToken")]` - ✅ `clustername` field added with `#[serde(default)]` for backward compatibility - ✅ Unit tests updated to reflect actual API response format - ✅ Integration tests gracefully skip when credentials unavailable No compilation, security, or logic errors detected. The PR successfully resolves the authentication parsing issue.
sarman added 2 commits 2026-06-21 02:51:59 +00:00
- Add get_test_client() helper to reduce test duplication
- Use PROXMOX_HOST environment variable for configurable server address
- Add PROXMOX_HOST to ~/.bashrc with default value
docs: remove hardcoded 172.0.0.18 references
Some checks failed
PR Review Automation / review (pull_request) Has been cancelled
Test / frontend-typecheck (pull_request) Has been cancelled
Test / frontend-tests (pull_request) Has been cancelled
Test / rust-tests (pull_request) Has been cancelled
Test / rust-clippy (pull_request) Has been cancelled
Test / rust-fmt-check (pull_request) Has been cancelled
cec962b349
Replace with generic proxmox-server hostname across all documentation
and code comments.
sarman added 1 commit 2026-06-21 02:57:00 +00:00
style: format proxmox client code with cargo fmt
Some checks failed
PR Review Automation / review (pull_request) Has been cancelled
Test / frontend-tests (pull_request) Successful in 1m46s
Test / frontend-typecheck (pull_request) Successful in 1m53s
Test / rust-fmt-check (pull_request) Successful in 12m1s
Test / rust-clippy (pull_request) Successful in 13m25s
Test / rust-tests (pull_request) Successful in 15m37s
bad3042d2d
sarman merged commit a0e507b16b into beta 2026-06-21 03:13:38 +00:00
sarman deleted branch fix/proxmox-auth-decoding 2026-06-21 03:13:39 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sarman/tftsr-devops_investigation#126
No description provided.