summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Use FileCollection to store the pathname part of filesBrice Figureau2009-05-021-0/+12
| | | | | | | | | | | | | Using the FileCollection to store the path parts allows to represent a common path prefix by an integer. This way the memory used to manage deep hierarchies is reduced. The reduction factor depends on the number of managed files per directories: the more files in a directory, the more they will share the same common prefix, and the better we'll gain. Early tests on a 5 level deep hierarchy containing 100 files per level show about a 50% less memory consumption. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Add an unmunge capability to type parameters and propertiesBrice Figureau2009-05-022-3/+17
| | | | | | | | | | | | | Unmunge is the reverse of munge. While munge allows the type to return a different parameter value or properties should than the one it was created with, unmunge does the reverse. It can be used for instance to store a value in a different representation but still be able to return genuine value to the outside world. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2218 - Ruby YAML bug prevents reloading catalog in puppetdBrice Figureau2009-05-023-30/+15
| | | | | | | | | | | | | | | | | | | Because of ruby bug: http://rubyforge.org/tracker/?group_id=426&atid=1698&func=detail&aid=8886 and http://redmine.ruby-lang.org/issues/show/1331 YAML dump of hashes using ruby objects as keys is incorrect leading to an error when deserializing the YAML in puppetd. The error is easy to correct by a post-process fix-up of the generated YAML, which transforms: &id004 !ruby/object:Puppet::Relationship ? to the correct: ? &id004 !ruby/object:Puppet::Relationship Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixes #2209 - Spec is failing due to a missing requireStéphan Gorget2009-05-021-0/+1
|
* Fix #2207 - type was doing its own tag management leading to subtile bugsBrice Figureau2009-04-291-34/+4
| | | | | | | | | This patch moves Type to use Puppet::Util::Tagging as the other part of Puppet. This brings uniformity and consistency in the way the tags are used and/or compared to each other. Type was storing tags in Symbol format, which produced #2207. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixed #2188 - Added set require to simple_graph.rbJames Turnbull2009-04-271-0/+1
|
* Fixed puppetqd require and tweaked stomp library error messageJames Turnbull2009-04-261-5/+5
|
* Updated version to 0.25.0beta1James Turnbull2009-04-251-1/+1
|
* Fixing #2183 - checksum buffer size is now 4096bLuke Kanies2009-04-241-1/+2
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2187 - Puppet::Resource is expected by Rails supportLuke Kanies2009-04-243-14/+13
| | | | | | | | | | | | | We previously used and expected Puppet::Parser::Resource instances, but 0.25 converts them all to Puppet::Resource instances before they're passed out of the compiler, so the Rails integration had to be changed to expect that. There's still some muddling, because the rails resources only generate parser resources, but that works for now because that's what we expect when collecting resources. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding an 'Exported' attribute to Puppet::ResourceLuke Kanies2009-04-241-1/+5
| | | | | | This is required for Rails support. Signed-off-by: Luke Kanies <luke@madstop.com>
* Making sure the cert name is searched firstLuke Kanies2009-04-241-6/+14
| | | | | | | | | | | The cert name should be searched first in default circumstances, even if it disagrees with the hostname. Brice's change to the way catalogs are searched for didn't quite work when the hostname and certname didn't agree *and* the certname was fully qualified. Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing an "inspect" method that often failed in testingLuke Kanies2009-04-241-4/+0
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing deprecated concurrency setting usage in railsLuke Kanies2009-04-241-1/+0
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Always making sure graph edges appear firstLuke Kanies2009-04-241-1/+11
| | | | | | | If we don't do this, there's a chance we'll get hit by the ruby yaml bug again. Signed-off-by: Luke Kanies <luke@madstop.com>
* Reverting part of the switch to sets in SimpleGraphLuke Kanies2009-04-241-3/+3
| | | | | | | | | Unfortunately, again because of a Ruby bug (http://rubyforge.org/tracker/?group_id=426&atid=1698&func=detail&aid=8886) Ruby can't print yaml that it can read, if custom classes are used as keys in hashes, which Sets use internally. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing rails feature testLuke Kanies2009-04-242-6/+8
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Failing to enable storeconfigs if ActiveRecord isn't availableLuke Kanies2009-04-251-0/+1
| | | | | | This is the last step to fixing #2189. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing the Rails feature test to require 2.3.xLuke Kanies2009-04-251-17/+4
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Modifying the Settings#handlearg prototypeLuke Kanies2009-04-251-2/+2
| | | | | | | | I'd made the argument no longer optional because I thought the method was rarely used, but it's used in puppetd a good bit. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixes #2172 - service provider for gentoo fails with ambiguous suffixesJames Turnbull2009-04-241-1/+1
|
* SMF import support working and documentation updateBryan Allen2009-04-241-0/+20
|
* Fixes #2145 and #2146Bryan Allen2009-04-242-37/+60
| | | | | Adds manifest param for service type, defines a command or manifest to set up a service Add service setup (import) support
* Fix configurer to retrieve catalog with client certnameBrice Figureau2009-04-231-1/+1
| | | | | | | | | | | | | | | | | Rationale: Before this change, the catalog was retrived with this uri: /catalog/hostname On the server side, the corresponding node was found by using the request node, then finding if this node also match hostname (which it does of course). But it is not possible to have an ACL matching the hostname part of the uri, because it: * it would be compared to the node name (certname), which obviously is not the same * it is not possible to create a dynamic allow/deny rule on a non-fqdn Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Unify auth/unauthenticated request authorization systemBrice Figureau2009-04-232-37/+28
| | | | | | | | | | | | | Before this change, unauthenticated REST requests where inconditionnaly allowed, as long as they were to the certificate terminus. This could be a security hole, so now the REST requests, authenticated or unauthenticated are all submitted to the REST authorization layer. The default authorizations now contains directives to allow unauthenticated requests to the various certificate terminus to allow new hosts. The conf/auth.conf file has been modified to match such defaults. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Allow REST auth system to restrict an ACL to authenticated or ↵Brice Figureau2009-04-232-7/+30
| | | | | | | | | | | | | unauthenticated request Introduces a new auth.conf directive (auth or authenticated) which takes an argument (on,yes/off,no/all,any). This can be used to restrict an ACL to only some state of authentication of a REST request, or any. If no auth directive is given, the ACL will only trigger for authenticated requests. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fill REST request node with reverse lookup of IP addressBrice Figureau2009-04-233-0/+16
| | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Refactor rest authorization to raise exceptions deeperBrice Figureau2009-04-235-56/+94
| | | | | | | | | | | | | The idea is to raise an AuthorizationException at the same place we check the authorization instead of in an upper level to be able to spot where the authorization took place in the exception backtrace. Moreover, this changes also makes Rights::allowed? to return the matching acl so that the upper layer can have a chance to report which ACL resulted in the match. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Add environment support in the REST authorization layerBrice Figureau2009-04-233-16/+23
| | | | | | | | | With the help of the new auth.conf directive 'environment', any ACL can now be restricted to a specific environment. Omission of the directive means that the ACL will apply to all the defined environment. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #1875 - Add a REST authorization systemBrice Figureau2009-04-234-1/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces a new configuration file (and configuration setting to set it). Each REST request is checked against this configuration file, and is either allowed or denied. The configuration file has the following format: path /uripath method <methods> allow <ip> or <name> deny <ip> or <name> or path ~ <regex> method <methods> allow <ip> or <name> deny <ip> or <name> where regex is a ruby regex. This last syntax allows deny/allow interpolation from the regex captures: path ~ /files[^/]+/files/([^/]+)/([^/])/ method find allow $2.$1 If you arrange your files/ directory to have files in 'domain.com/host/', then only the referenced host will be able to access their files, other hosts will be denied. For instance: files/reductivelabs.com/dns/... files/reductivelabs.com/www/... then only files in dns can be accessible by dns.reductivelabs.com and so on... If the auth.conf file doesn't exist puppet uses sane defaults that allows clients to check-in and ask for their configurations... Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Enhance authconfig format to support uri paths and regexBrice Figureau2009-04-232-64/+220
| | | | | | | | | | | | | | | | | | | | | This patch introduces a new set of directive to the authconfig parser/file format: path /uripath or patch ~ <regex> This directive declares a new kind of ACL based on the uri path. method save, find This directive which is to be used under path directive restricts a path ACL to only some REST verbs. The ACL path system matches on path prefix possible, or on regex matches (first match wins). If no path are matching, then the authorization is not allowed. The same if no ACL matches for the given REST verb. The old namespace right matching still works as usual. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Add dynamic authorization to authstoreBrice Figureau2009-04-231-1/+40
| | | | | | | | | | | | | | | | | | | | | | The idea is to have allow/deny authorization directives that are dynamic: their evaluation is deferred until we perform the authorization checking in allowed?. This is done to allow replacing backreferences in allow/deny directives by parameters of the match that selected this right. For instance, it is possible to: allow $1.$2 And using Right::interpolate() with the result of a regex match using 2 captures, will evaluate $1.$2 to those captures. For instance, if we captured [host, reductivelabs.com], then the allow directive is replaced by: allow host.reductivelabs.com It is then safe to call allowed?, after which we can reset the interpolation. This interpolation is thread-safe. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com> authconfig regex support
* Adding support for specifying a preferred serialization formatLuke Kanies2009-04-222-4/+19
| | | | | | | | | | This isn't that great, but at least it provides basic tuning of the format. Also removing the catalog_format default, since it's no longer used. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2149 - Facts are passed as part of the catalog requestLuke Kanies2009-04-224-18/+56
| | | | | | | | | | | | | | | This removes the requirement of shared fact caching on the servers, since the server responding to the catalog request will receive the facts as part of the request. The facts are serialized as a parameter to the request, rather than each being set as a separate request parameter. This hard-codes yaml as the serialization format for the facts, because I couldn't get marshal to work and it's just not as big a deal for such a small amount of data. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2182 - SimpleGraph#walk is now iterativeLuke Kanies2009-04-221-4/+15
| | | | | | | | It was previously recursive, and was causing significant performance problems for large, wide graphs. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2181 - Using Sets instead of Arrays in SimpleGraphLuke Kanies2009-04-221-10/+10
| | | | | | This can cause a huge speedup for large numbers of edges. Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing code that was backported and is now not neededLuke Kanies2009-04-221-49/+0
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Finishing class renamesLuke Kanies2009-04-221-2/+2
| | | | | | | | | | I missed some of the Catalog mentions, and its constant changed. I've also added tests so this will get caught next time. Signed-off-by: Luke Kanies <luke@madstop.com>
* Added class_name tags to has_many relationshipssteve mcintosh2009-04-221-3/+3
|
* Adding time debugging for catalog storage to active_recordLuke Kanies2009-04-221-3/+5
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding defaults necessary for queueingLuke Kanies2009-04-221-2/+19
| | | | These are all of the defaults needed to configure queueing.
* Adding daemonization to puppetqdLuke Kanies2009-04-221-1/+17
| | | | | | | | This will need to be modified on the merge into 0.25, because the daemon module becomes a class, but that should be easy enough. Signed-off-by: Luke Kanies <luke@madstop.com>
* Using a setting for configuring queueingLuke Kanies2009-04-223-12/+6
| | | | | | | Removing class methods and such, and switching to relying solely on a setting for the queue configuration. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding puppetqd executable.Luke Kanies2009-04-221-0/+107
| | | | | | | | This uses the backported Application class, with a couple of backported monkey-patches so the class works as expected but in 0.24. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding "rubygems" and "stomp" featuresLuke Kanies2009-04-222-0/+12
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing unnecessary parser variables when yaml-dumpingLuke Kanies2009-04-226-6/+27
| | | | | | | | | Also working around a YAML bug in Ruby. And fixing tests that were broken in a previous commit in this rebase but not caught earlier. Signed-off-by: Luke Kanies <luke@madstop.com>
* Add queue indirection as an option for catalog storage.Ethan Rowe2009-04-221-0/+5
| | | | | | This eventually will allow catalog storage ("storeconfigs") to be taken out of the critical request-handling path of puppetmasterd, such that: * Puppet::Node::Catalog can be serialized to a message queue via the indirector's "save" method * a separate process can use Puppet::Node::Catalog::Queue.subscribe to pick up these catalog objects as they come in and can save them to the database through the :active_record terminus
* Introduce abstract queue terminus within the indirection system.Ethan Rowe2009-04-221-0/+78
| | | | The queue abstract terminus allows the standard indirector behaviors to interact with a message queue broker, such that the indirector's "save" method writes the relevant model object out to a queue on the message broker. While the indirector's "find" method does not map to a message queue, the queue terminus class offers a "subscribe" method that allows for easy implementation of an event loop, receiving indirected objects saved to a queue as they come in.
* Introduce queue client "plugin" namespace and interface, with a Stomp client ↵Ethan Rowe2009-04-222-0/+132
| | | | | | | | | | | implementation. Puppet::Util::Queue provides queue client mix-in behaviors that enable easy queue client management for consumer classes. Some relevant behaviors include: * standard Puppet instance loader behavior for loading queue client modules on-demand based on the client module specified by symbolic name * singleton registry of known queue client types (based on symbol-to-class mappings from the instance loading behavior) * simple interface for working with an actual queue client instance Puppet::Util::Queue::Stomp wraps the Stomp::Client class to provide an initial queue client option supporting the Stomp messaging protocol. This defines the interface for all Puppet queue client plugins going forward.
* renaming a methodLuke Kanies2009-04-222-10/+10
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>