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

@@ -478,7 +478,7 @@ async function resolveHostCredentials(
function addLegacyCredentials(baseHost: any, host: any): void {
baseHost.password = host.password || null;
baseHost.key = host.key || null;
baseHost.keyPassword = host.keyPassword || null;
baseHost.keyPassword = host.key_password || host.keyPassword || null;
baseHost.keyType = host.keyType;
}