waft.cli.keys module

class waft.cli.keys.WaftPublicKey(ssh_key_file: Path = PosixPath('/home/gitlab-runner/.ssh/waft/waft'))

Bases: object

WAFT public key handler.

deploy(sftp: SFTPClient, authorized_keys_path: PurePosixPath)

Deploy public key to remote WAFT test system.

Parameters:
  • sftp (SFTPClient) – Remote SFTP connection

  • authorized_keys_path (PurePosixPath) – Remote authorized keys file path

disable(sftp: SFTPClient, authorized_keys_path: PurePosixPath)

Disable public key on remote WAFT test system.

Parameters:
  • sftp (SFTPClient) – Remote SFTP connection

  • authorized_keys_path (PurePosixPath) – Remote authorized keys file path

generate()

Backup and generate new local SSH key files.

static load(key_file: Path) str

Read and return contents of local public key file.

Parameters:

key_file (Path) – Local public key file path

Returns:

Public key value or empty string if file cannot be loaded

Return type:

str

waft.cli.keys.deploy()

Deploy existing SSH key to WAFT test system(s).

waft.cli.keys.disable()

Disable existing SSH key on WAFT test system(s).

waft.cli.keys.generate()

Generate and deploy/rotate new SSH key for WAFT test system(s).