[PATCH aeolus-image-rubygem] OAuth only binds to Factory requests

Matt Wagner matt.wagner at redhat.com
Tue May 8 19:17:48 UTC 2012


On Tue, May 08, 2012 at 02:40:26PM -0400, Matt Wagner wrote:
> Previously, enabling OAuth for Image Factory would cause _all_
> requests flowing through ActiveResource to have OAuth headers
> added.
> ---

Whoops, forgot --compose on this message.

I've been tinkering with using ActiveResource to build a quick client
for Katello's API. I was absolutely confounded to find that requests
were coming back with "401 - Unauthenticated" errors when running "rails
console" for Conductor, since the credentials were known-good and worked
with curl. I finally had to go to a packet analyzer to figure out what
was going wrong, where I saw OAuth headers going across. I scowled.

It turns out that the code I patch here was going too far -- if Factory
was set up in Conductor to use OAuth, we would modify all requests going
through ActiveResource to sign them for OAuth. This is bad, especially
if you're using OAuth with Factory but not Katello, in which case it
essentially corrupts all of your Katello requests.

There's probably more that will be needed eventually -- the OAuth code
here still makes explicit reference to the Factory configuration. But
with this quick fix, we'll no longer call that code if we're not making
a reference to Factory.

-- Matt



More information about the aeolus-devel mailing list