-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Overview
The CLI's current approach to handling credentials could be improved for better reliability and backwards compatibility.
Current Behavior
When performing operations like sf clusters users list
or sf clusters config
, the CLI:
- Fetches all credentials from the API
- Attempts to decrypt every credential, regardless of whether it's needed for the current operation
- Silently continues when decryption fails
- Treats regular namespace credentials and vCluster credentials differently
Proposed Improvements
- Unified credential decryption: Consider unified handling for both regular namespace credentials and vCluster credentials
- Smarter credential filtering: Filter credentials upfront based on what's relevant for the current operation
- Better error handling: Provide more informative error messages when decryption fails
- Field flexibility: Support credentials stored in either
encrypted_token
orKubeConfig
fields for vCluster credentials
Benefits
- Improved reliability when working with mixed credential types
- Greater resilience to server-side changes
- Better error reporting for users
- Reduced unnecessary decryption operations
Implementation Notes
The main areas for improvement would be in src/lib/clusters/clusters.tsx
and src/lib/clusters/credentialTypes.ts
to make the credential handling more robust and flexible.
This change will complement server-side improvements for storing credential data consistently.
Metadata
Metadata
Assignees
Labels
No labels