GitHub user Jc2k opened a pull request:

    https://github.com/apache/libcloud/pull/133

    Allow ec2 drivers to support the ssh-key feature [WIP]

    This still needs actual testing, unittests and PEP8 checking, but is ready 
for some feedback on approach, factoring and function names.
    
    The goal is that if I pass a NodeAuthSSHKey to ec2 (via ``auth`` argument 
of ``create_node``), that public key will be automatically imported into the 
KeyPair system, if it hasn't been already.
    
    This commit adds new utility functions for extracting fingerprints
    from public keys. There are 2 versions of this. It is quite easy
    to make an OpenSSH style fingerprint, but EC2 uses an SSH2 style
    fingerprint (which has extra DER encoding applied to it before
    hashing).
    
    This commit allows you to import a public ssh key that you
    have as a string (previously the key had to exist on disk).
    
    You can now use ex_list_keypairs rather than ex_describe_all_keypairs.
    The latter gives you a list of key names, you then need to do a
    HTTP request for each keyname if you want to check their fingerprint.
    The former returns a list of dictionaries with more info.
    Therefore, ex_list_keypairs is much more efficient.
    
    ex_describe_all_keypairs was reimplemented on top of
    ex_list_keypairs, but I think it should be marked as deprecated.
    
    A new ex_ method is now available to find or import a public key.
    Given a public key it will find it on ec2 by its fingerprint. If
    it is not available it is automatically imported.
    
    The create_node method uses this method to lookup or import an
    SSH key that is provided to it by a NodeAuthSSHKey (via auth arg).
    This means ec2 now properly supports the ssh-key feature.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/Jc2k/libcloud ec2-auth-support

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/libcloud/pull/133.patch

----

----

Reply via email to