summaryrefslogtreecommitdiffstats
path: root/lib/puppet/indirector
Commit message (Collapse)AuthorAgeFilesLines
* Fixes #2464, #2457. Deprecate reportserver for report_server. Add ↵Nigel Kersten2009-08-041-0/+2
| | | | report_port setting. Add tests.
* Modifying the REST client error to make server errors more clearLuke Kanies2009-08-011-1/+1
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fix #2425 - make sure client can contact CA server with RESTBrice Figureau2009-07-213-0/+9
| | | | | | | The various REST SSL terminii were never setup to use the ca_server/ca_port if one is setup. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2424 - File server can't find module in environmentBrice Figureau2009-07-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Actually, the issue is: * when the web server gets the request, it creates an indirection request, filling attributes like ip or node from the HTTP request. To do this, all the interesting attributes are given in a hash (called options, see P::I::Request#new). Once the request is properly initialized the options hash doesn't contain the ip or node information (see set_attributes) * the request is then transmitted to the file_serving layer, which happily wants to use the node attribute to find environments or perform authorization. Unfortunately it fetches the node value from the request options hash, not the request itself. Since this node information is empty, puppet fails to find the proper mount point, and fails the download. This change makes sure we pass all the way down the node and fix the authorization check. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2391 - Exported resources never make to the storeconfigs dbBrice Figureau2009-07-182-1/+7
| | | | | | | | | | | | | | | | | | The issue is that when we convert Puppet::Parser::Resource catalog to a Puppet::Resource catalog before storing it to the database, we don't allow virtual resource to be converted. Unfortunately exported resources are virtual by design, and as such aren't converted, and we lose them, so it isn't possible to store them in the database. Unfortunately, the client will get the exported resources too. The fix is dual-fold: * we make sure exported resource are skipped when the transaction is applied as a last safeguard * we filter-out the catalog through the catalog compiler terminus before the catalog is returned to the client Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2261 - Make sure query string parameters are properly escapedBrice Figureau2009-07-171-4/+5
| | | | | | | | | | | | | | | | The problem is that URI.escape by default doesn't escape '+' (and some other characters). But some web framework (at least webrick) unescape the query string behind Puppet's back changing all '+' to spaces corrupting facts containing '+' characters (like base64 encoded values). The current fix makes sure we use CGI.escape for all query string parameters. Indirection keys/path are still using URI escaping because this part of the URI format shouldn't be handled like query string parameters (otherwise '/' url separators are encoded which changes the uri path). Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2392 - use Content-Type for REST communicationBrice Figureau2009-07-051-1/+1
| | | | | | | | | | | | | | | | | | | There were two problems: * server->client communications is using Content-Type with the direct format name instead of the format mime-type. * client->server communications is not using Content-Type to send the format of the serialized object. Instead it is using the first member of the Accept header. The Accept header is usually reserved for the other side, ie what the client will accept when the server will respond. This patch makes sure s->c communication contains correct Content-Type headers. This patch also adds a Content-Type header containing the mime-type of the object sent by the client when saving. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Switching Queueing to using JSON instead of YAMLLuke Kanies2009-06-061-13/+20
| | | | | | This provides about a 75x speedup, so it's totally worth it. The downside is that queueing requires json, but only on the server side.
* Removed extra whitespace from end of linesIan Taylor2009-06-0611-20/+20
|
* Fixing #2315 - ca --generate works againLuke Kanies2009-06-031-9/+1
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Changing Puppet::Cacher::Expirer#expired? method nameLuke Kanies2009-05-281-0/+1
| | | | | | | | | This method name clashed with Puppet::Indirector::Envelope#expired?, and its name wasn't actually very appropriate. The new method name is 'dependent_data_expired?'. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2240 - external node failures now log outputLuke Kanies2009-05-281-5/+1
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixes #2209 - Spec is failing due to a missing requireStéphan Gorget2009-05-021-0/+1
|
* Fixing #2149 - Facts are passed as part of the catalog requestLuke Kanies2009-04-221-9/+35
| | | | | | | | | | | | | | | 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>
* Adding time debugging for catalog storage to active_recordLuke Kanies2009-04-221-3/+5
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Using a setting for configuring queueingLuke Kanies2009-04-221-1/+0
| | | | | | | 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>
* Removing unnecessary parser variables when yaml-dumpingLuke Kanies2009-04-222-5/+5
| | | | | | | | | 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.
* Refactoring the Rails integrationLuke Kanies2009-04-222-2/+2
| | | | | | | | This moves all code from the Parser class into the ActiveRecord classes, and gets rid of 'ar_hash_merge'. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding ActiveRecord terminus classes for CatalogLuke Kanies2009-04-221-0/+34
| | | | | | | | This provides the last piece of ActiveRecord integration. It's pretty much just pass-through and *only* works if you're storing Parser resources to the db. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding ActiveRecord terminus classes for Node and Facts.Luke Kanies2009-04-223-0/+70
| | | | | | | | | This is most of the way to replacing standard StoreConfigs integration with the Indirector. We still need to convert the Catalog and then change all of the integraiton points (which is mostly the 'store' call in the Compiler). Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2171 - All certificate files are written with default permsLuke Kanies2009-04-222-5/+7
| | | | | | | | | | We were already writing all specific files with appropriate permissions; this change makes all of the files that are part of a group (which largely means files saved by puppetmasterd and puppetca) are also written using the correct permissions. Signed-off-by: Luke Kanies <luke@madstop.com>
* Partially fixing #2029 - failed caches doesn't throw an exceptionLuke Kanies2009-04-171-7/+17
| | | | | | | If the main terminus fails you get an exception, but not if a cache terminus fails. Signed-off-by: Luke Kanies <luke@madstop.com>
* Merge branch '0.24.x'Luke Kanies2009-04-021-39/+75
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bin/ralsh lib/puppet/executables/client/certhandler.rb lib/puppet/parser/functions/versioncmp.rb lib/puppet/parser/resource/reference.rb lib/puppet/provider/augeas/augeas.rb lib/puppet/provider/nameservice/directoryservice.rb lib/puppet/provider/ssh_authorized_key/parsed.rb lib/puppet/type.rb lib/puppet/type/file/checksum.rb spec/integration/defaults.rb spec/integration/transaction/report.rb spec/unit/executables/client/certhandler.rb spec/unit/indirector/ssl_rsa/file.rb spec/unit/node/catalog.rb spec/unit/provider/augeas/augeas.rb spec/unit/rails.rb spec/unit/type/ssh_authorized_key.rb spec/unit/type/tidy.rb test/executables/filebucket.rb test/executables/puppetbin.rb
| * Fixing #1991 - ldap booleans get converted to booleansLuke Kanies2009-03-051-0/+25
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
| * Refactored a method: extracted about five other methodsLuke Kanies2009-03-051-39/+50
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Adding explicit optional attribute to indirection requestsLuke Kanies2009-03-201-9/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, any option that had a setter was treated as an attribute, but now we're specifying the list of attributes settable via options. We also have a to_hash method that will take all of the options and all of those attributes and join them back into a hash. This method is used by the REST Handler module, since it uses the indirection request internally. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Adding a model accessor to the Request classLuke Kanies2009-03-201-4/+10
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Requests now use default environment when none is specifiedLuke Kanies2009-03-201-1/+8
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Moving the REST API functions into a moduleLuke Kanies2009-03-201-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This module is now used by the client and server side, rather than having a Handler module that's 90% server functionality but also used by the client. While we don't automatically get api choice from this, it at least provides a pattern for how we'll handle API development over time. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Using the Handler for the REST api on both sides of the connectionLuke Kanies2009-03-201-9/+9
| | | | | | | | | | | | | | | | | | | | Things are actually in a broken state here because we've got a conflict between how the two sides do their work and some extraction needs to get done. This commit is just a stopping-point so I can do the necessary refactoring. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Adding environment support to the REST URILuke Kanies2009-03-202-7/+28
| | | | | | | | | | | | Also adding it to the Indirection Request. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Moving the query_string method to RequestLuke Kanies2009-03-202-22/+22
| | | | | | | | | | | | | | | | It required a request instance and didn't use the REST class it was in, so it makes more sense in the Request class. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Correctly handling numerical REST argumentsLuke Kanies2009-03-101-0/+1
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fixed #1849 - Ruby 1.9 portability: `when' doesn't like colons, replace with ↵James Turnbull2009-02-261-2/+2
| | | | | | | | semicolons
* | Correctly handling URI escaping throughout the REST processLuke Kanies2009-02-195-9/+10
| | | | | | | | | | | | | | | | | | | | This means, at the least, that we can now serve files via REST when they have spaces and other weird characters in their names. This involves a small change to many files. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Providing better indirection authorization errorsLuke Kanies2009-02-192-1/+6
| | | | | | | | | | | | | | The errors now include the indirection and key, or the full URI used. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Adding pluginsyncing support to the IndirectorLuke Kanies2009-02-194-127/+29
| | | | | | | | | | | | | | | | | | This switches away from the use of terminii for each type of fileserving - it goes back to the traditional fileserving method, and is much cleaner and simpler as a result. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Switching the ModuleFiles Indirection terminus to the new Module/Env apiLuke Kanies2009-02-191-3/+3
| | | | | | | | | | | | Again, much cleaner and simpler. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Adding clarity to query string handling in REST callsLuke Kanies2009-02-181-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | We previously only handled simple strings as values, but we know handle true and false as booleans, we URI-escape all strings, and we can yaml-encode and then escape arrays of strings. This could get abused a bit, in that we're just yaml-dumping anything that's an array, but it should be pretty safe. Mmmm, should. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fixing #1527 - Failing Facter does not hurt PuppetLuke Kanies2009-02-141-1/+7
| | | | | | | | | | | | | | | | At this point, the server's behaviour is a bit undefined if it tries to compile the catalog with no facts locally. The next commits will fix that. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Removing some unused codeLuke Kanies2009-02-141-11/+0
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Merge branch '0.24.x'Luke Kanies2009-02-131-2/+6
|\| | | | | | | | | | | | | | | | | | | Conflicts: lib/puppet/indirector/facts/facter.rb lib/puppet/provider/augeas/augeas.rb lib/puppet/util/filetype.rb spec/unit/indirector/facts/facter.rb spec/unit/provider/augeas/augeas.rb test/util/filetype.rb
| * Fixing #1964 - Facts get loaded from pluginsLuke Kanies2009-02-121-2/+6
| | | | | | | | | | | | | | | | Applying slightly modified patch. Also added tests. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Changing how the Configurer interacts with the cacheLuke Kanies2009-02-062-3/+16
| | | | | | | | | | | | | | | | | | This changes the hooks provided via the Indirector Request for determining how the cache is used. These hooks are only used by the Configurer class. They're messy, but I can't come up with a better design, and they're at least sufficient. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Adding an Agent::Runner class.Luke Kanies2009-02-061-0/+7
| | | | | | | | | | | | | | This will eventually be used by puppetrun, but for now is just called by the old-school Runner handler. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fixing (and testing) the return of Indirection#saveLuke Kanies2009-02-061-1/+3
| | | | | | | | | | | | | | | | This broke in a previous commit, and was apparently not tested well because of how the mocks were set up. The integration test caught it. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Adding REST support for facts and catalogs.Luke Kanies2009-02-062-0/+12
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Allowing the Indirection cache to be reset to nilLuke Kanies2009-02-061-1/+1
| | | | | | | | | | | | Otherwise we couldn't disable a cache once configured. Signed-off-by: Luke Kanies <luke@madstop.com>