Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAS-132869 / 25.04 / fix KeychainCredentialSetupSSHConnectionArgs.private_key #15110

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/middlewared/middlewared/api/v25_04_0/keychain.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,16 @@ class KeychainCredentialSSHPairResult(BaseModel):
host_key: LongString


class KeychainCredentialSetupSSHConnectionPrivateKey(BaseModel):
generate_key: bool = True
existing_key_id: int | None = None
class KeychainCredentialSetupSSHConnectionKeyNew(BaseModel):
generate_key: Literal[True] = True
name: NonEmptyString


class KeychainCredentialSetupSSHConnectionKeyExisting(BaseModel):
generate_key: Literal[False] = False
existing_key_id: int


class KeychainCredentialSetupSSHConnectionSemiAutomaticSetup(
KeychainCredentialRemoteSSHSemiautomaticSetupArgs.model_fields["keychain_remote_ssh_semiautomatic_setup"].annotation
):
Expand All @@ -154,7 +158,7 @@ class KeychainCredentialSetupSSHConnectionSemiAutomaticSetup(

@single_argument_args("setup_ssh_connection")
class KeychainCredentialSetupSSHConnectionArgs(BaseModel):
private_key: KeychainCredentialSetupSSHConnectionPrivateKey | None = None
private_key: KeychainCredentialSetupSSHConnectionKeyNew | KeychainCredentialSetupSSHConnectionKeyExisting
connection_name: NonEmptyString
setup_type: Literal["SEMI-AUTOMATIC", "MANUAL"] = "MANUAL"
semi_automatic_setup: KeychainCredentialSetupSSHConnectionSemiAutomaticSetup | None = None
Expand Down
Loading