summaryrefslogtreecommitdiffstats
path: root/lib/puppet/ssl/certificate_request.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-08-07 17:39:13 -0700
committerLuke Kanies <luke@madstop.com>2008-08-07 17:39:13 -0700
commit113d74aaa630f499c8b7989aac6680e22e8e38c8 (patch)
tree250783a4ef765ca37b70f98d6df6782f986d99ba /lib/puppet/ssl/certificate_request.rb
parent2cad30a18c5e0e4fb93603ab422c290a62d45131 (diff)
downloadpuppet-113d74aaa630f499c8b7989aac6680e22e8e38c8.tar.gz
puppet-113d74aaa630f499c8b7989aac6680e22e8e38c8.tar.xz
puppet-113d74aaa630f499c8b7989aac6680e22e8e38c8.zip
Certificates now work over REST.
All of the format work is done, they all support plaintext successfully, and I've got integration tests that demonstrate that it actually works. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet/ssl/certificate_request.rb')
-rw-r--r--lib/puppet/ssl/certificate_request.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/puppet/ssl/certificate_request.rb b/lib/puppet/ssl/certificate_request.rb
index 6a55b2bd1..e345f4bb6 100644
--- a/lib/puppet/ssl/certificate_request.rb
+++ b/lib/puppet/ssl/certificate_request.rb
@@ -7,10 +7,19 @@ class Puppet::SSL::CertificateRequest < Puppet::SSL::Base
extend Puppet::Indirector
indirects :certificate_request, :terminus_class => :file
+ # Convert a string into an instance.
+ def self.from_s(string)
+ instance = wrapped_class.new(string)
+ name = instance.subject.to_s.sub(/\/CN=/i, '').downcase
+ result = new(name)
+ result.content = instance
+ result
+ end
+
# Because of how the format handler class is included, this
# can't be in the base class.
def self.supported_formats
- [:str]
+ [:s]
end
# How to create a certificate request with our system defaults.