dgolja / golja-gnupg

Puppet module for managing GnuPG package and public keys
Apache License 2.0
13 stars 47 forks source link

Allow private keys to be managed #3

Closed tobyclemson closed 9 years ago

tobyclemson commented 9 years ago

I would like to be able to use the gnupg_key resource to import both public and private keys. Whilst this would have implicitly worked for the import, delete would have failed on a private key so this pull request adds a key_type parameter to the resource with possible values public, private, and both to define the type of keys being managed by the resource definition.

By default the key_type is public to maintain backwards compatibility and support the usual case.

I've added specs and beaker tests but didn't add any specserver tests since it appears the rake task to run them is missing.

I considered adding some validation to prevent private keys from being added from remote URLs for security reasons but I haven't added that yet. If you think it makes sense, I can add that too.

dgolja commented 9 years ago

:+1: fantastic commit ... thank you. Let me review the system tests too and If everything is fine I will merge the change and release a new version.