reviewboard.ssh.storage¶
-
class
SSHStorage
(namespace=None)[source]¶ Bases:
object
-
read_user_key
()[source]¶ Reads the user key.
This will return an instance of
paramiko.PKey
representing the user key, if one exists. Otherwise, it will return None.
-
write_user_key
(key)[source]¶ Writes a user key.
The user key will be stored, and can be accessed later by read_user_key.
This will raise UnsupportedSSHKeyError if
key
isn’t aparamiko.RSAKey
orparamiko.DSSKey
.It may also raise
paramiko.SSHException
for key-related errors.
-
delete_user_key
(key)[source]¶ Deletes a user key.
The user key, if it exists, will be removed from storage.
If no user key exists, this will do nothing.
Reads a list of authorized keys.
The authorized keys are returned as a list of raw key data, which can then be converted into classes as needed.
-
read_host_keys
()[source]¶ Reads a list of known host keys.
This known host keys are returned as a list of raw key data, which can then be converted into classes as needed.
-
-
class
FileSSHStorage
(namespace=None)[source]¶ Bases:
reviewboard.ssh.storage.SSHStorage
-
DEFAULT_KEY_FILES
= ((<class 'paramiko.rsakey.RSAKey'>, u'id_rsa'), (<class 'paramiko.dsskey.DSSKey'>, u'id_dsa'))[source]¶
-
-
set_ssh_storage_backend_path
(storage_backend)[source]¶ Set the SSH storage backend to use for SSH.
This will store the backend in the database and make it available immediately for SSH sessions.
New in version 3.0.18.
Parameters: storage_backend (unicode) – The class path for the storage backend to set. This can be None
to unset the storage backend, using the defaults instead.
-
get_ssh_storage_backend_path
()[source]¶ Return the SSH storage backend used for SSH.
This will return the version stored in the site configuration. It does not consider any legacy methods of storing the backend.
New in version 3.0.18.
Returns: The class path for the configured storage backend. This may be None
.Return type: unicode