diff options
author | Luke Kanies <luke@madstop.com> | 2008-04-15 21:28:57 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-04-15 21:34:07 -0500 |
commit | 054e4e431a145737c42d767249f1b94685c9a6d7 (patch) | |
tree | 10037d7b41d0ebc56e8489534c2b8586944f8fd6 /lib/puppet/ssl/certificate.rb | |
parent | 6900f9776a7875ea13cbb5fe1f2eaa48fe05e667 (diff) | |
download | puppet-054e4e431a145737c42d767249f1b94685c9a6d7.tar.gz puppet-054e4e431a145737c42d767249f1b94685c9a6d7.tar.xz puppet-054e4e431a145737c42d767249f1b94685c9a6d7.zip |
Making the first pass at using requests instead of
specifying the terminus class. The individual ssl
classes now work, but the ssl host class doesn't yet.
Diffstat (limited to 'lib/puppet/ssl/certificate.rb')
-rw-r--r-- | lib/puppet/ssl/certificate.rb | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/lib/puppet/ssl/certificate.rb b/lib/puppet/ssl/certificate.rb index 697b2e785..9b1e2a79a 100644 --- a/lib/puppet/ssl/certificate.rb +++ b/lib/puppet/ssl/certificate.rb @@ -1,12 +1,16 @@ require 'puppet/ssl/base' -# Manage certificates themselves. +# Manage certificates themselves. This class has no +# 'generate' method because the CA is responsible +# for turning CSRs into certificates; we can only +# retrieve them from the CA (or not, as is often +# the case). class Puppet::SSL::Certificate < Puppet::SSL::Base # This is defined from the base class wraps OpenSSL::X509::Certificate extend Puppet::Indirector - indirects :certificate, :extend => Puppet::SSL::IndirectionHooks + indirects :certificate # Indicate where we should get our signed certs from. def self.ca_is(dest) @@ -22,24 +26,4 @@ class Puppet::SSL::Certificate < Puppet::SSL::Base :local end end - - # Request a certificate from our CA. - def generate(request) - if self.class.ca_location == :local - terminus = :ca_file - else - terminus = :rest - end - - # Save our certificate request. - request.save :in => terminus - - # And see if we can retrieve the certificate. - if cert = self.class.find(name, :in => terminus) - @content = cert.content - return true - else - return false - end - end end |