diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-06-11 18:07:34 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-06-11 18:07:34 +0000 |
commit | c826be96f30f209895083a74eabf8ee1d329bd28 (patch) | |
tree | 366b83d932cd0141c2551640c8e8d210f807a85b /lib | |
parent | b50c85dc0fb24b69255feaed91183cb5fde578a0 (diff) | |
download | puppet-c826be96f30f209895083a74eabf8ee1d329bd28.tar.gz puppet-c826be96f30f209895083a74eabf8ee1d329bd28.tar.xz puppet-c826be96f30f209895083a74eabf8ee1d329bd28.zip |
Adding a simple unit test for mongrel, and adding the ability to select the header used to store the client SSL dn.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2558 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/configuration.rb | 6 | ||||
-rw-r--r-- | lib/puppet/feature/base.rb | 3 | ||||
-rw-r--r-- | lib/puppet/network/server/mongrel.rb | 6 |
3 files changed, 11 insertions, 4 deletions
diff --git a/lib/puppet/configuration.rb b/lib/puppet/configuration.rb index 5f078d951..02f62bbcb 100644 --- a/lib/puppet/configuration.rb +++ b/lib/puppet/configuration.rb @@ -309,7 +309,11 @@ module Puppet :ca => [true, "Wether the master should function as a certificate authority."], :modulepath => [ "$confdir/modules:/usr/share/puppet/modules", "The search path for modules as a colon-separated list of - directories." ] + directories." ], + :ssl_client_header => ["HTTP_X_CLIENT_DN", "The header containing an authenticated + client's SSL DN. Only used with Mongrel. This header must be set by the proxy + to the authenticated client's SSL DN (e.g., ``/CN=puppet.reductivelabs.com``). + See the `UsingMongrel`:trac: wiki page for more information."] ) self.setdefaults(:puppetd, diff --git a/lib/puppet/feature/base.rb b/lib/puppet/feature/base.rb index b3c51cc70..98c285148 100644 --- a/lib/puppet/feature/base.rb +++ b/lib/puppet/feature/base.rb @@ -17,4 +17,7 @@ Puppet.features.add(:libshadow, :libs => ["shadow"]) # We're running as root. Puppet.features.add(:root) { require 'puppet/util/suidmanager'; Puppet::Util::SUIDManager.uid == 0 } +# We've got mongrel available +Puppet.features.add(:mongrel, :libs => %w{rubygems mongrel}) + # $Id$ diff --git a/lib/puppet/network/server/mongrel.rb b/lib/puppet/network/server/mongrel.rb index bfcf0da6f..c42a7fadd 100644 --- a/lib/puppet/network/server/mongrel.rb +++ b/lib/puppet/network/server/mongrel.rb @@ -47,8 +47,8 @@ require 'resolv' # handler = XmlRpcHandler.new # handler.xmlrpc_server.add_handler("my.add") { |a, b| a.to_i + b.to_i } # </pre> -module Puppet::Network::Server - class MongrelHandler < Mongrel::HttpHandler +module Puppet::Network + class Server::Mongrel < ::Mongrel::HttpHandler attr_reader :xmlrpc_server def initialize(handlers) @@ -114,7 +114,7 @@ module Puppet::Network::Server def client_info(request) params = request.params ip = params["REMOTE_ADDR"] - if dn = params["HTTP_X_CLIENT_DN"] + if dn = params[Puppet[:ssl_client_header]] client = dn.sub("/CN=", '') valid = true else |