Fix SSH Key Password (keyPassword) Field Naming Mismatch Between Frontend and Backend (#375)

* Refactor key_password to keyPassword for consistency across SSH routes

* Standardizes keyPassword field handling and simplifies auth field logic

Standardizes the handling of the `keyPassword` field by converting
`key_password` to camelCase and ensuring consistent output while
preserving resolved credentials. Removes redundant snake_case
fields to avoid duplication.

Simplifies UI handling of authentication fields by allowing
non-relevant fields to persist, delegating filtering logic to the
backend for cleaner and more maintainable code.

Improves code clarity and aligns with consistent data handling
practices.

* Cleanup code + resolve conversion logic

---------

Co-authored-by: LukeGus <bugattiguy527@gmail.com>
This commit was merged in pull request #375.
This commit is contained in:
Ved Prakash
2025-10-08 02:35:34 +05:30
committed by GitHub
parent 2cae7ae650
commit 1f614abcfc
4 changed files with 28 additions and 27 deletions

View File

@@ -877,21 +877,6 @@ export function HostManagerEditor({
| "credential";
setAuthTab(newAuthType);
form.setValue("authType", newAuthType);
if (newAuthType === "password") {
form.setValue("key", null);
form.setValue("keyPassword", "");
form.setValue("keyType", "auto");
form.setValue("credentialId", null);
} else if (newAuthType === "key") {
form.setValue("password", "");
form.setValue("credentialId", null);
} else if (newAuthType === "credential") {
form.setValue("password", "");
form.setValue("key", null);
form.setValue("keyPassword", "");
form.setValue("keyType", "auto");
}
}}
className="flex-1 flex flex-col h-full min-h-0"
>