Issue #7474 has been updated by Jacob Helwig.
I sent out a few comments on the revised patch to the list on 6/14, but
apparently forgot to update the ticket.
On Wed, 25 May 2011 21:28:00 -0400, Mo Morsi wrote:
>
> This patchset implements a new resource type
> representing web resources/requests which can
> be included in a puppet scipt.
>
> A default provider of this type is also included
> using the curl interface for ruby as provided by
> the 'curb' gem
>
> The second patch implements a few spec cases for
> the new type and provider
>
Mo,
Thanks for taking the time to work on this.
I was going to ask why the login & logout parameters were necessary, but
then I took a peek in the provider, and saw the session handling code.
It seems like being able to specify something like
web { 'login_service':
post => 'http://...',
parameters => { ... },
}
web { 'logout_service':
post => 'http://...',
parameters => { ... },
}
web { 'actual_request':
get => 'http://...',
require => Web['login_service'],
before => Web['logout_service'],
}
would be nice. Especially if you're looking to do more than one
'authenticated' request, so you're not logging in and out for each
request. Though I haven't really explored the behavior around
refresh only resources and requiring them, and it seems like this could
get complex quickly. I also haven't looked into how to reasonably share
the session across the resources (which sounds like a royal pain to do
securely and sanely).
On a related note to the session handling code, it looks like the
session will only be removed if you specify both login & logout, but not
if you only specify login. Seems like you always expect login & logout
to either both be specified, or neither, but there aren't any explicit
checks in the type to enforce this.
The two commits should really be squashed together since we prefer that
tests go in the same commit as the code they're testing.
The hanging indent on the commit message is a bit odd, and there's a
bunch of trailing whitespace, but that can all be cleaned up when it's
merged in.
The only things I would really like to see before this gets merged in is
some additional testing on the type & provider, and the commits squashed
together.
* It doesn't look like anything in the tests check that something like
'blargle' won't be accepted for the returns parameter on the type.
* put and delete don't seem to be covered by the tests for the type or
provider.
* Now that I look more closely at the provider specs, I noticed that
you seem to be stubbing to set the properties on the resource, which
you don't need to do with a real resource. You should be able to
set them directly.
--
Jacob Helwig
----------------------------------------
Feature #7474: puppet web resource type / provider
https://projects.puppetlabs.com/issues/7474
Author: Mo Morsi
Status: Accepted
Priority: Normal
Assignee:
Category:
Target version:
Affected Puppet version:
Keywords: puppet, web, resource, provider, type
Branch:
As part of the aeolus project (http://aeolusproject.org) we provide a puppet
recipe to install and configure the different components that make up the
framework.
Several of our components primarily provide web interfaces which to configure
the components and to create data, and previously we were manually 'exec'ing
the curl command to invoke those requests.
The problem with this is that its tricky to both verify the HTTP response code
as well as parse / verify the contents of the response, so to assist with this
we wrote a generic web resource type and provider (based on libcurl) to perform
the actual operation.
There is nothing aeolus-specific as part of this resource / provider, so I'm
sharing it here with the hopes of getting some feedback and possibly for
inclusion in the upstream project.
The patch itself can be found here:
http://git.fedorahosted.org/git/?p=aeolus/configure.git;a=commitdiff;h=24765b6d92496f6127a903c1c59e3eaf578f30a9
http://mo.morsi.org/blog/node/336
Thoughts? Any way this could be included as part of puppet?
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.